///<summary> /// Create (or update) render textures for slices ///</summary> ///<param name="update">are we updating an existing texture</param> protected void CreateRenderTextures(bool update) { if (update) { Debug.Assert(sliceTRT.Count == Depth); foreach (XnaRenderTexture trt in sliceTRT) { trt.Rebind(this); } return; } DestroyRenderTextures(); // Create render target for each slice sliceTRT.Clear(); Debug.Assert(Depth == 1); for (var zoffset = 0; zoffset < Depth; ++zoffset) { var name = "rtt/" + ID; RenderTexture trt = new XnaRenderTexture(name, this); sliceTRT.Add(trt); Root.Instance.RenderSystem.AttachRenderTarget(trt); } }
///<summary> /// Create (or update) render textures for slices ///</summary> ///<param name="update">are we updating an existing texture</param> protected void CreateRenderTextures( bool update ) { if ( update ) { Debug.Assert( sliceTRT.Count == Depth ); foreach ( XnaRenderTexture trt in sliceTRT ) trt.Rebind( this ); return; } DestroyRenderTextures(); // Create render target for each slice sliceTRT.Clear(); Debug.Assert( Depth == 1 ); for ( var zoffset = 0; zoffset < Depth; ++zoffset ) { var name = "rtt/" + ID; RenderTexture trt = new XnaRenderTexture( name, this ); sliceTRT.Add( trt ); Root.Instance.RenderSystem.AttachRenderTarget( trt ); } }