private void RenderUnderLight(SceneNodeBase sceneNodeBase, ShadowMappingUnderLightEventArgs arg)
        {
            if (sceneNodeBase != null)
            {
                var      node     = sceneNodeBase as ISupportShadowMapping;
                TwoFlags flags    = (node != null) ? node.EnableShadowMapping : TwoFlags.None;
                bool     before   = (node != null) && ((flags & TwoFlags.BeforeChildren) == TwoFlags.BeforeChildren);
                bool     children = (node == null) || ((flags & TwoFlags.Children) == TwoFlags.Children);

                if (before)
                {
                    flags  = node.EnableRenderUnderLight;
                    before = (flags & TwoFlags.BeforeChildren) == TwoFlags.BeforeChildren;
                }

                if (children)
                {
                    flags    = (node != null) ? node.EnableRenderUnderLight : TwoFlags.None;
                    children = (node == null) || ((flags & TwoFlags.Children) == TwoFlags.Children);
                }

                if (before)
                {
                    node.RenderUnderLight(arg);
                }

                if (children)
                {
                    foreach (var item in sceneNodeBase.Children)
                    {
                        RenderUnderLight(item, arg);
                    }
                }
            }
        }
        private void LightTheScene(LightBase light, Scene scene, ActionParams param)
        {
            // cast shadow from specified light.
            {
                this.lightEquipment.Begin(param.Viewport);

                var arg = new ShadowMappingCastShadowEventArgs(light);
                //this.colorMask.On();
                CastShadow(scene.RootNode, arg);
                //this.colorMask.Off();
                this.lightEquipment.End();
            }

            // light up the scene with specified light.
            {
                var arg = new ShadowMappingUnderLightEventArgs(param, scene.Camera, this.lightEquipment.BindingTexture, light);
                this.blend.On();
                RenderUnderLight(this.scene.RootNode, arg);
                this.blend.Off();
            }
        }
 public void RenderUnderLight(ShadowMappingUnderLightEventArgs arg)
 {
 }