Day06 - Day 06 Vertex Shader for Ambient-Diffuse Specular...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Day 06 Vertex Shader for Ambient-Diffuse- Specular Lighting Ambient Reflection ambient light reflected by an object depends on the incident light intensity and the material ambient reflection coefficient ambientr,g,b = lightr,g,b * ambreflcoeffr,g,b Ambient Reflection uniforms // light intensity (assuming white light) uniform float uI; // ambient reflection coefficients uniform vec4 uAmb; Ambient Reflection code // ambient intensity vec3 ambient = uI * vec3(uAmb); Diffuse Reflection diffuse light reflected by an object depends on the incident light intensity, the angle between the normal vector and light direction, and the material diffuse reflection coefficient diffuser,g,b = lightr,g,b * cos( θ ) * diffreflcoeffr,g,b Diffuse Reflection attributes // vertex location in vec4 aVertex; // normal direction at aVertex in vec3 aNormal; Diffuse Reflection uniforms uniform mat4 uModelViewMatrix; uniform mat4 uNormalMatrix; // diffuse reflection coefficients uniform vec4 uDiff; // light location in eye coordinates uniform float uX; uniform float uY; uniform float uZ; Diffuse Reflection...
View Full Document

{[ snackBarMessage ]}

Page1 / 22

Day06 - Day 06 Vertex Shader for Ambient-Diffuse Specular...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online