/* Simple environment-mapping shader */
surface
envmap(float Ka = 1,
Kd = 1,
intensity = 1.0;
string texturename = "";
float blur = 0.01;)
{
point Nf = faceforward (normalize(N),I);
if (texturename != "")
{
Oi = Os;
Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf)) * (intensity * color environment(texturename, Nf, "blur", blur));
}
else
{
Oi = Os;
Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf));
}
}

While not perfect, as before, the result is reasonable (for my needs) and does offer a good foundation for me to build upon as my knowledge improves.
For fun, I added our existing 'envlight' shader to the scene to provide some AO goodness - Spot the difference...
1 comments:
Out of interest, the reason for the 'pinched' appearance on the front of the teapot (both on these images, and the IBL one), is because the images being used for environments aren't properly formed latlong maps, they are normal flat cartesian maps.
Post a Comment