Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions