Fix RGB order in shaders on GLES

master
Maksim 2022-05-23 10:31:22 +03:00
parent 3306c2ee29
commit 6cdef9d498
2 changed files with 5 additions and 3 deletions

View File

@ -151,9 +151,7 @@ void main(void)
color.xyz = color.zyx; // swap RGB order
#endif
// The alpha gives the ratio of sunlight in the incoming light.
float nightRatio = 1.0 - inVertexColor.a;
color.rgb = inVertexColor.rgb * (inVertexColor.a * dayLight.rgb +
nightRatio * artificialLight.rgb) * 2.0;
color.rgb *= 2.0 * mix(artificialLight.rgb, dayLight.rgb, color.a);
color.a = 1.0;
// Emphase blue a bit in darker places

View File

@ -51,5 +51,9 @@ void main(void)
: directional_ambient(normalize(inVertexNormal));
#endif
#ifdef GL_ES
varColor = inVertexColor.bgra;
#else
varColor = inVertexColor;
#endif
}