Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/surface_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(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) | ||||
| #pragma BLENDER_REQUIRE(volumetric_lib.glsl) | #pragma BLENDER_REQUIRE(volumetric_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(renderpass_lib.glsl) | #pragma BLENDER_REQUIRE(renderpass_lib.glsl) | ||||
| #ifdef USE_ALPHA_BLEND | |||||
| /* Use dual source blending to be able to make a whole range of effects. */ | |||||
| layout(location = 0, index = 0) out vec4 outRadiance; | |||||
| layout(location = 0, index = 1) out vec4 outTransmittance; | |||||
| #else /* OPAQUE */ | |||||
| layout(location = 0) out vec4 outRadiance; | |||||
| layout(location = 1) out vec2 ssrNormals; | |||||
| layout(location = 2) out vec4 ssrData; | |||||
| layout(location = 3) out vec3 sssIrradiance; | |||||
| layout(location = 4) out float sssRadius; | |||||
| layout(location = 5) out vec3 sssAlbedo; | |||||
| #endif | |||||
| uniform float backgroundAlpha; | |||||
| #ifdef EEVEE_DISPLACEMENT_BUMP | #ifdef EEVEE_DISPLACEMENT_BUMP | ||||
| # ifndef GPU_METAL | # ifndef GPU_METAL | ||||
| /* Prototype. */ | /* Prototype. */ | ||||
| vec3 displacement_exec(); | vec3 displacement_exec(); | ||||
| # endif | # endif | ||||
| /* Return new shading normal. */ | /* Return new shading normal. */ | ||||
| Show All 24 Lines | |||||
| { | { | ||||
| g_data = init_globals(); | g_data = init_globals(); | ||||
| #ifdef EEVEE_DISPLACEMENT_BUMP | #ifdef EEVEE_DISPLACEMENT_BUMP | ||||
| g_data.N = displacement_bump(); | g_data.N = displacement_bump(); | ||||
| #endif | #endif | ||||
| #if defined(WORLD_BACKGROUND) || defined(PROBE_CAPTURE) | #if defined(WORLD_BACKGROUND) || defined(PROBE_CAPTURE) | ||||
| /* Skip attribute load for shaders which do not require this part of the path. E.g. Cryptomatte. */ | |||||
| # ifndef NO_ATTRIB_LOAD | |||||
| attrib_load(); | attrib_load(); | ||||
| #endif | # endif | ||||
| #endif | |||||
| out_ssr_color = vec3(0.0); | out_ssr_color = vec3(0.0); | ||||
| out_ssr_roughness = 0.0; | out_ssr_roughness = 0.0; | ||||
| out_ssr_N = g_data.N; | out_ssr_N = g_data.N; | ||||
| out_sss_radiance = vec3(0.0); | out_sss_radiance = vec3(0.0); | ||||
| out_sss_radius = 0.0; | out_sss_radius = 0.0; | ||||
| out_sss_color = vec3(0.0); | out_sss_color = vec3(0.0); | ||||
| ▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines | |||||