Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
| #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(bsdf_common_lib.glsl) | #pragma BLENDER_REQUIRE(bsdf_common_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(bsdf_sampling_lib.glsl) | #pragma BLENDER_REQUIRE(bsdf_sampling_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(raytrace_lib.glsl) | #pragma BLENDER_REQUIRE(raytrace_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(surface_lib.glsl) | #pragma BLENDER_REQUIRE(surface_lib.glsl) | ||||
| /* ------------ Refraction ------------ */ | /* ------------ Refraction ------------ */ | ||||
| #define BTDF_BIAS 0.85 | #define BTDF_BIAS 0.85 | ||||
| uniform sampler2D refractColorBuffer; | |||||
| uniform float refractionDepth; | |||||
| vec4 screen_space_refraction(vec3 vP, vec3 N, vec3 V, float ior, float roughnessSquared, vec4 rand) | vec4 screen_space_refraction(vec3 vP, vec3 N, vec3 V, float ior, float roughnessSquared, vec4 rand) | ||||
| { | { | ||||
| float alpha = max(0.002, roughnessSquared); | float alpha = max(0.002, roughnessSquared); | ||||
| /* Importance sampling bias */ | /* Importance sampling bias */ | ||||
| rand.x = mix(rand.x, 0.0, BTDF_BIAS); | rand.x = mix(rand.x, 0.0, BTDF_BIAS); | ||||
| vec3 T, B; | vec3 T, B; | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||