vk: rt: fixup accidental translucency for alpha-masked geometries
Fixes #721
This commit is contained in:
parent
84babdfff8
commit
9088ab3dc4
|
@ -104,6 +104,12 @@ void primaryRayHit(rayQueryEXT rq, inout RayPayloadPrimary payload) {
|
|||
payload.base_color_a *= color;
|
||||
payload.emissive.rgb *= color.rgb;
|
||||
|
||||
// α-masked materials leak non-1 alpha values to bounces, leading to weird translucent edges, see
|
||||
// https://github.com/w23/xash3d-fwgs/issues/721
|
||||
// Non-translucent materials should be fully opaque
|
||||
if (model.mode != MATERIAL_MODE_TRANSLUCENT)
|
||||
payload.base_color_a.a = 1.;
|
||||
|
||||
if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_DISABLED) {
|
||||
// Nop
|
||||
} else if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_SURFHASH) {
|
||||
|
|
Loading…
Reference in New Issue