When using a perspective matrix in a vertex shader am I supposed to write code to divide by w or is it done automatically in a later stage?
The reason for my question is that I have seen lots of vertex shaders using:
gl_Position = matrix * pos;
Run Code Online (Sandbox Code Playgroud)
which makes sense if there is a later stage that divides the vector with its w component.
However I never got it to work until I used the following in my vertex …