Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started