In my vertex shader, I'd like to set the w component to 1.
How can this be done, after
gl_Position = MVP * vec4(vertexPosition_modelspace, 1); In my vertex shader, I'd like to set the w component to 1.
How can this be done, after
gl_Position = MVP * vec4(vertexPosition_modelspace, 1); You can use swizzles to access specific coordinates in the vector.
gl_Position.w = 1.0;