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);
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityIn 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;