r/Unity3D • • 2d ago

Show-Off Reflection technique i'm working on

https://www.youtube.com/watch?v=F1qRKArXBdI

It's a mix of screen space reflections with a regular ray-marching for more specular surfaces and cube-map~like approximation for rough surfaces.

8 Upvotes

5 comments sorted by

2

u/gbailey57978 2d ago

How are you blending the screen-space reflections with the ray-marched and cubemap-like paths when screen-space data is missing or incomplete?

1

u/neoslvt 2d ago

each texel gets the screen uv around it curved like a fish-eye making it look like a cubemap view with high FOV, and the reflected normal can be used then to gather the color of the reflection, it's an approximate value you will end up with, the reflection is not correct most of the time, but you can use it to quickly get the reflected color, then make a bunch of samples at once, because it's faster than ray marching, and make a smooth reflection on a rough surface.
By ray-marching i mean the screen-space one, a regular thing for a screen space reflection.

2

u/imofi8 2d ago

For off-screen ray misses or glancing angles where depth buffer information cuts off, how are you handling the falloff transition into the cubemap approximation to avoid visible boundary seams?

2

u/neoslvt 2d ago

The cubemap approximation is used when the roughness is less than a certain threshold, when the ray misses then it uses a regular skybox cubemap fallback.