Vertex variables

VariablesScopeTypeDescription
-------------------------------------------------------------------------------
PositionAttrvec3Vertex position
TexUVAttrvec2Vertex uv
ColorAttrvec3Vertex color
NormalAttrvec3Vertex normal
TangentAttrvec3Vertex tangent
BinormalAttrvec3Vertex binormal
-------------------------------------------------------------------------------
LVP_MATRIXUniformmat4x4Light view projection (shadow-map)
MESH_INFOSUniformMeshInfosContains matrices and mesh identifier
MAT_PARAMSUniformMaterialParamsList of float material parameters
-------------------------------------------------------------------------------
outvarVertexOutputThe vertex shader output
posFromLightvarvec4Vertex position from light source (shadow-map

Fragment variables

VariablesScopeTypeDescription
------------------------------------------------------------------------------------------
PositionAttrvec3Vertex local position
FragPosAttrvec2Vertex world position
FragUVAttrvec3Vertex uv
FragColorAttrvec3Vertex color
FragNormalAttrvec3Vertex normal
FragTangentAttrvec3Vertex tangent
FragBinormalAttrvec3Vertex binormal
FragShadowPosAttrvec3Vertex shadow direction
------------------------------------------------------------------------------------------
MESH_INFOSUniformMeshInfosContains matrices and mesh identifier
CAMERA_POSUniformvec3Camera position
DIR_LIGHTUniformDirLightDirectionnal light informations
FOGUniformFogFog informations
POINT_LIGHT_COUNTUniformintNumber of point lights
POINT_LIGHTSUniformPointLight[]Point light list
DECAL_COUNTUniformintNumber of decals
DECALSUniformDecal[]Decal list
DECAL_ATLAS_TEXTUREUniformTextureDecals texture
DECAL_ATLAS_TEXTUREUniformTextureDecals texture
SHADOW_MAP_TEXTUREUniformTextureShadow map texture
MAT_COLORSUniformMaterialColorsMaterial colors (ambiant, diffuse, etc...)
MAT_PARAMSUniformMaterialParamsMaterial parameters for some settings
MAT_UVSUniformMaterialUvsMaterial uv scrolling
MAT_TOON_LIGHT_DIRUniformvec3Material toon light direction
MAT_TEXTUREUniformTextureColor texture
MAT_DISPLACEMENT_TEXTUREUniformTextureDisplace the color texture
MAT_DIFFUSE_TEXTUREUniformTextureDiffuse color texture
MAT_SPECULAR_TEXTUREUniformTextureSpecular texture (color and specularity)
MAT_EMISSIVE_TEXTUREUniformTextureEmissive color texture
MAT_NORM_TEXTUREUniformTextureNormal map texture
MAT_ENV_MAP_TEXTUREUniformTextureEnv map texture
MAT_TOON_TEXTUREUniformTextureToon details texture
------------------------------------------------------------------------------------------
outputColorvarvec4The fragment shader output color
normalvarvec3The normalized normal
texelvarvec4The current texture pixel - after decals
textureUVvarvec2The current texture uv - after scrolling
shadowvarfloatThe shadow factor

Extension

You can make your own mesh shader by append code to the existing one.
See MESH_VERT_EXT and MESH_FRAG_EXT variables in vite.config.ts.


Front page   New Page list Search Recent changes   Help   RSS of recent changes