Exemplo n.º 1
0
        public void Compile()
        {
            _Clean = true; // indicate to the OpenGL draw loop that it needs to clean the backbuffer

            string frag = "";

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

            SaveStatus();

            _ShaderRenderer.SetShaderVars(_Scene._Camera.GetViewMatrix(), _Scene._Camera.GetPosition(), _Scene._FractalSettings._RenderOptions.GetSunVec3(), _Scene._Camera, _Scene._FractalSettings);
            TriggerPreview();

            _Dirty = false;
        }
Exemplo n.º 2
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);
        }