Give few more fps in GLES renderer by pre-computing diffuse/specular color
This commit is contained in:
@@ -14,10 +14,6 @@ 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;
|
||||
#if defined(GL_ES) && !defined(Advanced_Lighting_Enabled)
|
||||
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);
|
||||
|
||||
@@ -293,7 +293,12 @@ RTT::RTT(size_t width, size_t height, float rtt_scale)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
getFBO(FBO_COMBINED_DIFFUSE_SPECULAR).bind();
|
||||
glClearColor(.5, .5, .5, .5);
|
||||
float color = 0.5;
|
||||
#if defined(USE_GLES2)
|
||||
if (!CVS->isDefferedEnabled())
|
||||
color = pow(color, 1. / 2.2);
|
||||
#endif
|
||||
glClearColor(color, color, color, color);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
#if !defined(USE_GLES2)
|
||||
|
||||
Reference in New Issue
Block a user