overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
138 stars 50 forks source link

Support opaque (and black) particles #844

Closed HifiExperiments closed 6 months ago

HifiExperiments commented 7 months ago

Closes #833

Particles can render opaque if their texture has no alpha or is detected as "alpha mask" (e.g. https://pngimg.com/d/grass_PNG4922.png). If any of their alpha properties (start, middle, finish) are < 1, or their alpha spread is > 0, or they have alpha pulsing, they'll go back to transparent (+ additive blending). At a later date, we could support overriding the automatic detection via material entities.

Screenshot 2024-03-01 130300

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

SilverfishVR commented 7 months ago

It's beautiful Screenshot 2024-03-02 18 32 32

And everything seems to work as advertised šŸ‘

vegaslon commented 7 months ago

overte-snap-by--on-2024-03-02_19-06-47

interesting side effect is they cast shadows, can even be turned off correctly

vegaslon commented 7 months ago

if all alpha properties are set to 1 are they suppose to render as black and have no color? this is on high setting for the graphics on a amd overte-snap-by-vegaslon-on-2024-03-03_11-30-18

Tested it on a Nvidia card and they are showing up with color so must be amd.

HifiExperiments commented 7 months ago

@vegaslon ah AMD has given us this problem in the past. I don't have an AMD card to test but I've pushed a potential fix.

vegaslon commented 7 months ago

that worked to restore color to the particles, side effect is the particles no longer throw shadows (For how ever much that is worth).

HifiExperiments commented 7 months ago

that would explain this comment that I copied from polyvox: // FIXME: custom pipelines like this don't handle shadows or renderLayers correctly lol

renderLayers actually do seem to work...but it seems neither polyvox nor particles can cast shadows. these are the only two things that use a specific codepath (custom pipelines). I would vote to merge this as is and then I can fix that issue separately so as to not clutter up this PR.

I already have shadows working with GPU particlesTM though šŸ˜„

vegaslon commented 7 months ago

Ok this is something, When I run the build from github actions the particle cast shadows. So ya as far as particles go this pr seems to definitely do the job.

JulianGro commented 7 months ago

What build did you run before? You built from source yourself?

But yeah, maybe the shader cache was just being problematic. I have seen that before on Nvidia at the very least.

gydence commented 7 months ago

oh weird! I built locally and couldnā€™t get particles or polyvox to cast shadows, which isnā€™t wholly surprising to me because the way we pick shadow pipelines has never handled this ā€œcustom pipelineā€ path

vegaslon commented 7 months ago

What build did you run before? You built from source yourself?

But yeah, maybe the shader cache was just being problematic. I have seen that before on Nvidia at the very least.

ya I did a self build at first since the github actions had the linux builds stuck in line, so it was not willing to release the download links for the windows one.

HifiExperiments commented 7 months ago

just to be sure, I went ahead and fixed custom pipeline shadows and render layers. this only affects particles and polyvox

to test, opaque particles and polyvox should be able to cast shadows and render correctly in all renderLayers. transparent particles should work like they used to

vegaslon commented 7 months ago

Everything continues to appear in order, Particles and Polyvox apear to both cast shadows now, Opaque textures appear to work and transparent particles continue to function.