Hey guys. Can you tell me, what optimizations can I apply for raycast if I gonna use a very short ray in a known area (small area around a known coordinate). I use raycast on a huge mesh with a lot of faces to find a normal and UV coordinate near the coordinate that already lies on the surface of this mesh.
I have to use some raycasts at each draw tick and have a performance problem with it (especially on phones where even one raycast action in one draw round greatly reduce performance).
May be I have to cut my big mesh into small pieces or something like that? Who has any ideas about this?
Here is a demo how I use it. I raycast down in front of a cube to find a next position for it. And use normal to set rotation, and use UV to draw on the texture.
Facet data can not use directed vectors for it, only coordinate, so I don’t think it well suited for it, or I missed something?
I have found Raycasting larger geometries can kill performance just like you are saying. I have tried to keep my target geometries low in order to keep it quick. Number of targets will play a role too. If you break them up you will have simpler meshes but have more meshes to iterate through each frame so I don’t know what performance you will gain.