Advanced Computer Graphics: Laboratory Project

<< PREV | INDEX | NEXT >>

Task 2D: Adjust Reflectivity

Solution

Replace the line

outColor.rgb = diffuse * tex.xyz + specular + environment;

with

outColor.rgb = diffuse * tex.xyz + specular + environment * glossiness;

The environment now appears as a reflection on top of the diffuse color:

Figure 8: Resulting image with modified reflectivity.

The reflection does not yet look quite realistic (e.g. note that the windows are too transparent when they are parallell to the view vector). We will try to do something about that in task 2E where you will be asked to add a fresnel term to the reflection in order to enhance realism.


<< PREV | INDEX | NEXT >>