This commit separate the depth texture into another texture array. This remove the need to output radial depth into alpha. Unfortunatly it's difficult to recover position from the non linear depth buffer when applying reflection without adding a bunch of stuff. This is in preparation of SSR planar reflections.
19 lines
560 B
GLSL
19 lines
560 B
GLSL
|
|
uniform vec3 basecol;
|
|
uniform float metallic;
|
|
uniform float specular;
|
|
uniform float roughness;
|
|
|
|
Closure nodetree_exec(void)
|
|
{
|
|
vec3 dielectric = vec3(0.034) * specular * 2.0;
|
|
vec3 diffuse = mix(basecol, vec3(0.0), metallic);
|
|
vec3 f0 = mix(dielectric, basecol, metallic);
|
|
vec3 ssr_spec;
|
|
vec3 radiance = eevee_surface_lit((gl_FrontFacing) ? worldNormal : -worldNormal, diffuse, f0, roughness, 1.0, 0, ssr_spec);
|
|
|
|
Closure result = Closure(radiance, 1.0, vec4(ssr_spec, roughness), normal_encode(normalize(viewNormal), viewCameraVec), 0);
|
|
|
|
return result;
|
|
}
|