Question: In Program 16.4, shadows can be very easily disabled by commenting out one particular line of code. Identify that line of code. Program 16.4 Compute
In Program 16.4, shadows can be very easily disabled by commenting out one particular line of code. Identify that line of code.
Program 16.4
Compute Shader vec3 ads_phong_lighting (Ray r, Collision c) { // Compute the ambient contribution from the ambient and positional lights vec4 ambient = worldAmb_ambient + pointLight_ambient * objMat_ambient; // initialize diffuse and specular contributions vec4 diffuse = vec4(0.0); vec4 specular = vec4(0.0); // Check to see if any object is casting a shadow on this surface Ray light_ray; light_ray.start = c.p + c.n * 0.01; light_ray.dir = normalize(pointLight_position - c.p); bool in shadow = false; // Cast the ray against the scene Collision c_shadow = get_closest_collision(light_ray);
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
In the provided code snippet the line responsi... View full answer
Get step-by-step solutions from verified subject matter experts
