Radiance for env col

This commit is contained in:
Lubos Lenco 2017-10-22 20:52:39 +02:00
parent aaa2fba63b
commit 7912b4ca26
2 changed files with 13 additions and 0 deletions

View file

@ -43,6 +43,9 @@ uniform float envmapStrength;
uniform sampler2D senvmapBrdf;
uniform int envmapNumMipmaps;
#endif
#ifdef _EnvCol
uniform vec3 backgroundCol;
#endif
#ifdef _SSAO
uniform sampler2D ssaotex;
@ -143,6 +146,11 @@ void main() {
#ifdef _Rad // Indirect specular
envl.rgb += prefilteredColor * (f0 * envBRDF.x + envBRDF.y) * 1.5;
#else
#ifdef _EnvCol
vec3 f0 = surfaceF0(g1.rgb, metrough.x);
envl.rgb += backgroundCol * f0;
#endif
#endif
#ifdef _SSS

View file

@ -53,6 +53,11 @@
"name": "sdftex",
"link": "_sdfTexture",
"ifdef": ["_DFAO"]
},
{
"name": "backgroundCol",
"link": "_backgroundCol",
"ifdef": ["_EnvCol"]
}
],
"vertex_shader": "deferred_indirect.vert.glsl",