mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-17 23:31:47 +00:00
Add standard lighting (1/3)
- Ambient and lambert lighting added. - Ambient and diffuse colors linked to standard shader. - Single light linked to standard shader. - LoadStandardMaterial() and depending functions added.
This commit is contained in:
@@ -732,13 +732,13 @@ Material LoadDefaultMaterial(void)
|
||||
return material;
|
||||
}
|
||||
|
||||
// Load standard material (uses standard models shader)
|
||||
// Load standard material (uses material attributes and lighting shader)
|
||||
// NOTE: Standard shader supports multiple maps and lights
|
||||
Material LoadStandardMaterial(void)
|
||||
{
|
||||
Material material = LoadDefaultMaterial();
|
||||
|
||||
//material.shader = GetStandardShader();
|
||||
material.shader = GetStandardShader();
|
||||
|
||||
return material;
|
||||
}
|
||||
@@ -1240,7 +1240,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
|
||||
//Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates
|
||||
|
||||
model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation);
|
||||
model.material.colDiffuse = tint;
|
||||
// model.material.colDiffuse = tint;
|
||||
|
||||
rlglDrawMesh(model.mesh, model.material, model.transform);
|
||||
}
|
||||
|
Reference in New Issue
Block a user