Modify Program 8.2 to replace the hardcoded values 0.001 in the lookup() function, with the more accurate

Question:

Modify Program 8.2 to replace the hardcoded values 0.001 in the lookup() function, with the more accurate values of 1.0/shadowbufferwidth and 1.0/shadowbufferheight. Observe to what degree this change makes a difference (or not) for various window sizes.

Program 8.2Fragment Shader #version 430 // all variable declarations are unchanged // Returns the shadow depth value forvoid main(void) { float shadowFactor = 0.0; vec3 L = normalize(vLightDir); vec3 N = normalize(vNormal); vec3shadowFactor shadowFactor shadowFactor += lookup(-1.5*swidth += lookup(0.5*swidth += lookup(0.5*swidth +

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Graphics Programming In OpenGL With JAVA

ISBN: 9781683922193

2nd Edition

Authors: V. Scott Gordon PhD, John L. Clevenger PhD

Question Posted: