示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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;
        }