Apply lightmap
This commit is contained in:
parent
f1b15c5000
commit
5d107ecc49
1 changed files with 3 additions and 2 deletions
|
|
@ -2,11 +2,12 @@
|
|||
void main()
|
||||
{
|
||||
#ifdef USE_LEVELMESH
|
||||
FragColor.rgb = texture(tex, vTexCoord.st).rgb * (uLightLevel / 255.0);
|
||||
vec3 mat = texture(tex, vTexCoord.st).rgb;
|
||||
FragColor.rgb = mat * (uLightLevel / 255.0);
|
||||
FragColor.a = 1.0;
|
||||
if (vLightmap.z >= 0.0)
|
||||
{
|
||||
FragColor.rgb *= texture(LightMap, vLightmap).rgb;
|
||||
FragColor.rgb += mat * texture(LightMap, vLightmap).rgb;
|
||||
}
|
||||
#else
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue