Radiance for env col
This commit is contained in:
parent
aaa2fba63b
commit
7912b4ca26
|
@ -43,6 +43,9 @@ uniform float envmapStrength;
|
||||||
uniform sampler2D senvmapBrdf;
|
uniform sampler2D senvmapBrdf;
|
||||||
uniform int envmapNumMipmaps;
|
uniform int envmapNumMipmaps;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _EnvCol
|
||||||
|
uniform vec3 backgroundCol;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _SSAO
|
#ifdef _SSAO
|
||||||
uniform sampler2D ssaotex;
|
uniform sampler2D ssaotex;
|
||||||
|
@ -143,6 +146,11 @@ void main() {
|
||||||
|
|
||||||
#ifdef _Rad // Indirect specular
|
#ifdef _Rad // Indirect specular
|
||||||
envl.rgb += prefilteredColor * (f0 * envBRDF.x + envBRDF.y) * 1.5;
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef _SSS
|
#ifdef _SSS
|
||||||
|
|
|
@ -53,6 +53,11 @@
|
||||||
"name": "sdftex",
|
"name": "sdftex",
|
||||||
"link": "_sdfTexture",
|
"link": "_sdfTexture",
|
||||||
"ifdef": ["_DFAO"]
|
"ifdef": ["_DFAO"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "backgroundCol",
|
||||||
|
"link": "_backgroundCol",
|
||||||
|
"ifdef": ["_EnvCol"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"vertex_shader": "deferred_indirect.vert.glsl",
|
"vertex_shader": "deferred_indirect.vert.glsl",
|
||||||
|
|
Loading…
Reference in a new issue