All pastes #483554 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-11 19:55 UTC
rendered paste body
if (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();
                                }
                            }