GLSL shader - circular gradient

Hi,

what I’m trying to implement is to cast out a ray that hits an object.
This object has a shader attached, that should calculate the hit position and draw a circle around on the texture with a gradient fading out.

My problems now are:
1.) how to get the hit position
2.) how to draw a circle around on the hit positions texture

I’ve made a screenshot of the UV-map + the model.

Image inside!

Kind regards,
Marius

Well you can get the hit position from hit.point in the RaycastHit structure returned by the raycast. You would then feed that into the shader and have it calculate the color of the pixels around the point using the CG length(pixel - hitPointFedIn).