Fix RGB order in shaders on GLES
This commit is contained in:
parent
3306c2ee29
commit
6cdef9d498
@ -151,9 +151,7 @@ void main(void)
|
|||||||
color.xyz = color.zyx; // swap RGB order
|
color.xyz = color.zyx; // swap RGB order
|
||||||
#endif
|
#endif
|
||||||
// The alpha gives the ratio of sunlight in the incoming light.
|
// The alpha gives the ratio of sunlight in the incoming light.
|
||||||
float nightRatio = 1.0 - inVertexColor.a;
|
color.rgb *= 2.0 * mix(artificialLight.rgb, dayLight.rgb, color.a);
|
||||||
color.rgb = inVertexColor.rgb * (inVertexColor.a * dayLight.rgb +
|
|
||||||
nightRatio * artificialLight.rgb) * 2.0;
|
|
||||||
color.a = 1.0;
|
color.a = 1.0;
|
||||||
|
|
||||||
// Emphase blue a bit in darker places
|
// Emphase blue a bit in darker places
|
||||||
|
@ -51,5 +51,9 @@ void main(void)
|
|||||||
: directional_ambient(normalize(inVertexNormal));
|
: directional_ambient(normalize(inVertexNormal));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_ES
|
||||||
|
varColor = inVertexColor.bgra;
|
||||||
|
#else
|
||||||
varColor = inVertexColor;
|
varColor = inVertexColor;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user