Hi all
I want to write a fragment shader that fires a ray from each fragment to a specified world co-ordinate. I want to then check these rays to see if they collided with any geometry.
Is this at all possible?
If so, any hints on how this may be implemented?
I’ve looked around various unity wikis (particularly the GLSL programming wiki) and I haven’t been able to find anything using raytracing yet. If you guys have any ray-tracing source examples, I’d love to see them.
Thanks a ton!
Hi,
VesuvianPrime : Usually raytracing and collisions are handled by the cpu. There are no many resources on gpu implementations because they are experimental at best. If you manage to implementing this, it would be something original.
Cool, thanks for the information!
What I’m essentially trying to do is cut away geometry that isn’t visible from a given point in world space. So far I’ve been able to write a trivial shader that discards fragments that face away from the source, but I want to go a step further and remove fragments that are obscured by objects closer to the source.
I’ve been reading into volumetric shadows, and I believe that if I treat the source as a light, and calculate my volumes (already working), I should be able to discard the “shadowed” geometry.
Is this shader territory?
I think the only porblem is how to pass the target geomery’s information into this shader