N8python / n8ao

An efficient and visually pleasing implementation of SSAO with an emphasis on temporal stability and artist control.
Creative Commons Zero v1.0 Universal
378 stars 14 forks source link

.setDisplayMode Overlay #8

Closed fanjules closed 1 year ago

fanjules commented 1 year ago

Would it be possible to make the pass produce the shadows only, rather than doing the renderPass together? Essentially this would be like using .setDisplayMode("AO") but instead of white/black debug output we have transparent/black output onto the previous pass... you could call it something like .setDisplayMode("Overlay")

So in a project we could then have something like this:

By having the option to separate it this way, we would have more flexibility with the final image.

But there is more! By having separate passes, N8AO could use a different scene, camera or camera.layers for it's pass. This would allow us to use different geometry/objects for N8AO, or make some objects include/exclude N8AO (e.g. if a static object has prebaked shading, it might be desirable for that to not use N8AO).

This would make N8AO the ultimate SSAO solution for everybodies three.js projects!

N8python commented 1 year ago

N8PostPass already does this... the reason N8AOPass doesn't is because it needs the depth texture in order to work... and RenderPass doesn't export that. I'm not sure how to solve this.

fanjules commented 1 year ago

Okay thanks, that's great! I was a bit confused by the postprocessing library, as I had assumed it had been integrated into Three.js (since it had EffectComposer, RenderPass, etc.) I now realise it's different... silly me! Again, thanks.

N8python commented 1 year ago

Yeah... I'll add a feature to pass your own depth/scene texture in the next update.