Someone
public text v1 · immutableif (nearestObject.Material.Specular > 0)
{
Vector3 reflected = nearestObject.ReflectRayAtPoint(ray.Direction, intersectionPoint);
float specularDP = Vector3.Dot(ray.Direction, reflected);
if (specularDP > 0)
{
float specular = (float)Math.Pow(specularDP, 30) * nearestObject.Material.Specular;
nearest += specular * obj.Material.color.ToVector4();
}
}