예제 #1
0
 public override void Draw(IDeviceContextHolder holder, ICamera camera, SpecialRenderMode mode, Func <IRenderableObject, bool> filter = null)
 {
     if (mode != SpecialRenderMode.Simple && mode != SpecialRenderMode.SimpleTransparent && mode != SpecialRenderMode.GBuffer)
     {
         return;
     }
     _object.Draw(holder, camera, mode, filter);
 }
예제 #2
0
        public override void Draw(IDeviceContextHolder contextHolder, ICamera camera, SpecialRenderMode mode, Func <IRenderableObject, bool> filter = null)
        {
            if (mode != SpecialRenderMode.Simple && mode != SpecialRenderMode.SimpleTransparent)
            {
                return;
            }

            var state = contextHolder.DeviceContext.Rasterizer.State;

            try {
                contextHolder.DeviceContext.Rasterizer.State = contextHolder.States.InvertedState;
                contextHolder.GetEffect <EffectDarkMaterial>().FxFlatMirrored.Set(true);
                base.Draw(contextHolder, camera, mode, filter);
            } finally {
                contextHolder.DeviceContext.Rasterizer.State = state;
                contextHolder.GetEffect <EffectDarkMaterial>().FxFlatMirrored.Set(false);
            }

            _object.Draw(contextHolder, camera, mode, filter);
        }