Threaded View

screen-space reflections

hey, it's been a while since i asked here some question about implementation of something... and this is the case, cause i'm puzzled. before trying to implement i thought it was simple: just take view direction and eye-space normal from gbuffer, calculate reflection vector and ray-march along it until depth-hit. well... that doesn't work(and i can't wrap my head around the reason why and how it should work). and i started to investigate implementations i could find on internet. the problem is there are no papers on this topic, only a couple of really dirty and confusing examples.

first of all, all of them seem to transform reflection vector to clip space, but i don't quite get why. this example has comment saying it's for sampling from "default hardware depthbuffer". i have no idea, what it means. other examples don't say that and do sample in regular way, but still use clip space for some reason. he also uses some weird sampling method with gradients and some paraboloid parameter. i've dropped that example at this point, cause i have no idea what's he doing and i don't wanna that in my code.