Basically, I want to recreate raycasting without using the raycast node. Why? The way the raycast node works now, is that one geometry casts onto another geometry. And that's all great and fine, until you have the crazy idea to make a single geometry cast onto itself. Then it gets tricky. The raycast node can't help but to hit the geometry at the very start of a ray. And for that reason, you have to use some scaling tricks to avoid that. That much was explained to me here: Can an object raycast onto itself?
Well, scaling the rays just isn't good enough for me. I want more accurate self ray casting. And so I guess if I can figure out the math for raycasting, I can alter whatever variable needs to be altered to avoid hitting at the origin of a ray. But... raycasting math is proving too difficult for me to get on my own. Maybe someone here knows how it's done.
I was thinking something like instancing lines out of points and/or faces of the mesh. Those would act as rays. Then some magic math happens, bibbidi-Bobbidi-Boo, and those lines sample where they intersect faces.
I found a couple of papers explaining how rays are made and how hit detection work. It's just way too advanced for me: https://people.computing.clemson.edu/~dhouse/courses/405/notes/raycast.pdf https://research.ncl.ac.uk/game/mastersdegree/gametechnologies/physicstutorials/1raycasting/Physics%20-%20Raycasting.pdf
This video really breaks it down too: https://www.youtube.com/watch?v=hOeOuZGmeCM
I would appreciate any help with this, as impractical as it may sound.