// test intersection against alpha texture, if present
if (mesh.alphaTex != null)
{
Normal zeroN = new Normal(0, 0, 0);
DifferentialGeometry dgLocal = new DifferentialGeometry(ray.eval(t), dpdu, dpdv, zeroN, zeroN, tu, tv, this);
if (mesh.alphaTex.evaluate(dgLocal) == 0)
return result;
}
// fill in DifferetialGeometry from triangle hit
Normal zeroN = new Normal(0, 0, 0);
DifferentialGeometry dg = new DifferentialGeometry(ray.eval(t), dpdu, dpdv, zeroN, zeroN, tu, tv, this);
result.dg = dg;
result.tHit = t;
result.rayEpsilon = 1e-3 * t;
result.hit = true;