Game Development Reference
In-Depth Information
How it works...
Offscreen rendering is just what it sounds like. We render something in a view that is not
related to the main view that the player sees. To do this, we set up a new viewport and cam-
era. It's not possible to render something directly to a texture, which is why
FrameBuffer is used as the medium.
Once the texture object is created and added to the asset manager, it's possible to keep
changing it if we would like to at a later stage. It's even possible to have a live view of the
scene in the minimap, although this would probably cost unnecessary resources. In this
case, we remove the view as soon as we've rendered it once.
The example is limited in some sense, like it expects that there is a correlation between the
size of the scene and the size of the minimap.
Nifty uses its own image format, NiftyImage , so we need to convert the image we
saved; however, Nifty's createImage will automatically find the texture in the asset
manager based on the name (key).
Search WWH ::




Custom Search