Render Texture - Team-Innis/UtH-Engine GitHub Wiki

RenderTexture is a class used to enable off-screen drawing. When rendering your scene, you can use this class as a render target to render into a texture. After drawing is complete, you can access the texture to be used with a Sprite.


Basic usage

  1. Construct the RenderTexture.
  2. Call its Initialize method. You'll need to pass in the desired size and whether or not you want a depth buffer.
  3. Pass the RenderTexture as the target into a game object's/component's Draw method. The object will then be drawn onto the texture.
  4. Fetch the texture reference with GetTexture and use it with a Sprite or anything else that can use it.
  5. Draw the object into which the texture is bound.