Esempio n. 1
0
        private void InitialiseRenderer()
        {
            //  Initialise the scene.
            _ShaderRenderer = new ShaderRenderer();
            string frag = "";

            _Scene.Compile(_RaytracerOptions, _Scene._FractalSettings._RenderOptions, ref frag);
            _ShaderRenderer.Compile(_GL, frag, _RaytracerOptions.GetRaysPerPixel());
            int width, height;

            GetWidthHeightSelection(out width, out height);
            _ShaderRenderer.SetShaderVars(_Scene._Camera.GetViewMatrix(), _Scene._Camera.GetPosition(), _Scene._FractalSettings._RenderOptions.GetSunVec3(), _Scene._Camera, _Scene._FractalSettings);
            _ShaderRenderer.Initialise(_GL, width, height, _Scene._Camera.GetViewMatrix(), _Scene._Camera.GetPosition(), true);
            _ShaderRenderer.SetProgressive(_RaytracerOptions._Progressive, progressiveSteps);
            _ShaderRenderer.SetPostProcess(_PostProcess);
            _ShaderRenderer.Clean(_GL);
        }
        private void InitialiseRenderer()
        {
            _RaytracerOptions                 = new RaytracerOptions();
            _RaytracerOptions._DoFEnabled     = false;
            _RaytracerOptions._ShadowsEnabled = true;
            _RaytracerOptions._Reflections    = 1;

            _Scene = new Scene();
            _Scene._FractalSettings._FractalIterations.Clear();
            _Scene._FractalSettings._FractalColours.Clear();
            _Scene._FractalSettings._RenderOptions._Background = 1;
            FractalGradient preview = new FractalGradient();

            preview._GradientSegments[0]._StartColour = _Material;
            preview._Multiplier = 0.0f;
            _Scene._FractalSettings._FractalColours.Add(preview);
            _Scene._Camera._Position = new Vector3(0, 1.5, 1.5);
            _Scene._Camera._Target   = new Vector3(0, 1, 0);

            _PostProcess = new PostProcess();
//            _PostProcess._ToneMappingMode = 3;
            _PostProcess.Initialise(_GL);

            //  Initialise the scene.
            string frag = "";

            _Scene.Compile(_RaytracerOptions, _Scene._FractalSettings._RenderOptions, ref frag);

            _ShaderRenderer = new ShaderRenderer();
            _ShaderRenderer.Compile(_GL, frag, 16);

            int width, height;

            width  = (int)openGlCtrl.ActualWidth;
            height = (int)openGlCtrl.ActualHeight;
            _ShaderRenderer.Initialise(_GL, width, height, _Scene._Camera.GetViewMatrix(), _Scene._Camera.GetPosition(), false);
            _ShaderRenderer.SetShaderVars(_Scene._Camera.GetViewMatrix(), _Scene._Camera.GetPosition(), _Scene._FractalSettings._RenderOptions.GetSunVec3(), _Scene._Camera, _Scene._FractalSettings);
            _ShaderRenderer.SetProgressive(_RaytracerOptions._Progressive);
            _ShaderRenderer.SetPostProcess(_PostProcess);
            _ShaderRenderer.Clean(_GL);
            _ShaderRenderer.Start();
        }