Mesh shader
[
Front page
] [
New
|
Page list
|
Search
|
Recent changes
|
Help
|
Log in
]
Start:
* Shader customization [#xfcc3915]
The mesh shader is customizable with four global variable...
| ''Variables'' | ''Description'' ...
| --------------------------------- | -------------------...
| __MESH_SCENE_SLOT_NAMES__ | The scene custom sl...
| __MESH_MATERIAL_SLOT_NAMES__ | The material custom...
| __MESH_VERT_BEGIN__ | Insert code at begi...
| __MESH_VERT_END__ | Insert code at end ...
| __MESH_VERT_OUT_POSITION__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_POS__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_UV__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_COLOR__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_NORMAL__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_TANGENT__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_BINORMAL__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_SHADOW_POS__ | Replace vertex outp...
| --------------------------------- | -------------------...
| __MESH_FRAG_BEGIN__ | Insert code at begi...
| __MESH_FRAG_END__ | Insert code at end ...
| __MESH_FRAG_PRE_TEXTURE__ | Insert code before ...
| __MESH_FRAG_POST_TEXTURE__ | Insert code after c...
| __MESH_FRAG_OUT_BASE__ | Replace fragment ou...
| __MESH_FRAG_OUT_NORMAL__ | Replace fragment ou...
| __MESH_FRAG_OUT_ID__ | Replace fragment ou...
Create a ''shader.ts'' file at the same level of your ''m...
Set variables of your choices and import the script in ''...
By this way all these variables are set before the engine...
* Table vertex vars [#aff0abca]
| ''Variables'' | ''Scope'' | ''Type'' | ''Descripti...
| ------------- | ------- | -------------- | -----------...
| position | Var | vec3 | Vertex posi...
| texUV | Var | vec2 | Vertex uv ...
| color | Var | vec3 | Vertex colo...
| normal | Var | vec3 | Vertex norm...
| tangent | Var | vec3 | Vertex tang...
| binormal | Var | vec3 | Vertex bino...
| posFromLight | Var | vec4 | Vertex posi...
| output | Var | VertexOutput | The vertex ...
| ------------- | ------- | -------------- | -----------...
| LVP_MATRIX | Uniform | mat4x4 | Light view ...
| SCENE_INFOS | Uniform | SceneInfos | Various sce...
| MESH_INFOS | Uniform | MeshInfos | Contains ma...
| MAT_PARAMS | Uniform | MaterialParams | List of flo...
* Table fragment vars [#j60e0591]
| ''Variables'' | ''Scope'' | ''Type'' ...
| ------------------------ | ------- | -------------- | -...
| fragPos | Var | vec3 | Pi...
| fragUV | Var | vec2 | Te...
| fragColor | Var | vec3 | co...
| fragNormal | Var | vec3 | no...
| fragTangent | Var | vec3 | ta...
| fragBinormal | Var | vec3 | bi...
| fragShadowPos | Var | vec3 | sh...
| normalUV | Var | vec3 | no...
| outputColor | Var | vec4 | Ou...
| texel | Var | vec4 | Te...
| textureUV | Var | vec2 | Te...
| shadow | Var | float | Sh...
| matS0 | Var | vec4 | Te...
| matS1 | Var | vec4 | Te...
| s0 | Var | vec4 | Te...
| s1 | Var | vec4 | Te...
| output | Var | FragOutput | Th...
| ------------------------ | ------- | -------------- | -...
| MESH_INFOS | Uniform | MeshInfos | C...
| SCENE_INFOS | Uniform | SceneInfos | V...
| DIR_LIGHT | Uniform | DirLight | D...
| POINT_LIGHTS | Uniform | PointLight[] | P...
| SPOT_LIGHTS | Uniform | SpotLight[] | S...
| DECALS | Uniform | Decal[] | D...
| FOG | Uniform | Fog | F...
| MAT_COLORS | Uniform | MaterialColors | M...
| MAT_PARAMS | Uniform | MaterialParams | M...
| MAT_UVS | Uniform | MaterialUvs | M...
| MAT_TOON_LIGHT_DIR | Uniform | vec3 | M...
| MAT_TEXTURE | Uniform | Texture | C...
| MAT_DISPLACEMENT_TEXTURE | Uniform | Texture | D...
| MAT_DIFFUSE_TEXTURE | Uniform | Texture | D...
| MAT_SPECULAR_TEXTURE | Uniform | Texture | S...
| MAT_EMISSIVE_TEXTURE | Uniform | Texture | E...
| MAT_NORM_TEXTURE | Uniform | Texture | N...
| MAT_ENV_MAP_TEXTURE | Uniform | Texture | E...
| MAT_TOON_TEXTURE | Uniform | Texture | T...
| MAT_S0_TEXTURE | Uniform | Texture | F...
| MAT_S1_TEXTURE | Uniform | Texture | F...
| DECAL_ATLAS_TEXTURE | Uniform | Texture | D...
| DECAL_ATLAS_TEXTURE | Uniform | Texture | D...
| SHADOW_MAP_TEXTURE | Uniform | Texture | S...
| S0_TEXTURE | Uniform | Texture | F...
| S1_TEXTURE | Uniform | Texture | F...
* What about new uniforms ? [#xfcc3915]
For numeric there is:
- 16 built-in floats available in ''MAT_PARAMS'' from ''S...
- 16 built-in floats available in ''SCENE_INFOS'' from ''...
About texture there is:
- 2 built-in texture available in ''MAT_S0_TEXTURE'' and ...
- 2 built-in texture available in ''S0_TEXTURE'' and ''S1...
End:
* Shader customization [#xfcc3915]
The mesh shader is customizable with four global variable...
| ''Variables'' | ''Description'' ...
| --------------------------------- | -------------------...
| __MESH_SCENE_SLOT_NAMES__ | The scene custom sl...
| __MESH_MATERIAL_SLOT_NAMES__ | The material custom...
| __MESH_VERT_BEGIN__ | Insert code at begi...
| __MESH_VERT_END__ | Insert code at end ...
| __MESH_VERT_OUT_POSITION__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_POS__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_UV__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_COLOR__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_NORMAL__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_TANGENT__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_BINORMAL__ | Replace vertex outp...
| __MESH_VERT_OUT_FRAG_SHADOW_POS__ | Replace vertex outp...
| --------------------------------- | -------------------...
| __MESH_FRAG_BEGIN__ | Insert code at begi...
| __MESH_FRAG_END__ | Insert code at end ...
| __MESH_FRAG_PRE_TEXTURE__ | Insert code before ...
| __MESH_FRAG_POST_TEXTURE__ | Insert code after c...
| __MESH_FRAG_OUT_BASE__ | Replace fragment ou...
| __MESH_FRAG_OUT_NORMAL__ | Replace fragment ou...
| __MESH_FRAG_OUT_ID__ | Replace fragment ou...
Create a ''shader.ts'' file at the same level of your ''m...
Set variables of your choices and import the script in ''...
By this way all these variables are set before the engine...
* Table vertex vars [#aff0abca]
| ''Variables'' | ''Scope'' | ''Type'' | ''Descripti...
| ------------- | ------- | -------------- | -----------...
| position | Var | vec3 | Vertex posi...
| texUV | Var | vec2 | Vertex uv ...
| color | Var | vec3 | Vertex colo...
| normal | Var | vec3 | Vertex norm...
| tangent | Var | vec3 | Vertex tang...
| binormal | Var | vec3 | Vertex bino...
| posFromLight | Var | vec4 | Vertex posi...
| output | Var | VertexOutput | The vertex ...
| ------------- | ------- | -------------- | -----------...
| LVP_MATRIX | Uniform | mat4x4 | Light view ...
| SCENE_INFOS | Uniform | SceneInfos | Various sce...
| MESH_INFOS | Uniform | MeshInfos | Contains ma...
| MAT_PARAMS | Uniform | MaterialParams | List of flo...
* Table fragment vars [#j60e0591]
| ''Variables'' | ''Scope'' | ''Type'' ...
| ------------------------ | ------- | -------------- | -...
| fragPos | Var | vec3 | Pi...
| fragUV | Var | vec2 | Te...
| fragColor | Var | vec3 | co...
| fragNormal | Var | vec3 | no...
| fragTangent | Var | vec3 | ta...
| fragBinormal | Var | vec3 | bi...
| fragShadowPos | Var | vec3 | sh...
| normalUV | Var | vec3 | no...
| outputColor | Var | vec4 | Ou...
| texel | Var | vec4 | Te...
| textureUV | Var | vec2 | Te...
| shadow | Var | float | Sh...
| matS0 | Var | vec4 | Te...
| matS1 | Var | vec4 | Te...
| s0 | Var | vec4 | Te...
| s1 | Var | vec4 | Te...
| output | Var | FragOutput | Th...
| ------------------------ | ------- | -------------- | -...
| MESH_INFOS | Uniform | MeshInfos | C...
| SCENE_INFOS | Uniform | SceneInfos | V...
| DIR_LIGHT | Uniform | DirLight | D...
| POINT_LIGHTS | Uniform | PointLight[] | P...
| SPOT_LIGHTS | Uniform | SpotLight[] | S...
| DECALS | Uniform | Decal[] | D...
| FOG | Uniform | Fog | F...
| MAT_COLORS | Uniform | MaterialColors | M...
| MAT_PARAMS | Uniform | MaterialParams | M...
| MAT_UVS | Uniform | MaterialUvs | M...
| MAT_TOON_LIGHT_DIR | Uniform | vec3 | M...
| MAT_TEXTURE | Uniform | Texture | C...
| MAT_DISPLACEMENT_TEXTURE | Uniform | Texture | D...
| MAT_DIFFUSE_TEXTURE | Uniform | Texture | D...
| MAT_SPECULAR_TEXTURE | Uniform | Texture | S...
| MAT_EMISSIVE_TEXTURE | Uniform | Texture | E...
| MAT_NORM_TEXTURE | Uniform | Texture | N...
| MAT_ENV_MAP_TEXTURE | Uniform | Texture | E...
| MAT_TOON_TEXTURE | Uniform | Texture | T...
| MAT_S0_TEXTURE | Uniform | Texture | F...
| MAT_S1_TEXTURE | Uniform | Texture | F...
| DECAL_ATLAS_TEXTURE | Uniform | Texture | D...
| DECAL_ATLAS_TEXTURE | Uniform | Texture | D...
| SHADOW_MAP_TEXTURE | Uniform | Texture | S...
| S0_TEXTURE | Uniform | Texture | F...
| S1_TEXTURE | Uniform | Texture | F...
* What about new uniforms ? [#xfcc3915]
For numeric there is:
- 16 built-in floats available in ''MAT_PARAMS'' from ''S...
- 16 built-in floats available in ''SCENE_INFOS'' from ''...
About texture there is:
- 2 built-in texture available in ''MAT_S0_TEXTURE'' and ...
- 2 built-in texture available in ''S0_TEXTURE'' and ''S1...
Page: