render.PushRenderTarget
render.PushRenderTarget( ITexture texture = nil, number x = 0, number y = 0, number w = texture:Width(), number h = texture:Height() )
Description
Pushes the current render target and viewport to the RT stack then sets a new current render target and viewport. If the viewport is not specified, the dimensions of the render target are used instead.
This is similar to a call to render.SetRenderTarget and render.SetViewPort where the current render target and viewport have been saved beforehand, except the viewport isn't clipped to screen bounds.
See also render.PopRenderTarget.
If you want to render to the render target in 2d mode and it is not the same size as the screen, use cam.Start2D and cam.End2D.
If the render target is bigger than the screen, rendering done with the surface library will be clipped to the screen bounds unless you call DisableClipping
Arguments
Example
Shows how to create a material which uses a custom created Render Target texture.
Output: A black 1024x1024 render target with a 256x256 red square in top left corner drawn in your top left corner.
Example
Shows how you can use alpha channel with render targets.