Exemple #1
0
        private bool RenderReflectionToTexture()
        {
            // Set the render target to be the refraction render to texture.
            RenderReflectionTexture.SetRenderTarget(D3D.DeviceContext, D3D.DepthStencilView);

            // Clear the render to texture.
            RenderReflectionTexture.ClearRenderTarget(D3D.DeviceContext, D3D.DepthStencilView, 0, 0, 0, 1);

            // Render the scene now and it will draw to the render to texture instead of the back buffer.
            if (!RenderReflectionScene())
            {
                return(false);
            }

            // Reset the render target back to the original back buffer and not to texture anymore.
            D3D.SetBackBufferRenderTarget();

            return(true);
        }
Exemple #2
0
        public void Shutdown()
        {
            // Release the light object.
            Light = null;
            // Release the camera object.
            Camera = null;

            // Release the water shader object.
            WaterShader?.ShutDown();
            WaterShader = null;
            // Release the refraction shader object.
            RefractionShader?.ShutDown();
            RefractionShader = null;
            /// Release the render to texture object.
            RenderReflectionTexture?.Shutdown();
            RenderReflectionTexture = null;
            // Release the render to texture object.
            RenderRefractionTexture?.Shutdown();
            RenderRefractionTexture = null;
            // Release the light shader object.
            LightShader?.ShutDown();
            LightShader = null;
            // Release the model object.
            GroundModel?.Shutdown();
            GroundModel = null;
            // Release the model object.
            WallModel?.Shutdown();
            WallModel = null;
            // Release the model object.
            BathModel?.Shutdown();
            BathModel = null;
            // Release the model object.
            WaterModel?.Shutdown();
            WaterModel = null;
            // Release the Direct3D object.
            D3D?.ShutDown();
            D3D = null;
        }
Exemple #3
0
        public void Shutdown()
        {
            // Release the reflection shader object.
            if (ReflectionShader != null)
            {
                ReflectionShader.Shuddown();
                ReflectionShader = null;
            }

            // Release the transparent shader object.
            if (TransparentShader != null)
            {
                TransparentShader.Shuddown();
                TransparentShader = null;
            }

            // Release the translate shader object.
            if (TranslateShader != null)
            {
                TranslateShader.Shuddown();
                TranslateShader = null;
            }

            // Release the clip plane shader object.
            if (ClipPlaneShader != null)
            {
                ClipPlaneShader.Shuddown();
                ClipPlaneShader = null;
            }

            // Release the fog shader object.
            if (FogShader != null)
            {
                FogShader.Shuddown();
                FogShader = null;
            }

            // Release the texture shader object.
            if (TextureShader != null)
            {
                TextureShader.Shuddown();
                TextureShader = null;
            }

            // Release the debug window object.
            if (DebugWindow != null)
            {
                DebugWindow.Shutdown();
                DebugWindow = null;
            }

            // Release the debug render to texture object.
            if (RenderDebugTexture != null)
            {
                RenderDebugTexture.Shutdown();
                RenderDebugTexture = null;
            }

            // Release the render to texture object.
            if (RenderReflectionTexture != null)
            {
                RenderReflectionTexture.Shutdown();
                RenderReflectionTexture = null;
            }

            // Release the light object.
            Light = null;

            // Release the shader object.
            if (LightShader != null)
            {
                LightShader.Shuddown();
                LightShader = null;
            }

            // Release the model object.
            if (Model != null)
            {
                Model.Shutdown();
                Model = null;
            }

            // Release the light shader object.
            if (BumpMapShader != null)
            {
                BumpMapShader.Shuddown();
                BumpMapShader = null;
            }

            // Release the model object.
            if (BumpMapModel != null)
            {
                BumpMapModel.Shutdown();
                BumpMapModel = null;
            }

            // Release the text object.
            if (Text != null)
            {
                Text.Shutdown();
                Text = null;
            }

            // Release the camera object.
            if (Camera != null)
            {
                Camera = null;
            }

            // Release the Direct3D object.
            if (D3D != null)
            {
                D3D.Shutdown();
                D3D = null;
            }
        }