public override bool Scatter(Scene scene, Ray ray, HitRecord hit, out Attenuation attenuation, out Ray scattered) { Vector3 dir = Vector3.Normalize(ray.direction); attenuation = Attenuation.None(GetTextureColor(GetUV(dir))); scattered = null; return(true); }
public override bool Scatter(Scene scene, Ray ray, HitRecord hit, out Attenuation attenuation, out Ray scattered) { Vector3 unitDirection = Vector3.Normalize(ray.direction); float t = (0.5f * unitDirection.Y) + 1.0f; Vector3 colorValue = ((1.0f - t) * new Vector3(1f, 1f, 1f)) + (t * skyColor); attenuation = Attenuation.None(colorValue); scattered = null; return(true); }
public override bool Scatter(Scene scene, Ray ray, HitRecord hit, out Attenuation attenuation, out Ray scattered) { scattered = null; var textureColor = GetTextureColor(hit.uv); attenuation = Attenuation.None(color * textureColor * intensity); return(true); }
public override bool Scatter(Scene scene, Ray ray,HitRecord hit, out Attenuation attenuation, out Ray scattered) { //skyMat if(hit==null) { attenuation = Attenuation.None(albedo); scattered = null; return true; } scattered = new Ray(hit.position, ray.direction); var textureColor = GetTextureColor(hit.uv); //attenuation = Attenuation.None(new Vector3(hit.uv.X, hit.uv.Y,0)); attenuation = Attenuation.None(albedo * textureColor); return true; }