Exemplo n.º 1
0
        public override void SetDeclarations(ref ShaderVariables shaderVars)
        {
            Matrix3 rot = new Matrix3();

            rot.MakeFromRPY(_Rotation.x, _Rotation.y, _Rotation.z);
            mat3 glRot = rot.GetGLMat3();

            shaderVars.Add("fracScale" + _Iteration, _Scale);
            shaderVars.Add("fracRot" + _Iteration, glRot);
            shaderVars.Add("fracMinRad" + _Iteration, (float)_MinRadius);
        }
Exemplo n.º 2
0
        public override void SetDeclarations(ref ShaderVariables shaderVars)
        {
            Matrix3 preRot = new Matrix3();

            preRot.MakeFromRPY(_PreRotation.x, _PreRotation.y, _PreRotation.z);
            mat3    glPreRot = preRot.GetGLMat3();
            Matrix3 postRot  = new Matrix3();

            postRot.MakeFromRPY(_PostRotation.x, _PostRotation.y, _PostRotation.z);
            mat3 glPostRot = postRot.GetGLMat3();

            shaderVars.Add("fracScale" + _Iteration, (float)_Scale);
            shaderVars.Add("fracOffset" + _Iteration, _Offset);
            shaderVars.Add("fracPreRot" + _Iteration, glPreRot);
            shaderVars.Add("fracPostRot" + _Iteration, glPostRot);
        }
Exemplo n.º 3
0
        public void SetColourDeclerations(ref ShaderVariables shaderVariables)
        {
            shaderVariables.Add("divisor", _FractalColours.Count);

            for (int i = 0; i < _FractalColours.Count; i++)
            {
                _FractalColours[i].SetDeclarations(ref shaderVariables, i);
            }
        }
Exemplo n.º 4
0
        ShaderVariables GetShaderVars()
        {
            ShaderVariables shaderVars = new ShaderVariables();

            shaderVars.Add("progressiveIndex", _ProgressiveIndex);
            //         shaderVars.Add("screenWidth", _TargetWidth);
            //        shaderVars.Add("screenHeight", _TargetHeight);
            shaderVars.Add("frameNumber", _FrameNumber++);
            shaderVars.Add("viewMatrix", _ViewMatrix);
            shaderVars.Add("camPos", _Position);
//            shaderVars.Add("renderedTexture", 0);
//            shaderVars.Add("randomNumbers", 1);
//            shaderVars.Add("depth", _Depth ? 1 : 0);
            shaderVars.Add("mouseX", _MouseX);
            shaderVars.Add("mouseY", _TargetHeight - _MouseY);
            shaderVars.Add("sunDirection", _SunDirection);
            shaderVars.Add("focusDepth", (float)_Camera._FocusDepth);
            shaderVars.Add("apertureSize", (float)_Camera._ApertureSize);
            shaderVars.Add("fov", (float)_Camera._FOV);
            shaderVars.Add("spherical", (float)_Camera._Spherical);
            shaderVars.Add("stereographic", (float)_Camera._Stereographic);
            shaderVars.Add("fogStrength", (float)_FractalSettings._RenderOptions._FogStrength);
            shaderVars.Add("fogSamples", (float)_FractalSettings._RenderOptions._FogSamples);
            shaderVars.Add("fogColour", _FractalSettings._RenderOptions._FogColour);
            shaderVars.Add("fogType", (_FractalSettings._RenderOptions._FogType == EFogType.Vanilla) ? 0.0f : 1.0f);
            shaderVars.Add("distanceExtents", (float)_FractalSettings._RenderOptions._DistanceExtents);

            _FractalSettings.SetFractalDeclerations(ref shaderVars);
            _FractalSettings.SetColourDeclerations(ref shaderVars);

            return(shaderVars);
        }
Exemplo n.º 5
0
 public override void SetDeclarations(ref ShaderVariables shaderVars)
 {
     shaderVars.Add("fracScale" + _Iteration, (float)_Scale);
     shaderVars.Add("fracCSize" + _Iteration, _CSize);
     shaderVars.Add("fracJulia" + _Iteration, _Julia);
 }
Exemplo n.º 6
0
        public void SetDeclarations(ref ShaderVariables shaderVars, int iteration)
        {
            vec3[]  diffStart  = new vec3[_GradientSegments.Count];
            vec3[]  diffEnd    = new vec3[_GradientSegments.Count];
            vec3[]  specStart  = new vec3[_GradientSegments.Count];
            vec3[]  specEnd    = new vec3[_GradientSegments.Count];
            vec3[]  reflStart  = new vec3[_GradientSegments.Count];
            vec3[]  reflEnd    = new vec3[_GradientSegments.Count];
            float[] roughStart = new float[_GradientSegments.Count];
            float[] roughEnd   = new float[_GradientSegments.Count];
            float[] dlcStart   = new float[_GradientSegments.Count];
            float[] dlcEnd     = new float[_GradientSegments.Count];
            float[] segStart   = new float[_GradientSegments.Count];
            float[] segEnd     = new float[_GradientSegments.Count];

            for (int i = 0; i < _GradientSegments.Count; i++)
            {
                diffStart[i].x = (float)_GradientSegments[i]._StartColour._DiffuseColour._Red;
                diffStart[i].y = (float)_GradientSegments[i]._StartColour._DiffuseColour._Green;
                diffStart[i].z = (float)_GradientSegments[i]._StartColour._DiffuseColour._Blue;
                diffEnd[i].x   = (float)_GradientSegments[i]._EndColour._DiffuseColour._Red;
                diffEnd[i].y   = (float)_GradientSegments[i]._EndColour._DiffuseColour._Green;
                diffEnd[i].z   = (float)_GradientSegments[i]._EndColour._DiffuseColour._Blue;

                specStart[i].x = (float)_GradientSegments[i]._StartColour._SpecularColour._Red;
                specStart[i].y = (float)_GradientSegments[i]._StartColour._SpecularColour._Green;
                specStart[i].z = (float)_GradientSegments[i]._StartColour._SpecularColour._Blue;
                specEnd[i].x   = (float)_GradientSegments[i]._EndColour._SpecularColour._Red;
                specEnd[i].y   = (float)_GradientSegments[i]._EndColour._SpecularColour._Green;
                specEnd[i].z   = (float)_GradientSegments[i]._EndColour._SpecularColour._Blue;

                reflStart[i].x = (float)_GradientSegments[i]._StartColour._Reflectivity._Red;
                reflStart[i].y = (float)_GradientSegments[i]._StartColour._Reflectivity._Green;
                reflStart[i].z = (float)_GradientSegments[i]._StartColour._Reflectivity._Blue;
                reflEnd[i].x   = (float)_GradientSegments[i]._EndColour._Reflectivity._Red;
                reflEnd[i].y   = (float)_GradientSegments[i]._EndColour._Reflectivity._Green;
                reflEnd[i].z   = (float)_GradientSegments[i]._EndColour._Reflectivity._Blue;

                roughStart[i] = (float)_GradientSegments[i]._StartColour._Roughness;
                roughEnd[i]   = (float)_GradientSegments[i]._EndColour._Roughness;

                dlcStart[i] = (float)_GradientSegments[i]._StartColour._DiElectric;
                dlcEnd[i]   = (float)_GradientSegments[i]._EndColour._DiElectric;

                segStart[i] = (float)_GradientSegments[i]._StartX;
                segEnd[i]   = (float)_GradientSegments[i]._EndX;
            }

            shaderVars.Add("diffStart" + iteration.ToString(), diffStart);
            shaderVars.Add("diffEnd" + iteration.ToString(), diffEnd);
            shaderVars.Add("specStart" + iteration.ToString(), specStart);
            shaderVars.Add("specEnd" + iteration.ToString(), specEnd);
            shaderVars.Add("reflStart" + iteration.ToString(), reflStart);
            shaderVars.Add("reflEnd" + iteration.ToString(), reflEnd);
            shaderVars.Add("roughStart" + iteration.ToString(), roughStart);
            shaderVars.Add("roughEnd" + iteration.ToString(), roughEnd);
            shaderVars.Add("dlcStart" + iteration.ToString(), dlcStart);
            shaderVars.Add("dlcEnd" + iteration.ToString(), dlcEnd);
            shaderVars.Add("segStart" + iteration.ToString(), segStart);
            shaderVars.Add("segEnd" + iteration.ToString(), segEnd);
            shaderVars.Add("orbitType" + iteration.ToString(), GetOrbitTypeIndex());
            shaderVars.Add("multiplier" + iteration.ToString(), (float)_Multiplier);
            shaderVars.Add("offset" + iteration.ToString(), (float)_Offset);
            shaderVars.Add("segments" + iteration.ToString(), _GradientSegments.Count());
        }
Exemplo n.º 7
0
 public override void SetDeclarations(ref ShaderVariables shaderVars)
 {
     shaderVars.Add("fracFoldRadius" + _Iteration, _FoldRadius);
 }