Repository navigation
two-volume mode for translucent polys - #2505
Draft
Bruceleeto wants to merge 1 commit into
Draft
Bruceleeto wants to merge 1 commit into
Bruceleeto wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_TwoVolumesis 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.