diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-26 14:46:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-26 14:46:37 +0300 |
commit | 5b299e5999e2b59e30edd4e770f64aa700e482d6 (patch) | |
tree | 17052358b339e20c44ca942e62b735ef63b23f88 /source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl | |
parent | 9bce134e56c28045aee37080f5c5b6622a07927b (diff) |
D13910: Workbench: Port shaders to use GPUShaderCreateInfo
Also adds a few things to GPUShader for easily create shaders.
Heavy usage of macros to compose the createInfo and avoid
duplications and copy paste bugs.
This makes the link between the shader request functions
(in workbench_shader.cc) and the actual createInfo a bit
obscure since the names are composed and not searchable.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D13910
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl index 0062cbe17a2..9c0f93c67d9 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl @@ -1,21 +1,10 @@ #pragma BLENDER_REQUIRE(common_view_lib.glsl) -#pragma BLENDER_REQUIRE(workbench_shader_interface_lib.glsl) #pragma BLENDER_REQUIRE(workbench_common_lib.glsl) #pragma BLENDER_REQUIRE(workbench_image_lib.glsl) #pragma BLENDER_REQUIRE(workbench_matcap_lib.glsl) #pragma BLENDER_REQUIRE(workbench_world_light_lib.glsl) -#ifndef WORKBENCH_SHADER_SHARED_H -/* Revealage is actually stored in transparentAccum alpha channel. - * This is a workaround to older hardware not having separate blend equation per render target. */ -layout(location = 0) out vec4 transparentAccum; -layout(location = 1) out vec4 revealageAccum; - -/* NOTE: Blending will be skipped on objectId because output is a non-normalized integer buffer. */ -layout(location = 2) out uint objectId; -#endif - /* Special function only to be used with calculate_transparent_weight(). */ float linear_zdepth(float depth, vec4 viewvecs[2], mat4 proj_mat) { @@ -69,7 +58,7 @@ void main() #endif #ifdef V3D_LIGHTING_MATCAP - vec3 shaded_color = get_matcap_lighting(color, N, I); + vec3 shaded_color = get_matcap_lighting(matcap_diffuse_tx, matcap_specular_tx, color, N, I); #endif #ifdef V3D_LIGHTING_STUDIO @@ -80,7 +69,7 @@ void main() vec3 shaded_color = color; #endif - shaded_color *= get_shadow(N); + shaded_color *= get_shadow(N, forceShadowing); /* Listing 4 */ float weight = calculate_transparent_weight() * alpha_interp; |