SoShaderPipelineSurfaceShader¶
-
InventorModule
¶ author MeVis Medical Solutions AG
package MeVisLab/Standard
dll SoShaderPipeline
definition SoShaderPipeline.def
Purpose¶
The SoShaderPipelineSurfaceShader
module allows to define the properties of the surface that are used by the lighting model. The lighting itself is given via the SoShaderPipelineLightModel
.
A typical use case for a surface shader is to change material properties of the surface, e.g. the diffuse/specular color and specularity. It can make use of texture to have per-pixel material properties, e.g. a specular map, an alpha map, a normal map etc.
The resulting material parameters are used by the light model for each individual light. Thus, surface shading and the lighting model can be exchanged separatly.
Usage¶
The module is derived from the SoShaderPipelineFunction
module and extends the surface shader step of the pipeline. If per-fragment shading is enabled, the surface shader is applied in the fragment shader. If per-vertex shading is used instead, the surface shader will only run per vertex, to normal/texture mapping will not work well in per-vertex shading.
The following state variables are typically modified by a surface shader:
state float surfaceShininess
state vec3 surfaceDiffuse
state float surfaceAlpha
state vec3 surfaceSpecular
You can also add your own surface properties to the state and make use of them inside
of a custom light model (see SoShaderPipelineLightModel
).
You can add your own uniforms and texture samplers using the GLSL shader framework of MeVisLab,
e.g. SoShaderParameter3f
, SoGVRShaderParameterPosition
and SoMLSampler3D
.
Parameter Fields¶
Field Index¶
Enabled : Bool |
Replacement1 : String |
Function Body : String |
Replacement2 : String |
Function Display : String |
Replacement3 : String |
Function Name : String |
|
Parameter Declaration : String |
|
Replaced1 : String |
|
Replaced2 : String |
|
Replaced3 : String |