Пример #1
0
        public void IntersectRays(RayIntersections rays, RayGeometry geom)
        {
            if (locked)
            {
                if (!IsRadRayStream)
                {
                    throw new Exception("Not a raytracing enabled command buffer.");
                }

                rrCmdIntersect(GraphicsDevice.DeviceInformation[devID].RaysContext, geom.geomBufferPtr, RRIntersectQuery.RrIntersectQueryClosest, rays.rayBufferPtr, rays.MaxRayCount, rays.indirectRayCountPtr, RRIntersectQueryOutput.RrIntersectQueryOutputFullHit, rays.resultBufferPtr, rays.scratchBufferPtr, radRayStream);
                IsEmpty = false;
            }
            else
            {
                throw new Exception("Command buffer not built.");
            }
        }
Пример #2
0
        public void BuildGeometry(RayGeometry geom)
        {
            if (locked)
            {
                if (!IsRadRayStream)
                {
                    throw new Exception("Not a raytracing enabled command buffer.");
                }

                var geom_build_input = geom.GeometryBuildInput_ptr;
                var build_options    = new RRBuildOptions()
                {
                    build_flags = 0,
                };
                var build_options_ptr = build_options.Pointer();

                rrCmdBuildGeometry(GraphicsDevice.DeviceInformation[devID].RaysContext, RRBuildOperation.RrBuildOperationBuild, geom_build_input, build_options_ptr, geom.scratchBufferPtr, geom.geomBufferPtr, radRayStream);
                IsEmpty = false;
            }
            else
            {
                throw new Exception("Command buffer not built.");
            }
        }