OpenGL2: Merge several cvars into r_pbr.

r_glossIsRoughness, r_specularIsMetallic, r_framebufferGamma, r_tonemapGamma, r_materialGamma, r_lightGamma
This commit is contained in:
SmileTheory 2016-02-01 21:37:23 -08:00
parent 41791c662f
commit ad952b9537
11 changed files with 88 additions and 108 deletions

View file

@ -28,8 +28,8 @@ void main()
{
vec4 color = texture2D(u_TextureMap, var_TexCoords) * u_Color;
#if defined(r_framebufferGamma)
color.rgb = pow(color.rgb, vec3(r_framebufferGamma));
#if defined(USE_PBR)
color.rgb = pow(color.rgb, vec3(2.2));
#endif
vec3 minAvgMax = texture2D(u_LevelsMap, var_TexCoords).rgb;
@ -46,8 +46,8 @@ void main()
color.rgb = clamp(color.rgb * var_InvWhite, 0.0, 1.0);
#if defined(r_tonemapGamma)
color.rgb = pow(color.rgb, vec3(1.0 / r_tonemapGamma));
#if defined(USE_PBR)
color.rgb = pow(color.rgb, vec3(1.0 / 2.2));
#endif
gl_FragColor = color;