RenderToTexture

From Digital Spaces

Jump to: navigation, search

To render to a texture, you need to first create the renderTexture. This is done by providing information in the <environment> section of the .scene file.

<environment>
  <renderTexture name="RTT" width="128" height="128" />
</environment>
 

To render a camera to the texture, use this code in a scene node:

<camera fov="90" aspectRatio="1" projectionType="perspective"  >
  <renderTarget name="RTT" />
  <normal x="0" y="0" z="-1" />
  <clipping near="0.1" far="100" />
</camera>
 
Personal tools