Exemplo n.º 1
0
 public override void OnRender(RenderView view)
 {
     SkyElementManager s = (SkyElementManager)view.GetRenderElementManager(RenderPass.Sky);
     if (s != null)
         s.Elements.Add(renderElement);
     base.OnRender(view);
 }
Exemplo n.º 2
0
 public override void OnRender(RenderView view)
 {
     if (view.GetRenderType() == RenderViewType.SHADOWS)
         return;
     SkyElementManager s = (SkyElementManager)view.GetRenderElementManager(RenderPass.Sky);
     if (s != null)
         s.Elements.Add(renderElement);
     base.OnRender(view);
 }
Exemplo n.º 3
0
 public override void OnRender(RenderView view)
 {
     bool canRender = (view.GetFrustum().Contains(Transformation.GetBounds()) != ContainmentType.Disjoint);
     canRender |= (type == LightType.Directional);
     if (canRender)
     {
         LightElementManager lightMgr = (LightElementManager)view.GetRenderElementManager(RenderPass.Light);
         if (lightMgr != null)
         {
             switch (type)
             {
                 case LightType.Directional:
                     if (castsShadows)
                         lightMgr.DirectionalShadowLights.Enqueue(this);
                     else
                         lightMgr.DirectionalLights.Enqueue(this);
                     break;
                 case LightType.Point:
                     lightMgr.PointLights.Enqueue(this);
                     break;
                 case LightType.Spot:
                     lightMgr.SpotLights.Enqueue(this);
                     break;
             }
         }
     }
     base.OnRender(view);
 }
Exemplo n.º 4
0
        void RecursivelyRenderDebug(KDNode<VoxelElement> node, RenderView view, int depth, bool isLeft)
        {
            if (node == null)// || view.GetFrustum().Contains(node.bounds) == ContainmentType.Disjoint)
                return;

            {

                Gaia.Rendering.DebugElementManager debugMgr = (Gaia.Rendering.DebugElementManager)view.GetRenderElementManager(Gaia.Rendering.RenderPass.Debug);
                Color currColor = (isLeft) ? nodeColorsLeft[depth % nodeColorsLeft.Length] : nodeColors[depth % nodeColors.Length];
                if (depth == maxDepth)
                    debugMgr.AddElements(DebugHelper.GetVerticesFromBounds(node.bounds, currColor));

                if (node.element != null)
                {
                    debugMgr.AddElements(DebugHelper.GetVerticesFromBounds(node.element.bounds, Color.White));
                }
            }
            depth++;
            //if (depth < maxDepth)
            {
                RecursivelyRenderDebug(node.leftChild, view, depth, true);
                RecursivelyRenderDebug(node.rightChild, view, depth, false);
            }
        }
 public override void OnRender(RenderView view)
 {
     ParticleElementManager particleMgr = (ParticleElementManager)view.GetRenderElementManager(RenderPass.Particles);
     if (particleMgr != null)
     {
         particleMgr.AddElement(particleEffect.material, this);
     }
     base.OnRender(view);
 }
Exemplo n.º 6
0
 public void RenderDebug(RenderView view)
 {
     /*
     for (int i = 0; i < hitBoxesTransformed.Count; i++)
     {
         DebugElementManager debugMgr = (DebugElementManager)view.GetRenderElementManager(RenderPass.Debug);
         debugMgr.AddElements(DebugHelper.GetVerticesFromBounds(hitBoxesTransformed.Values[i], Color.Red));
     }
     */
     DebugElementManager debugMgr = (DebugElementManager)view.GetRenderElementManager(RenderPass.Debug);
     for (int i = 0; i < hitBoxesGrouped.Count; i++)
     {
         debugMgr.AddElements(DebugHelper.GetVerticesFromBounds(hitBoxesGrouped.Values[i], Color.Red));
     }
     debugMgr.AddElements(DebugHelper.GetVerticesFromBounds(hitBounds, Color.Blue));
 }