Advanced Computer Graphics: Laboratory Project

<< PREV | INDEX | NEXT >>

Task 2E: Add a Fresnel Term

Solution

In the fragment shader:

float fresnel = saturate(R0 + (1 - R0) * pow(1 - dot(directionToEye, normal), 5));

And a bit further down the fragment shader:

outColor.a = tex.a + fresnel;
Figure 9: Visualization of the fresnel value.

Figure 10: Environment mapping using fresnel term approximation.

<< PREV | INDEX | NEXT >>