shader or any other way for 3D Raycast shadow and light

how can do shader or any other way for this work:
painting terrain according to physic.raycast from one object to other places of the terrain
same as sun and shadow , same as directional light in limited 3D scale but same as laser ray without light bent
i found spotlight good but that benting in big range for far places(it make light places in the shadow)

please help me

bit unclear what you want to do, do you have screenshots or example images?

Do you want to place objects on terrain, or paint terrain textures,
or draw something on top of terrain? (like decals), or something else?

1 Like

i want raycast shadow and light in “local 3D space” not all of the terrain but spotlight have a problem
spotlight in big range make light after obstacles because x,y,z angel change together and can not change one of them
for example : painting terrain in the sun places

unity spotlight problem :

do you mean actually painting the terrain (i think not),
or just doing this kind of light/shadow effect (visibility)
https://github.com/EntroPi-Games/GPU-Line-of-Sight
https://www.youtube.com/c/SebastianLague/search?query=field of view

yes only visibility with any way …

but unity spot light have a problem in big size objects and far from objects

this not work in mobile & in windows i have problem with unity 2018 , 2019
youtube link make with cpu and 2D