Beispiel #1
0
 public LaserSegment(Ray ray, int depth, LaserColor color)
 {
     Ray            = ray;
     EmissionNormal = ray.direction;
     ImpactNormal   = -EmissionNormal;
     Depth          = depth;
     Color          = color;
 }
Beispiel #2
0
        public static (LaserColor, LaserColor) SplitColor(LaserColor color)
        {
            GetRegistry();
            if (currentRegistry)
            {
                foreach (var split in currentRegistry.colorSplit)
                {
                    if (split.input == color)
                    {
                        return(split.outputA, split.outputB);
                    }
                }
            }

            return(color, color);
        }
Beispiel #3
0
        public static LaserColor MergeColors(LaserColor colorA, LaserColor colorB)
        {
            GetRegistry();
            if (currentRegistry)
            {
                foreach (var merge in currentRegistry.colorMerges)
                {
                    if ((merge.inputA == colorA && merge.inputB == colorB) ||
                        (merge.inputA == colorB && merge.inputB == colorA))
                    {
                        return(merge.output);
                    }
                }
            }

            return(colorA);
        }