Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
| /* Required by some nodes. */ | /* Required by some nodes. */ | ||||
| #pragma BLENDER_REQUIRE(common_hair_lib.glsl) | #pragma BLENDER_REQUIRE(common_hair_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_math_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_view_lib.glsl) | #pragma BLENDER_REQUIRE(common_view_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_uniforms_lib.glsl) | #pragma BLENDER_REQUIRE(common_uniforms_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(closure_eval_surface_lib.glsl) | #pragma BLENDER_REQUIRE(closure_eval_surface_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(surface_lib.glsl) | #pragma BLENDER_REQUIRE(surface_lib.glsl) | ||||
| #ifdef USE_ALPHA_HASH | #ifdef USE_ALPHA_HASH | ||||
| /* A value of -1.0 will disable alpha clip and use alpha hash. */ | |||||
| uniform float alphaClipThreshold; | |||||
| /* From the paper "Hashed Alpha Testing" by Chris Wyman and Morgan McGuire */ | /* From the paper "Hashed Alpha Testing" by Chris Wyman and Morgan McGuire */ | ||||
| float hash(vec2 a) | float hash(vec2 a) | ||||
| { | { | ||||
| return fract(1e4 * sin(17.0 * a.x + 0.1 * a.y) * (0.1 + abs(sin(13.0 * a.y + a.x)))); | return fract(1e4 * sin(17.0 * a.x + 0.1 * a.y) * (0.1 + abs(sin(13.0 * a.y + a.x)))); | ||||
| } | } | ||||
| float hash3d(vec3 a) | float hash3d(vec3 a) | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||