Skip to content

two-volume mode for translucent polys - #2505

Draft
Bruceleeto wants to merge 1 commit into
flyinghead:devfrom
Bruceleeto:renderer
Draft

Bruceleeto wants to merge 1 commit into
flyinghead:devfrom
Bruceleeto:renderer

Conversation

@Bruceleeto

Copy link
Copy Markdown

Two-volume mode was only applied to OP and PT. For TR polys, the resolve pass already picked the area 1 blend mode, but the colour was always shaded with area 0, so the second texture, UVs, vertex colours, and shading params were ignored.

The area isn't known when a TR fragment is stored, since the TR modvols are drawn afterwards. The OIT shader now shades both areas and keeps the area 1 colour in a side buffer for the resolve pass to pick from.

No perf impact expected for games that don't use it. pp_TwoVolumes is already part of the shader key, so those shaders compile to the same code as before. The side buffer is a 4-byte stub until a two-volume TR poly actually appears.

Only tested on scanner.cdi. Few games use this, so it's more a "match real hardware" fix than something most people will notice.

Vulkan and DX11 have the same issue and are not done yet and i wont be doing them.
If you need to see the code DM me or check out my DMS-Engine next branch should be updated in a day or two.. or look at the Scanner demo in katana. The .cdi is on the flycord discord just search scanner.cdi

not too fussed if you dont add this as I have no plan to use this effect as of yet anyway. Just thought i'd throw this PR are up for the record.

Two-volume mode was only applied to the OP and PT lists. For translucent
  polys the resolve pass already picked the area 1 blend mode, but the
  fragment color was always shaded with area 0, so the second texture,
  UVs, vertex colors and shading params were ignored.

  The area can't be known when a translucent fragment is stored, since the
  translucent modifier volumes aren't drawn until afterwards. Shade both
  areas instead and keep the area 1 color in a side buffer for the resolve
  pass to pick from.

  The side buffer is a 4 byte stub until a two-volume translucent poly
  shows up, and pp_TwoVolumes is already part of the shader key, so games
  that don't use it compile and run the same code as before.

Vulkan/DX11: not fixed
@Bruceleeto Bruceleeto closed this Oct 8, 2026
@flyinghead flyinghead reopened this Oct 9, 2026
@flyinghead
flyinghead marked this pull request as draft October 9, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants