Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rt: improve materials and blending #520

Merged
merged 11 commits into from
Apr 27, 2023
Merged

rt: improve materials and blending #520

merged 11 commits into from
Apr 27, 2023

Conversation

w23
Copy link
Owner

@w23 w23 commented Apr 24, 2023

w23 added 11 commits April 24, 2023 10:44
They have mismatching frequencies. ModelMetadata should be per-Model, there should be only a few dozen of these.
There maybe hundreds (or even thousands) of materials, but one material can be still referenced by many kusochki.

This only moves fields into new structs, which still belong to Kusok. The real extraction will happen later, see #52.
Known issues:
- Breaks sprite glow for some reason.
This required uploaded kusochki only later during frame time, just before rendering the model. Otherwise they would get incorrect rendermode.

Also add blend mode debug colors.
Known issues:
- apparently BLEND_MIX surfaces should also participate in lighting. Figure out how.
- sensitive to ray tracing order. Need proper OIT (or hacks)
Known issues:
- test_brush blend modes are broken
- emissive does not participate in weighted oit properly
Fixes blending differences in test_brush/test_sprite maps. They now look
fairly similar (modulo color correction).

OIT is still a bit off, but good enough for now
Still doesn't work for us, as we also have purely emissive/additive
polygons. wOIT doesn't seem to support that fundamentally, each surface
should still attenuate the background.

Didn't even get to the _weighted_ part of it because of that.
Limit to 8 layer for now. Seems to be working just fine.
VGPR usage and performance impact will be checked later.
Fixes rare random crashes when loading maps with many models in it.
This is to more clearly distinguish between simple blended things that
don't participate in lighting, and future more involved blending with
refraction and being affected by light
@w23 w23 changed the title rt: improve materials rt: improve materials and blending Apr 27, 2023
@w23 w23 marked this pull request as ready for review April 27, 2023 17:45
@w23 w23 merged commit 8ac1a76 into vulkan Apr 27, 2023
@w23 w23 deleted the E257-improve-materials branch April 27, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
1 participant