Question: 9. GLSL code #1 contains a vertex shader: #version 140 // Input vertex data, different for all executions of this shader attribute vec4 vPosition; attribute

9. GLSL code #1 contains a vertex shader: #version 140 // Input vertex data, different for all executions of this shader attribute vec4 vPosition; attribute vec3 vNormal varying vec4 color; uniform mat4 mPVNM uniform mat4 mVM; uniform vec4 AmbientProduct, DiffuseProduct, SpecularProduct; uniform vec4 LightPosition; uniform float Shininess; void main // Compute illumination color- ambient + diffuse specular; color.a 1.0; gl Position- mPVM * vPosition; and a fragment shader: varying vec4 color; void main0 \ FragColor-color Is it Phong shading or Gouraud shading? Briefly describe how you can convert it to the other type of shading in these two listed, including the changes to the varying variables (input of fragment shader and output of vertex shader) 9. GLSL code #1 contains a vertex shader: #version 140 // Input vertex data, different for all executions of this shader attribute vec4 vPosition; attribute vec3 vNormal varying vec4 color; uniform mat4 mPVNM uniform mat4 mVM; uniform vec4 AmbientProduct, DiffuseProduct, SpecularProduct; uniform vec4 LightPosition; uniform float Shininess; void main // Compute illumination color- ambient + diffuse specular; color.a 1.0; gl Position- mPVM * vPosition; and a fragment shader: varying vec4 color; void main0 \ FragColor-color Is it Phong shading or Gouraud shading? Briefly describe how you can convert it to the other type of shading in these two listed, including the changes to the varying variables (input of fragment shader and output of vertex shader)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
