C# Класс Axiom.RenderSystems.OpenGL.GLSL.GLSLLinkProgramManager

Axiom assumes that there are seperate vertex and fragment programs to deal with but GLSL has one program object that represents the active vertex and fragment shader objects during a rendering state. GLSL Vertex and fragment shader objects are compiled seperately and then attached to a program object and then the program object is linked. Since Ogre can only handle one vertex program and one fragment program being active in a pass, the GLSL Link Program Manager does the same. The GLSL Link program manager acts as a state machine and activates a program object based on the active vertex and fragment program. Previously created program objects are stored along with a unique key in a hash_map for quick retrieval the next time the program object is required.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

Called when the engine is shutting down.

ExtractConstantDefs ( String src, GpuProgramParameters defs, String filename ) : void

Populate a list of uniforms based on GLSL source.

ExtractUniforms ( int programObject, GpuProgramParameters vertexConstantDefs, GpuProgramParameters geometryConstantDefs, GpuProgramParameters fragmentConstantDefs, Axiom.RenderSystems.OpenGL.GLSL.GLSLLinkProgram list ) : void

Populate a list of uniforms based on a program object.

SetActiveFragmentShader ( GLSLGpuProgram fragmentProgram ) : void

Set the active fragment shader for the next rendering state.

The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods

SetActiveGeometryShader ( GLSLGpuProgram geometryProgram ) : void

Set the active geometry shader for the next rendering state.

The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods

SetActiveVertexShader ( GLSLGpuProgram vertexProgram ) : void

Set the active vertex shader for the next rendering state.

The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods

Приватные методы

Метод Описание
CompleteDefInfo ( int gltype, GpuProgramParameters defToUpdate ) : void
CompleteParamSource ( String paramName, GpuProgramParameters vertexConstantDefs, GpuProgramParameters geometryConstantDefs, GpuProgramParameters fragmentConstantDefs, Axiom.RenderSystems.OpenGL.GLSL.GLSLLinkProgram refToUpdate ) : bool
GLSLLinkProgramManager ( ) : System

Internal constructor. This class cannot be instantiated externally.

Описание методов

Dispose() публичный Метод

Called when the engine is shutting down.
public Dispose ( ) : void
Результат void

ExtractConstantDefs() публичный Метод

Populate a list of uniforms based on GLSL source.
public ExtractConstantDefs ( String src, GpuProgramParameters defs, String filename ) : void
src String Reference to the source code
defs Axiom.Graphics.GpuProgramParameters The defs to populate (will not be cleared before adding, clear /// it yourself before calling this if that's what you want).
filename String The file name this came from, for logging errors.
Результат void

ExtractUniforms() публичный Метод

Populate a list of uniforms based on a program object.
public ExtractUniforms ( int programObject, GpuProgramParameters vertexConstantDefs, GpuProgramParameters geometryConstantDefs, GpuProgramParameters fragmentConstantDefs, Axiom.RenderSystems.OpenGL.GLSL.GLSLLinkProgram list ) : void
programObject int Handle to the program object to query
vertexConstantDefs Axiom.Graphics.GpuProgramParameters Definition of the constants extracted from the /// vertex program, used to match up physical buffer indexes with program /// uniforms. May be null if there is no vertex program.
geometryConstantDefs Axiom.Graphics.GpuProgramParameters Definition of the constants extracted from the /// geometry program, used to match up physical buffer indexes with program /// uniforms. May be null if there is no geometry program.
fragmentConstantDefs Axiom.Graphics.GpuProgramParameters Definition of the constants extracted from the /// fragment program, used to match up physical buffer indexes with program /// uniforms. May be null if there is no fragment program.
list Axiom.RenderSystems.OpenGL.GLSL.GLSLLinkProgram The list to populate (will not be cleared before adding, clear /// it yourself before calling this if that's what you want).
Результат void

SetActiveFragmentShader() публичный Метод

Set the active fragment shader for the next rendering state.
The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods
public SetActiveFragmentShader ( GLSLGpuProgram fragmentProgram ) : void
fragmentProgram GLSLGpuProgram
Результат void

SetActiveGeometryShader() публичный Метод

Set the active geometry shader for the next rendering state.
The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods
public SetActiveGeometryShader ( GLSLGpuProgram geometryProgram ) : void
geometryProgram GLSLGpuProgram
Результат void

SetActiveVertexShader() публичный Метод

Set the active vertex shader for the next rendering state.
The active program object will be cleared. Normally called from the GLSLGpuProgram.BindProgram and UnbindProgram methods
public SetActiveVertexShader ( GLSLGpuProgram vertexProgram ) : void
vertexProgram GLSLGpuProgram
Результат void