Shader Viewer

The Shader Viewer is a lite-C program. It can be used to look through the scene and model shaders that come with Gamestudio, and to edit shaders and observe the result immediately on the screen. To start it, just run shadertest.c in the projects\shadertest folder.

The Shader Viewer automatically loads every shader addressed in mtlFX.c and mtlView.c with the following comment tags:

////////////////////////////////////////////////////////////////////
//Shader Name: XXX
//Material Name: mtl_xxx
//Standard Model: xxx.mdl 
//Variable1: var1
//Variable2: var2
//Variable3: Not used
//Variable4: Not used

The Shader Name may consist of a maximum of 24 characters and will be displayed in the Shader Panel. The Material Name must match the existing material identifier. The Standard Model will be loaded when a new shader is selected and must exist in the shadertest folder. Already included are two models: marine.mdl and box.mdl, as well as a terrain water.hmp The marine.mdl model is for demonstration only; if you want to use it for your projects, please license it from http://www.3drt.com.

To change shader-parameters at runtime, the Shader Panel also offers 4 sliders for the scene shader as well as for the model shader. To give a hint what the parameters are for they can be named by the Variable1 to Variable4 comment tags. Within the model shader, the variables are addressed by the vecSkill41 vector and within the scene shaders through the vecSkill1 vector.

The Panels