public override Vec3 TraceRay(Ray ray) { ShadeRec sr = new ShadeRec(world.HitBareBonesObjects(ray)); if (sr.HitAnObject) { return(sr.Color); } return(base.TraceRay(ray)); }
public override Vec3 TraceRay(Ray ray) { ShadeRec sr = world.HitBareBonesObjects(ray); if (sr.HitAnObject) { return(sr.Color); } return(world.BackgroundColor); }
public override Vec3 TraceRay(Ray ray, int depth) { ShadeRec sr = world.HitObjects(ray); if (sr.HitAnObject) { sr.Ray = ray; return(sr.Material.Shade(sr)); } return(world.BackgroundColor); }
public virtual Vector3 TraceRay(Ray ray) { ShadeRec sr = m_context.HitObjects(ray); if (sr.isHitObj) { return(sr.hitMaterial.Shade(sr)); } else { return(ColourF.Black); } }
public override Vector3 TraceRay(Ray ray) { ShadeRec sr = m_context.HitObjects(ray); if (sr.isHitObj) { return(sr.hitMaterial.ShadeAreaLight(sr)); } else { return(ColourF.Black); } }
public override Vector3 TraceRay(Ray ray) { ShadeRec sr = m_context.HitObjects(ray); if (sr.isHitObj) { Vector3 normal = sr.normal.Nor(); return(0.5f * (normal + Vector3.One)); } else { return(ColourF.Black); } }
public override Vec3 TraceRay(Ray ray, int depth) { if (depth > world.ViewPlane.MaxDepth) { return(ColorUtils.BLACK); } ShadeRec sr = world.HitObjects(ray); if (sr.HitAnObject) { sr.Depth = depth; sr.Ray = ray; return(sr.Material.GlobalShade(sr)); } return(world.BackgroundColor); }
public override Vec3 TraceRay(Ray ray, ref double tmin, int depth) { if (depth > world.ViewPlane.MaxDepth) { return(ColorUtils.BLACK); } else { ShadeRec sr = world.HitObjects(ray); if (sr.HitAnObject) { sr.Ray = ray; sr.Depth = depth; tmin = sr.Tmin; return(sr.Material.AreaLightShade(sr)); } tmin = MathUtils.HugeValue; return(world.BackgroundColor); } }