so how exactly you do this kind of efffect, what do you need to draw and what ro compare with, didn't find any good tutorial for that.
Do you have to store each fragment position in textures then compare it within fragment shader or what?
cheers
so how exactly you do this kind of efffect, what do you need to draw and what ro compare with, didn't find any good tutorial for that.
Do you have to store each fragment position in textures then compare it within fragment shader or what?
cheers
You don't need to store positions because you can compute fragment position from depth buffer values.
Same basic structure as screen space reflections, except instead of tracing along the reflection direction, you trace towards the light. If/when you find a hit, instead of using the color at that location for reflection data, you check if the intersection point is closer than the light source or not.
. 22 Racing Series .
So in other words, for each frame write depth buffer to a texture then draw scene with light/shadow pass and then sample the ray from each fragment towards the light right? ;)