Example #1
0
 private GpuSmitsBVHNode[] BuildHandle_CS()
 {
     var helper = new BoundingVolumeHierarchyAccelerationHelper();
     helper.Init(scene, scene.Meshes.ToArray());
     return
         helper.nodes.Select(
             node =>
             new GpuSmitsBVHNode()
                 {
                     bbox = new AABBInfo(node.Bounds),
                     primitive = node.PrimitiveIndex,
                     skipIndex = node.SkipIndex
                 }).ToArray();
 }
Example #2
0
        public void OpenFrame(FrameDescription frame)
        {
            this.config = frame;

            this.FrameName = frame.FrameName;
            Width = frame.Get<int>("ImageWidth");
            Height = frame.Get<int>("ImageHeight");

            Directory.SetCurrentDirectory(frame.WorkingDir);
            foreach (var frameElement in frame.Elements.Where(frameElement => frameParsers.ContainsKey(frameElement.GetType())))
            {
                frameParsers[frameElement.GetType()](frameElement);
            }

            primitives = new List<GLScenePrimitive>();

            bboxes = new List<AABB>();
            var helper = new BoundingVolumeHierarchyAccelerationHelper();
            var s = new RayEngineScene();
               //(scene, null);
            helper.Init( s, s.Meshes.ToArray());
            
            bboxes.AddRange(helper.nodes.Select(item=>item.Bounds));
        }