Exemple #1
0
        public Scene(Context context, SceneType type, EmbreeDevice embreeDevice, RadeonRaysDevice radeonRaysDevice, ClosestHitCallback closestHitCallback, AnyHitCallback anyHitCallback)
        {
            mContext = context;

            var sceneSettings = new SceneSettings {
            };

            sceneSettings.type               = type;
            sceneSettings.embreeDevice       = (embreeDevice != null) ? embreeDevice.Get() : IntPtr.Zero;
            sceneSettings.radeonRaysDevice   = (radeonRaysDevice != null) ? radeonRaysDevice.Get() : IntPtr.Zero;
            sceneSettings.closestHitCallback = closestHitCallback;
            sceneSettings.anyHitCallback     = anyHitCallback;

            var status = API.iplSceneCreate(context.Get(), ref sceneSettings, out mScene);

            if (status != Error.Success)
            {
                throw new Exception(string.Format("Unable to create scene [{0}]", status.ToString()));
            }
        }
 public static extern void iplSetRayTracerCallbacks(IntPtr scene, ClosestHitCallback closetHitCallback, AnyHitCallback anyHitCallback, IntPtr userData);
Exemple #3
0
 public static extern Error iplCreateScene(IntPtr context, IntPtr computeDevice,
                                           SimulationSettings simulationSettings, int numMaterials, Material[] materials,
                                           ClosestHitCallback closestHitCallback, AnyHitCallback anyHitCallback,
                                           BatchedClosestHitCallback batchedClosestHitCallback, BatchedAnyHitCallback batchedAnyHitCallback,
                                           IntPtr userData, [In, Out] ref IntPtr scene);