Workbench: Fix premultiply alpha issue in transparent material
This commit is contained in:
parent
a40d9ce553
commit
d051dd01ed
|
@ -25,7 +25,8 @@ void main()
|
|||
|
||||
vec3 trans_color = trans_accum.rgb / clamp(trans_accum.a, 1e-4, 5e4);
|
||||
|
||||
fragColor = vec4(trans_color, 1.0 - trans_revealage);
|
||||
fragColor.a = 1.0 - trans_revealage;
|
||||
fragColor.rgb = trans_color * fragColor.a;
|
||||
|
||||
#ifdef V3D_SHADING_OBJECT_OUTLINE
|
||||
uint object_id = texelFetch(objectId, texel, 0).r;
|
||||
|
|
|
@ -827,7 +827,7 @@ void workbench_deferred_cache_init(WORKBENCH_Data *vedata)
|
|||
}
|
||||
/* OIT Composite */
|
||||
{
|
||||
int state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA;
|
||||
int state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA_PREMUL;
|
||||
psl->oit_composite_pass = DRW_pass_create("OIT Composite", state);
|
||||
|
||||
grp = DRW_shgroup_create(e_data.oit_resolve_sh, psl->oit_composite_pass);
|
||||
|
|
Loading…
Reference in New Issue