Differential D4694 Diff 14870 source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl
| Show All 19 Lines | |||||
| uniform float shadowFocus = 1.0; | uniform float shadowFocus = 1.0; | ||||
| #ifdef NORMAL_VIEWPORT_PASS_ENABLED | #ifdef NORMAL_VIEWPORT_PASS_ENABLED | ||||
| in vec3 normal_viewport; | in vec3 normal_viewport; | ||||
| #endif /* NORMAL_VIEWPORT_PASS_ENABLED */ | #endif /* NORMAL_VIEWPORT_PASS_ENABLED */ | ||||
| #ifdef V3D_SHADING_TEXTURE_COLOR | #ifdef V3D_SHADING_TEXTURE_COLOR | ||||
| in vec2 uv_interp; | in vec2 uv_interp; | ||||
| #endif | #endif | ||||
| #ifdef V3D_SHADING_VERTEX_COLOR | |||||
| in vec3 vertexColor; | |||||
| #endif | |||||
| #ifdef V3D_LIGHTING_MATCAP | #ifdef V3D_LIGHTING_MATCAP | ||||
| uniform sampler2D matcapImage; | uniform sampler2D matcapImage; | ||||
| #endif | #endif | ||||
| layout(std140) uniform world_block | layout(std140) uniform world_block | ||||
| { | { | ||||
| WorldData world_data; | WorldData world_data; | ||||
| }; | }; | ||||
| layout(location = 0) out vec4 transparentAccum; | layout(location = 0) out vec4 transparentAccum; | ||||
| layout(location = 1) out | layout(location = 1) out | ||||
| float revealageAccum; /* revealage actually stored in transparentAccum.a */ | float revealageAccum; /* revealage actually stored in transparentAccum.a */ | ||||
| void main() | void main() | ||||
| { | { | ||||
| vec4 diffuse_color; | vec4 diffuse_color; | ||||
| #ifdef V3D_SHADING_TEXTURE_COLOR | #if defined(V3D_SHADING_TEXTURE_COLOR) | ||||
| diffuse_color = workbench_sample_texture(image, uv_interp, imageSrgb, imageNearest); | diffuse_color = workbench_sample_texture(image, uv_interp, imageSrgb, imageNearest); | ||||
| if (diffuse_color.a < ImageTransparencyCutoff) { | if (diffuse_color.a < ImageTransparencyCutoff) { | ||||
| discard; | discard; | ||||
| } | } | ||||
| #elif defined(V3D_SHADING_VERTEX_COLOR) | |||||
| diffuse_color = vec4(vertexColor, 1.0); | |||||
| #else | #else | ||||
| diffuse_color = vec4(materialDiffuseColor, 1.0); | diffuse_color = vec4(materialDiffuseColor, 1.0); | ||||
| #endif /* V3D_SHADING_TEXTURE_COLOR */ | #endif /* V3D_SHADING_TEXTURE_COLOR */ | ||||
| vec2 uv_viewport = gl_FragCoord.xy * invertedViewportSize; | vec2 uv_viewport = gl_FragCoord.xy * invertedViewportSize; | ||||
| vec3 I_vs = view_vector_from_screen_uv(uv_viewport, viewvecs, ProjectionMatrix); | vec3 I_vs = view_vector_from_screen_uv(uv_viewport, viewvecs, ProjectionMatrix); | ||||
| #ifdef NORMAL_VIEWPORT_PASS_ENABLED | #ifdef NORMAL_VIEWPORT_PASS_ENABLED | ||||
| Show All 34 Lines | |||||