Rendering to Texture

Rendering to textures, also known as off-screen rendering, is a technique where all of the output produced by the renderer is stored as a texture instead of being displayed on the screen. Then, this texture can be used on top of other objects to achieve some interesting effects.

I recently improved Crimild to support this feature. As an example, take a look at the following pictures:

Rendering to textures
Rendering to textures

This example renders an iPhone device in which screen the ED-209 robot from the movie Robocop can be seen.

The effect is produced by rendering the robot first, using the new rendering to texture feature to draw everything into an off-screen buffer. Then, two quads are drawn: one by using a texture with a picture of an iPhone device and the other by using the contents of the offscreen buffer.

Although the images above may not be impressive, this is a mayor improvement since it’s the closer step towards post-processing effects like anti-allising, jittering, bloom, etc.

For those interested in the details of how this feature is used, the RenderToTexture example project can be found in the examples directory.

As a bonus, I managed to implement rendering to texture on iPhone as well. This feature is used in exactly the same way as in other platforms:

Yeap, it works on iPhone too!

The OffscreenRendering example project is available in the examples/iPhone directory.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.