Table Of Contents

Overview

ShaderGen takes OpenGL Shading Language sources (stored in .sl files) and define C# sources statically storing the (elaborated) contents of the shader source. In order to compile and execute shaders, ShaderGen generate C# source modules integrated with Derm; the sources are determine by the contents of the OpenGL Shading Language files processed by ShaderGen.

Of course, it's still possible to manage alternative shaders by instantiating directly a ShaderObject and ShaderProgram classes.

The shader source is composed by two parts: the interface and the source (in an analog way of header and source files found in C). The interface and the source can be associated to three sections:

Additionally to source code written in GLSL and comment, it's possible to insert special commands in the shader source. These commands begin with a comment

 //!<Command> Command Arguments 

The special commands are removed automatically from the final shader source.

Shader Interface Source Section

The interface source is specified after the special command

 ///!<Interface> {<i>Sections</i>} 

Where Sections is a sequence of pipe separated tokens, listed here:

Shader Interface Source Section

The interface source is specified after the special command

 ///!<Source> {<i>Sections</i>} 

Where Sections is a sequence of pipe separated tokens, listed here:

Shader Source Special Commands

It's possible to include shader code defined in external shader soources using the command:

 ///!<Include> {<i>Sections</i>} 

Pay attention when or'ing multiple sections. Only the sections having exact association with the section specified as argument are really included; others not matching the sections combination are not considered.

Shader Inputs and Uniforms

After having determine shader source sections, each single section source is analysed to determine the following declarations:

Shader Generation Configuration

File Templates

Class Templates

Source Modules

Shader Interface Source Section



Services powered by Get Deus Ex Render Machina at SourceForge.net. Fast, secure and Free Open Source software downloads