REVIEWED: LoadShader() and default locations

Reviewed locations descriptions
This commit is contained in:
Ray 2021-06-25 00:46:14 +02:00
parent a226e11aac
commit d4c03b47ec
3 changed files with 64 additions and 101 deletions

View file

@ -734,32 +734,32 @@ typedef enum {
// Shader location index
typedef enum {
SHADER_LOC_VERTEX_POSITION = 0, // Shader location point: position
SHADER_LOC_VERTEX_TEXCOORD01, // Shader location point: texcoord01
SHADER_LOC_VERTEX_TEXCOORD02, // Shader location point: texcoord02
SHADER_LOC_VERTEX_NORMAL, // Shader location point: normal
SHADER_LOC_VERTEX_TANGENT, // Shader location point: tangent
SHADER_LOC_VERTEX_COLOR, // Shader location point: color
SHADER_LOC_MATRIX_MVP, // Shader location point: model-view-projection matrix
SHADER_LOC_MATRIX_VIEW, // Shader location point: view matrix
SHADER_LOC_MATRIX_PROJECTION, // Shader location point: projection matrix
SHADER_LOC_MATRIX_MODEL, // Shader location point: model matrix
SHADER_LOC_MATRIX_NORMAL, // Shader location point: normal matrix
SHADER_LOC_VECTOR_VIEW, // Shader location point: view vector
SHADER_LOC_COLOR_DIFFUSE, // Shader location point: diffuse color
SHADER_LOC_COLOR_SPECULAR, // Shader location point: specular color
SHADER_LOC_COLOR_AMBIENT, // Shader location point: ambient color
SHADER_LOC_MAP_ALBEDO, // Shader location point: albedo texture (same as: SHADER_LOC_MAP_DIFFUSE)
SHADER_LOC_MAP_METALNESS, // Shader location point: metalness texture (same as: SHADER_LOC_MAP_SPECULAR)
SHADER_LOC_MAP_NORMAL, // Shader location point: normal texture
SHADER_LOC_MAP_ROUGHNESS, // Shader location point: roughness texture
SHADER_LOC_MAP_OCCLUSION, // Shader location point: occlusion texture
SHADER_LOC_MAP_EMISSION, // Shader location point: emission texture
SHADER_LOC_MAP_HEIGHT, // Shader location point: height texture
SHADER_LOC_MAP_CUBEMAP, // Shader location point: cubemap texture_cube_map
SHADER_LOC_MAP_IRRADIANCE, // Shader location point: irradiance texture_cube_map
SHADER_LOC_MAP_PREFILTER, // Shader location point: prefilter texture_cube_map
SHADER_LOC_MAP_BRDF // Shader location point: brdf texture
SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position
SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01
SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02
SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal
SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent
SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color
SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection
SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform)
SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection
SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform)
SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal
SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view
SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color
SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color
SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color
SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)
SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)
SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal
SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness
SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion
SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission
SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height
SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap
SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance
SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter
SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf
} ShaderLocationIndex;
#define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO