mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Make shading of CAOs optional (#10033)
This commit is contained in:
parent
0a1181f763
commit
3a6dfda358
10 changed files with 47 additions and 7 deletions
|
@ -39,11 +39,15 @@ void main(void)
|
|||
lightVec = sunPosition - worldPosition;
|
||||
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
|
||||
#if (MATERIAL_TYPE == TILE_MATERIAL_PLAIN) || (MATERIAL_TYPE == TILE_MATERIAL_PLAIN_ALPHA)
|
||||
vIDiff = 1.0;
|
||||
#else
|
||||
// This is intentional comparison with zero without any margin.
|
||||
// If normal is not equal to zero exactly, then we assume it's a valid, just not normalized vector
|
||||
vIDiff = length(gl_Normal) == 0.0
|
||||
? 1.0
|
||||
: directional_ambient(normalize(gl_Normal));
|
||||
#endif
|
||||
|
||||
gl_FrontColor = gl_BackColor = gl_Color;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue