How do I make the vec3 viewpos follow the values of the camera? Presumably they should be the same but I don't know how to access the camera's position values.
How do I make the vec3 viewpos follow the values of the camera? Presumably they should be the same but I don't know how to access the camera's position values.
If I understood you correctly, you want to know the position of the camera in world space.
If so, it's quite simple: 1. Right-click your effect in your workspace and then select: Add Variable > Float > Predefined > vViewPosition
Define it in your shader like this:
Use it however you like. Example vertex shader:
I hope that helped.