Exemple #1
0
        /// <inheritdoc />
        public override void Refresh()
        {
            base.Refresh();

            if (!HasDifferentValues)
            {
                var   value = (Float4)Values[0];
                var   color = new Float3(value);
                var   scale = value.W;
                float min   = color.MinValue;
                float max   = color.MaxValue;
                if (min < 0.0f)
                {
                    // Negative color case (e.g. offset)
                }
                else if (max > 1.0f)
                {
                    // HDR color case
                    color /= max;
                    scale *= max;
                }
                _xElement.Value = color.X;
                _yElement.Value = color.Y;
                _zElement.Value = color.Z;
                _wElement.Value = scale;
                _trackball.CustomControl.Color = Float3.Abs(color);
            }
        }