0beqz / realism-effects

SSGI, Motion Blur, TRAA - Effects to enhance your three.js scene's realism
https://realism-effects-obeqz.vercel.app/
MIT License
1.43k stars 67 forks source link

Transparent materials not displayed with transparency #2

Open hybridherbst opened 1 year ago

hybridherbst commented 1 year ago

When clicking through the sample models on https://realism-effects.vercel.app/, I noted the Swordsman looks wrong around the cape / cutout parts:

20230304-213731_chrome

I think either transparency or cutout may not be working correctly with SSGI on.

EDIT: even more apparent on "cyber samurai" and can also be seen on "amg" on the headlights, on "motorbike" on the glass parts, on "cyberpunk_bike" on the floor.

I understand there are limitations with depth-based effects and transparency - would be great if those objects would render kind of correct though.

0beqz commented 1 year ago

True, the reason why it's not supported yet is because transparency didn't have a priority and as I wasn't sure which method would be the best to deal with transparency without losing performance due to extra renders.

Right now I'm experimenting with alpha hashing in the G-buffers which allows for transparency but results in flickering at the moment due to how the denoiser works. I'm looking for a performant way to get rid of the flickering and fully support transparency.

0beqz commented 1 year ago

This is still an on-going issue as, with how the pipeline is designed, transparency is quite performance-draining because it would require a second G-Buffer pass as it seems. So I'll have to look into the best solution for this pipeline. Right now, the most performant solution could be rendering all transparent materials either invisible or opaque and then accumulate them as the camera stopped moving (due to detecting disocclusions and reprojecting in the TR pass being also complicated with transparent materials).

hybridherbst commented 1 year ago

I think the above sample could pass with just cutout (instead of opacity blending), but agreed in the general case it's hard...