KinectWithVRServer.MainWindow.UpdateShaderMinMax C# (CSharp) Method

UpdateShaderMinMax() private method

private UpdateShaderMinMax ( float min, float max ) : void
min float
max float
return void
        void UpdateShaderMinMax(float min, float max)
        {
            //Check if the min or max has changed, and update it accordingly if needed
            if (scaleDepth || colorDepth)
            {
                if (depthMin != min || depthMax != max)
                {
                    depthMin = min;
                    depthMax = max;

                    if (colorDepth && scaleDepth)
                    {
                        ((Shaders.ColorScaleEffect)depthEffect).Minimum = min;
                        ((Shaders.ColorScaleEffect)depthEffect).Maximum = max;
                    }
                    else if (colorDepth)
                    {
                        ((Shaders.ColorDepthEffect)depthEffect).Minimum = min;
                        ((Shaders.ColorDepthEffect)depthEffect).Maximum = max;
                    }
                    else
                    {
                        ((Shaders.DepthScalingEffect)depthEffect).Minimum = min;
                        ((Shaders.DepthScalingEffect)depthEffect).Maximum = max;
                    }
                }
            }
        }
MainWindow