Esempio n. 1
0
        public Color GetColor(TraceContext context)
        {
            var color = reflectiveMaterial.GetColor(context.Ray, context.Intersection, context.TraceFunc, context.Depth)
                        .Mix(solidMaterial.GetColor(context.Ray, context.Intersection, context.TraceFunc, context.Depth), .5f);

            return(color);
        }
Esempio n. 2
0
        public Color GetColor(TraceContext context)
        {
            var color = opaqueObject.GetColor(context.Ray, context.Intersection, context.TraceFunc, context.Depth);

            if (reflectiveBaseMaterial != null && context.IsSurface)
            {
                var reflectColor = reflectiveBaseMaterial.GetColor(context.Ray, context.Intersection, context.TraceFunc, context.Depth);
                color = color.Mix(reflectColor, reflectivity.Value);
            }

            return(color);
        }