Question: Add lighting to Program 10.4, so that the surface structure of the height-mapped terrain is further exposed. Program 10.4 #version 430 layout (location=0) in vec3

Add lighting to Program 10.4, so that the surface structure of the height-mapped terrain is further exposed.

Program 10.4

#version 430 layout (location=0) in vec3 vertPos; layout (location=1) in vec2 texCoord; layout (location=2)layout (binding=0) uniform sampler2D t; layout (binding=1) uniform sampler2D h; // for texture // for

#version 430 layout (location=0) in vec3 vertPos; layout (location=1) in vec2 texCoord; layout (location=2) in vec3 vertNormal; out vec2 tc; uniform mat4 mv_matrix; uniform mat4 p_matrix;

Step by Step Solution

3.39 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres how your modified vertex shader might look after adding the Lambertian lighting 1 version ... View full answer

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 Computer Graphics Programming Questions!