Fractrace.PictureArt.FastPreviewRenderer.PreCalculate C# (CSharp) Method

PreCalculate() protected method

Allgemeine Informationen werden erzeugt
protected PreCalculate ( ) : void
return void
        protected override void PreCalculate()
        {
            string parameterNode = "Renderer.";
            shadowNumber = 11; ParameterDict.Current.GetInt(parameterNode + "ShadowNumber");
            ambientIntensity = 0; ParameterDict.Current.GetInt(parameterNode + "AmbientIntensity");
            minFieldOfView = ParameterDict.Current.GetDouble(parameterNode + "MinFieldOfView");
            maxFieldOfView = ParameterDict.Current.GetDouble(parameterNode + "MaxFieldOfView");

            //brightness = ParameterDict.Current.GetDouble(parameterNode + "Brightness");
            brightness = 1;
            contrast = ParameterDict.Current.GetDouble(parameterNode + "Contrast");

            colorIntensity = ParameterDict.Current.GetDouble(parameterNode + "ColorIntensity");
            _colorOutside = ParameterDict.Current.GetBool("Renderer.ColorInside");
            _colorInside = ParameterDict.Current.GetBool("Renderer.ColorOutside");

            useLight = ParameterDict.Current.GetBool(parameterNode + "UseLight");
            shadowJustify = 1;  ParameterDict.Current.GetDouble(parameterNode + "ShadowJustify");

            shininessFactor = ParameterDict.Current.GetDouble(parameterNode + "ShininessFactor");
            shininess = ParameterDict.Current.GetDouble(parameterNode + "Shininess");
            lightRay.X = ParameterDict.Current.GetDouble(parameterNode + "Light.X");
            lightRay.Y = ParameterDict.Current.GetDouble(parameterNode + "Light.Y");
            lightRay.Z = ParameterDict.Current.GetDouble(parameterNode + "Light.Z");

            //areaDeph = ParameterDict.Current.GetDouble("Border.Max.y") - ParameterDict.Current.GetDouble("Border.Min.y");
            areaDeph = ParameterDict.Current.GetDouble("Scene.Radius");
            // Rotate lightvec:
            Vec3 coord = formula.GetTransformWithoutProjection(0, 0, 0);
            Vec3 tempcoord2 = formula.GetTransformWithoutProjection(lightRay.X, lightRay.Y, lightRay.Z);
            tempcoord2.X -= coord.X;
            tempcoord2.Y -= coord.Y;
            tempcoord2.Z -= coord.Z;
            tempcoord2.Normalize();
            lightRay.X = tempcoord2.X;
            lightRay.Y = tempcoord2.Y;
            lightRay.Z = tempcoord2.Z;

            colorFactorRed = ParameterDict.Current.GetDouble(parameterNode + "ColorFactor.Red");
            colorFactorGreen = ParameterDict.Current.GetDouble(parameterNode + "ColorFactor.Green");
            colorFactorBlue = ParameterDict.Current.GetDouble(parameterNode + "ColorFactor.Blue");

            lightIntensity = 0; // ParameterDict.Exemplar.GetDouble(parameterNode + "LightIntensity");
            if (lightIntensity >= 1.0)
                shadowNumber = 0;

            colorGreyness = ParameterDict.Current.GetDouble(parameterNode + "ColorGreyness");
            rgbType = ParameterDict.Current.GetInt(parameterNode + "ColorFactor.RgbType");

            backColorRed = ParameterDict.Current.GetDouble("Renderer.BackColor.Red");
            backColorGreen = ParameterDict.Current.GetDouble("Renderer.BackColor.Green");
            backColorBlue = ParameterDict.Current.GetDouble("Renderer.BackColor.Blue");

            if (lightIntensity > 1)
                lightIntensity = 1;
            if (lightIntensity < 0)
                lightIntensity = 0;

            picInfo = new int[pData.Width, pData.Height];

            for (int i = 0; i < pData.Width; i++)
            {
                for (int j = 0; j < pData.Height; j++)
                {
                    picInfo[i, j] = 0;
                }
            }
            if (_stopRequest)
                return;
            CreateStatisticInfo();
            //if (useSharpShadow)
            //    CreateSharpShadow();
            if (_stopRequest)
                return;
            CreateSmoothNormales();
            if (_stopRequest)
                return;
            CreateSmoothDeph();
            if (_stopRequest)
                return;
            CreateShadowInfo();
            if (_stopRequest)
                return;
            DrawPlane();
            if (_stopRequest)
                return;
            //if (ParameterDict.Exemplar.GetBool(parameterNode + "Normalize"))
                NormalizePlane();
            if (_stopRequest)
                return;
            //if (ParameterDict.Exemplar.GetBool(parameterNode + "UseDarken"))
            //    DarkenPlane();
            if (_stopRequest)
                return;
            SmoothEmptyPixel();
            if (_stopRequest)
                return;
            SmoothPlane();
        }