DarkRadiant shader system: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
m (links)
No edit summary
Line 1: Line 1:
<div style="float:right">
<div style="font-size: 10px; float:right; padding: 10px; padding-bottom: 5px; padding-right: 5px; background-color: #CECECE; border: 1px solid #555555;">
[http://img263.imageshack.us/img263/9984/shadersystemzh6.jpg http://img263.imageshack.us/img263/9984/shadersystemzh6.th.jpg]
[http://img263.imageshack.us/img263/9984/shadersystemzh6.jpg http://img263.imageshack.us/img263/9984/shadersystemzh6.th.jpg]
DarkRadiant Shader System
</div>
</div>
The Shader System module is initialised during DarkRadiant startup and parses the material files during this phase.
The Shader System module is initialised during DarkRadiant startup and parses the material files during this phase.

Revision as of 07:05, 10 February 2007

shadersystemzh6.th.jpg

DarkRadiant Shader System

The Shader System module is initialised during DarkRadiant startup and parses the material files during this phase.

It consists of a few components:

The Shader and Texture objects are allocated on the heap using boost::shared_ptrs.

Note that the actual image data isn't loaded until they are requested by the render system. If the latter requests a TexturePtr by calling Shader::getDiffuse(), the Shader object checks the contained TexturePtr for realisation. If the TexturePtr is still NULL, it sends a request to the GLTextureManager for the Texture to be realised. This happens by passing the TextureConstructor to the GLTextureManager, which can be used to retrieve an Image object containing the raw pixel data.