diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-14 14:34:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-16 17:58:32 +0300 |
commit | f1a5fd90bad851ccb9eef7bc59c3a8ebe39fe8b8 (patch) | |
tree | 0da7498d7479e534d08a60a0de68ffc552efc587 /source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | |
parent | e862bcd6c8cb218c2213ac4a05a11dd13dbdecbf (diff) |
Shader Node Editor: Add Closure to RGB convertion node.
Patch D3205 by Kanzaki Wataru
Only implemented in Eevee for now. Collapse a closure to RGBA so we can
do NPR stuff on the resulting color.
Use an emission shader to convert the color back to a closure.
Doing this will break PBR and will kill any SSR and SSS effects the shader
the shader rely on. That said screen space refraction and ambient occlusion
are supported due to the way they are implemented.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl index 6c21d7d6fef..0f76f8e1b8c 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl @@ -2,12 +2,6 @@ /* Based on Stochastic Screen Space Reflections * https://www.ea.com/frostbite/news/stochastic-screen-space-reflections */ -#ifndef UTIL_TEX -#define UTIL_TEX -uniform sampler2DArray utilTex; -#define texelfetch_noise_tex(coord) texelFetch(utilTex, ivec3(ivec2(coord) % LUT_SIZE, 2.0), 0) -#endif /* UTIL_TEX */ - #define MAX_MIP 9.0 uniform ivec2 halfresOffset; @@ -183,40 +177,6 @@ const ivec2 neighbors[32] = ivec2[32]( out vec4 fragColor; -void fallback_cubemap( - vec3 N, vec3 V, vec3 W, vec3 viewPosition, float roughness, float roughnessSquared, inout vec4 spec_accum) -{ - /* Specular probes */ - vec3 spec_dir = get_specular_reflection_dominant_dir(N, V, roughnessSquared); - - vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); - vec3 bent_normal; -#ifdef SSR_AO - float final_ao = occlusion_compute(N, viewPosition, 1.0, rand, bent_normal); - final_ao = specular_occlusion(dot(N, V), final_ao, roughness); -#else - const float final_ao = 1.0; -#endif - - /* Starts at 1 because 0 is world probe */ - for (int i = 1; i < MAX_PROBE && i < prbNumRenderCube && spec_accum.a < 0.999; ++i) { - CubeData cd = probes_data[i]; - - float fade = probe_attenuation_cube(cd, W); - - if (fade > 0.0) { - vec3 spec = final_ao * probe_evaluate_cube(float(i), cd, W, spec_dir, roughness); - accumulate_light(spec, fade, spec_accum); - } - } - - /* World Specular */ - if (spec_accum.a < 0.999) { - vec3 spec = final_ao * probe_evaluate_world_spec(spec_dir, roughness); - accumulate_light(spec, 1.0, spec_accum); - } -} - #if 0 /* Finish reprojection with motion vectors */ vec3 get_motion_vector(vec3 pos) { |