diff options
Diffstat (limited to 'source/blender/draw')
6 files changed, 3 insertions, 18 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl index e72ee1c2eac..d0b1c580e5f 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl @@ -8,5 +8,4 @@ struct WorldData { vec4 background_color_low; vec4 background_color_high; vec4 object_outline_color; - float see_through_transparency; }; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_forward_composite_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_forward_composite_frag.glsl index 054e8d308cb..2d6f78082e3 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_forward_composite_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_forward_composite_frag.glsl @@ -27,7 +27,7 @@ void main() if (object_id == NO_OBJECT_ID) { color = vec4(background_color(world_data, uv_viewport.y), 0.0); } else { - color = transparent_accum; + color = transparent_accum / transparent_accum.a; } fragColor = vec4(mix(world_data.object_outline_color.rgb, color.xyz, outline), 1.0); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl index 78981522c18..6428ed44f6b 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_forward_transparent_accum_frag.glsl @@ -47,17 +47,8 @@ void main() vec3 shaded_color = diffuse_color.rgb; #endif /* V3D_LIGHTING_STUDIO */ - float alpha = world_data.see_through_transparency; -#ifdef NORMAL_VIEWPORT_PASS_ENABLED - vec3 normal = normalize(normal_viewport); - float kr; - fresnel(vec3(0.0, 0.0, -1.0), normal, 1.22, kr); - alpha = mix(alpha, alpha+alpha, kr); -#endif - + float alpha = 0.1; vec4 premultiplied = vec4(shaded_color.rgb * alpha, alpha); - transparentAccum = calculate_transparent_accum(premultiplied); - } diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index c3671fa37b1..9f8023b38aa 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -20,7 +20,6 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) copy_v3_fl(wpd->shading.single_color, 0.8f); wpd->drawtype = OB_SOLID; wpd->studio_light = BKE_studiolight_findindex(0); - wpd->shading.see_through_transparency = 0.3f; } wpd->shadow_multiplier = 1.0 - wpd->shading.shadow_intensity; @@ -35,7 +34,6 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) studiolight_update_world(wpd->studio_light, wd); - wd->see_through_transparency = wpd->shading.see_through_transparency; copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color); wd->object_outline_color[3] = 1.0f; diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 2de86bf4be1..72e01213fb9 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -263,10 +263,9 @@ void workbench_forward_engine_init(WORKBENCH_Data *vedata) GPU_framebuffer_clear_color(fbl->depth_fb, clear_color); DRW_stats_group_end(); - /* Treansparecy Accum */ { - int state = DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE;// | DRW_STATE_CULL_BACK; + int state = DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE_FULL; psl->transparent_accum_pass = DRW_pass_create("Transparent Accum", state); } /* Depth */ diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index 714314a3d09..1da06e9a30d 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -93,8 +93,6 @@ typedef struct WORKBENCH_UBO_World { float background_color_low[4]; float background_color_high[4]; float object_outline_color[4]; - float see_through_transparency; - float pad[3]; } WORKBENCH_UBO_World; BLI_STATIC_ASSERT_ALIGN(WORKBENCH_UBO_World, 16) |