Question: Need help: The only change you will make is in the vertex shader. Change one line in the vertex shader so that the fragment color

Need help:
The only change you will make is in the vertex shader. Change one line in the vertex shader so that the fragment color will be based on the world coordinates of a fragment.
Vertex Shader given:
#version 330 core
in vec4 b_position;
in vec4 b_color;
// what we have been calling 'transform' before is called 'mvp_transform' here
// this indicates that the transform is projection times view times animation times world
uniform mat4 u_mvp_transform;
out vec4 s_color;
out vec4 position;
void main(){
gl_Position = u_mvp_transform * b_position;
s_color = b_color;
position = b_position;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!