Great work laugh It looks good!

1- Shouldn't be too hard. If the object is aligned according to its spherical co-ordinates rather than the normal beneath it, you can just translate the destination into a position relative to the object's orientation (vec_rotateback) and rotate the object's pan (relative to its z axis) towards that point. Since you use actual surface normals, we can set up a temporary angle that uses the spherical co-ordinates instead.

2- A shader shouldn't be able to crash a program. Divide by zero and square root of a negative number, the obvious suspects in traditional programming, don't cause crashes in shaders in my experience -- we just get zero instead. It could be a driver problem. Then again, it could be both -- perhaps the driver's supposed to not crash, but it does, and perhaps the code that triggers it is undesirable anyway.

Anyway, that's just food for thought. Enjoy your weekend and forget about this for now.


Formerly known as JulzMighty.
I made KarBOOM!