public void CommitChanges() { if (size != ShadowMap.Width) { if (ShadowMap != null) { ShadowMap.Dispose(); } ShadowMap = new RenderTexture2D(size, size, Format.R32_FLOAT, Format.D16_UNORM); Rendered = false; } }
private void DisposeResources() { _rtHdrScene.Dispose(); _rtBrightPassFilter.Dispose(); _rtStartSource.Dispose(); _rtCurrentAdaptedLuminance.Dispose(); _rtLastAdaptedLuminance.Dispose(); _rtStarFinal.Dispose(); int i; for (i = 0; i < Bloomtextures; i++) { _rtBloom[i].Dispose(); } for (i = 0; i < Tonemaptextures; i++) { _rtToneMap[i].Dispose(); } for (i = 0; i < Starmaxlines; i++) { _rtStarLines[i].Dispose(); } for (i = 0; i < Starmaxpasses; i++) { _rtStarPasses[i].Dispose(); } }
protected override void OnDispose(bool d) { if (d) { _rtReflection.Dispose(); _rtRefraction.Dispose(); } base.OnDispose(d); }
private void Initialize() { if (_shadowRt != null) { _shadowRt.Dispose(); } var bb = GraphicDeviceFactory.Device.BackBuffer; var kernel = EngineState.Shadow.ShadowMapping.PcfBlurSize; _shadowRt = new RenderTexture2D(bb.Width, bb.Height, Format.R8G8B8A8_UNORM); _vp = new ViewPort(0, 0, _shadowRt.Width, _shadowRt.Height); }
public void Initialize() { if (_rtx != null) { _rtx.Dispose(); } _rtx = new RenderTexture2D(_width, _height, Format.R8G8B8A8_UNORM, _depthFormat, Multisampling.Disable, true); _vp = new ViewPort(0, 0, _width, _height); if (_blend != null) { _blend.Dispose(); } _blend = GraphicDeviceFactory.Device.CreateBlendState(new BlendDesc( blendEnable: false, alphaToCoverageEnable: false)); if (_rast != null) { _rast.Dispose(); } _rast = GraphicDeviceFactory.Device.CreateRasterizerState(new RasterizerDesc ( cull: CullMode.None, fill: FillMode.Solid, multisampleEnable: false, antialiasedLineEnable: false )); _depth = Engine.Graphics.CreateDepthStencilState(new DepthStencilStateDesc( depthFunc: Comparison.Less )); Require <IdPhysicRenderTechnique>(); }