Fixed sRGB for GLES renderer.
It's a bit ugly solution because we should handle it properly in one place and not add another sRGB correction... But it's already working solution and it doesn't affect the OpenGL renderer, so we can use it until better fix will be done. Now the GLES renderer looks almost the same as the original OpenGL 3.x one :)
This commit is contained in:
parent
e316df1807
commit
68a99fd38b
@ -40,7 +40,11 @@ void main(void)
|
||||
col = vec4(new_color.r, new_color.g, new_color.b, col.a);
|
||||
}
|
||||
|
||||
#ifdef GL_ES
|
||||
col.xyz *= color.xyz;
|
||||
#else
|
||||
col.xyz *= pow(color.xyz, vec3(2.2));
|
||||
#endif
|
||||
float specmap = texture(SpecMap, uv).g;
|
||||
float emitmap = texture(SpecMap, uv).b;
|
||||
FragColor = vec4(getLightFactor(col.xyz, vec3(1.), specmap, emitmap), 1.);
|
||||
|
@ -14,6 +14,10 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
|
||||
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
|
||||
float ao = texture(SSAO, tc).x;
|
||||
#ifdef GL_ES
|
||||
DiffuseComponent = pow(DiffuseComponent, vec3(1. / 2.2));
|
||||
SpecularComponent = pow(SpecularComponent, vec3(1. / 2.2));
|
||||
#endif
|
||||
vec3 tmp = diffuseMatColor * DiffuseComponent * (1. - specMapValue) + specularMatColor * SpecularComponent * specMapValue;
|
||||
vec3 emitCol = diffuseMatColor.xyz * diffuseMatColor.xyz * diffuseMatColor.xyz * 15.;
|
||||
return tmp * ao + (emitMapValue * emitCol);
|
||||
|
Loading…
Reference in New Issue
Block a user