3Dsander while you wait for a real answer, depending on what you need, cant you just overlay another texture at the position where your ray hit using gdscript instead of shader?
Would help if you atleast had some code to work with posted here so we could see where is bob?
Id start with this https://docs.godotengine.org/en/stable/tutorials/physics/ray-casting.html
there is an example for what you look
const RAY_LENGTH = 1000
func _physics_process(delta):
var space_state = get_world_3d().direct_space_state
var cam = $Camera3D
var mousepos = get_viewport().get_mouse_position()
var origin = cam.project_ray_origin(mousepos)
var end = origin + cam.project_ray_normal(mousepos) * RAY_LENGTH
var query = PhysicsRayQueryParameters3D.create(origin, end)
query.collide_with_areas = true
var result = space_state.intersect_ray(query)
You just need to decide how to get the ray, either from camera or raycast - could be mouse event.