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

Semi transparent surface support #41

Open
dtrebilco opened this issue Jan 13, 2022 · 5 comments
Open

Semi transparent surface support #41

dtrebilco opened this issue Jan 13, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@dtrebilco
Copy link

Currently all semi-transparent surfaces are rendered as opaque.

I realize that semi-transparent ordering and sorting is always an issue in rasterization, but at least in my case it would be simple as I don't typically have overlapping semi-transparent objects.

  • First option might be to simply ignore semi transparent objects (or have an option to)
  • Next level option might be to ignore semi-transparent in the voxel grid but still render the semi-transparent objects after the opaque pass (ignore sorting)

I still don't have a clear mental picture of how the renderer works so this may not be easy / possible.

Here is a sample scene in the engine where I have had to manually remove the windows to allow the sun light in.

Screenshot 2022-01-13 164949

@dtrebilco dtrebilco added the enhancement New feature or request label Jan 13, 2022
@h3r2tic
Copy link
Collaborator

h3r2tic commented Jan 15, 2022

What is this "transparency" thing you speak of? It doesn't look like anything to me 🙈

cough

I'm afraid transparency will have to wait. It is notoriously difficult, and would touch just about every aspect of the renderer. Unless it's purely additive, even the most minimal version would require some sorting or an order-independent solution (because most scenes are not as well-behaved as yours), and probably some hooks into TAA so that it doesn't produce horrible amounts of ghosting.

And that's just for unlit stuff. It would likely need reflections -- that means ray-tracing from transparent surfaces. Mirror reflections might be okay (although expensive), while rough ones would be noisy since reflection denoising works on the g-buffer. Then transparent stuff needs to interact with reflection and diffuse global illumination rays (the voxel grid is only part of the fun; there's also screen rays that need to hit transparent surfaces). Those might need to trace additional rays towards lights too.

... and even this is still non-physical land; then one needs refractions and colored transmission too... Oh and there's issues with post-processing, e.g. motion blur and depth of field.


Yup, there are simple paths one can take first, but judging by your screenshot, you'd probably want at least reflections and tinted transmission 😅 If you are passionate about transparency and would like to engineer a robust solution (probably considering many of the above), then let's talk! If that sounds like a bit much, then we could go with your first option for now, and ignore transparent objects... I would like to get to transparency at some point, but I'm still re-engineering the global illumination solver, and it's rather tricky even when assuming everything is opaque. I also don't want to just start adding hacks, as many other renderers do when it comes to transparency.

@dtrebilco
Copy link
Author

Thanks for taking the time to reply - I figured it was a long shot, but thought I would ask anyway in case it was in the roadmap and I got a suggestion of a branch to try.

I might be able to hack some solutions just for myself, with some effort.

The engine as it stands is already very impressive in both speed and quality - in our use case (besides transparency) it is beating UE5 Lumen.

@h3r2tic
Copy link
Collaborator

h3r2tic commented Jan 19, 2022

I might be able to hack some solutions just for myself, with some effort.

Give me a shout if you run into some trouble or need something clarified -- either here or on Discord!

The engine as it stands is already very impressive in both speed and quality - in our use case (besides transparency) it is beating UE5 Lumen.

Oh wow, that's... unexpected 😄 I'm very happy to hear that! 🥳

@VZout
Copy link
Member

VZout commented Jan 24, 2022

I'm doing some experimenting with including transparent objects in the GI. Maybe I can share the code at some point. But its not on the surfel+restir branch

@SamuelTallet
Copy link

gltf crate now supports KHR_materials_volume extension.
I hope one day kajiya will support translucent objects! 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants