예제 #1
0
        public void   draw()
        {
            update();

            // if (_translucent && _renderingMode == Modes.Rendering.RENDER)
            //   _renderingMethods[1][1].draw(ref _models);

            FPS.resetLocal();
            FPS.beginGlobal();
            {
                _renderingMethods[(int)_renderingMode][_selectedRendering].draw();
            }
            FPS.endGlobalCPU();
            FPS.updateLocalForm();
#if CSG
            _multiFragmentRendering.csgDraw();
#endif
            drawBackgroundTexture();
        }
예제 #2
0
        public Scene(int w, int h)
        {
            _animationGUI           = new AnimationGUI();
            _meshAnimation          = new Mesh3DAnimationSequence();
            _multiFragmentRendering = new MultiFragmentRendering();

            _selectedTexture   = -1;
            _selectedRendering = 0;

            _gamma                = 1.0f;
            _pointSize            = 1.0f;
            _lineSize             = 1.0f;
            _width                = w;
            _height               = h;
            _backgroundColor      = Color.Gray;
            _useBackgroundTexture = false;

            _transparencyMode = Modes.Transparency.WEIGHT_SUM;
            _illuminationMode = Modes.Illumination.PHONG;
#if peel
            _renderingMode = Modes.Rendering.PEELING;
#else
            _renderingMode = Modes.Rendering.RENDER;
#endif
            _peelingMode  = Modes.Peeling.F2B;
            _trimmingMode = Modes.Trimming.TRIMLESS_STATIC_F2B;

            _camera = new Camera(_width, _height, Vector3.Zero, Vector3.Zero, Vector3.UnitZ, 0.0f);
            _light  = new Light(new Vector4(Vector3.Zero, 1.0f));

            for (int RenderingID = 0; RenderingID < 3; RenderingID++)
            {
                _renderingMethods[RenderingID] = new List <Rendering>();
            }

            FPS.init();
        }
예제 #3
0
        public void delete()
        {
            _meshAnimation.delete();

            _weightSumSimple.delete();
            _averageColors.delete();
#if peel
            _weightSumF2B.delete();
            _weightSumDUAL.delete();
#endif
            foreach (Texture tex in _textures)
            {
                tex.delete();
            }
            for (int j = 0; j < 3; j++)
            {
                foreach (Rendering ren in _renderingMethods[j])
                {
                    ren.delete();
                }
            }
            //Camera - Light
            _camera.delete();
            _light.delete();
            // Shaders
            _renderVertex.delete();
            _renderGeometry.delete();

            if (_tessellation)
            {
                _renderVertexTess.delete();
                _renderTessellationControl.delete();
                _renderTessellationEvaluation.delete();
            }
            _renderGeometryRegions.delete();
            _renderFragmentRegions.delete();

            _renderFragment.delete();
            _phongFragment.delete();
            _computePixelColor.delete();

            _aabb_chVertex.delete();
            _aabb_chFragment.delete();
            _aabb_chRendering.delete();

            _thickVertex.delete();
            _thickCompute.delete();
#if peel
            _thickCompute_f2b.delete();
            _thickComputing.delete();
            _thickComputing_f2b.delete();
            _thickCompute_dual.delete();
            _thickComputing_dual.delete();
            _thickCompute_k_buffer.delete();
            _thickComputing_k_buffer.delete();
            _thickCompute_k_multi_buffer_Z.delete();
            _thickComputing_k_multi_buffer_Z.delete();
#endif
            _multiFragmentRendering.delete();

            FPS.delete();
        }