Ejemplo n.º 1
0
        /// <summary>
        /// lasketaan objektien paikka ja lisätään näkyvät objektit listoihin, sitten renderoidaan näkyvät.
        /// </summary>
        public virtual void Render()
        {
            Frustum.CalculateFrustum();

            visibleObjects.Clear();
            transparentObjects.Clear();

            GLExt.PushMatrix();

            // lasketaan kaikkien objektien paikat valmiiksi.
            // näkyvät objektit asetetaan visible ja transparent listoihin
            CalculatePositions();

            // renderointi
            foreach (Renderable o in visibleObjects)
            {
                o.RenderModel();
            }
            foreach (SortedList_Model o in transparentObjects)
            {
                Model m = o.model;
                m.RenderModel();
            }
            Texture.UnBind(Settings.COLOR_TEXUNIT);
            GLExt.PopMatrix();
        }
Ejemplo n.º 2
0
Archivo: FBO.cs Proyecto: Keilerr/csat
 public void UnBindColorBuffer(int textureUnit)
 {
     if (IsSupported == false)
     {
         return;
     }
     Texture.UnBind(textureUnit);
 }
Ejemplo n.º 3
0
Archivo: FBO.cs Proyecto: Keilerr/csat
 public void UnBindDepth()
 {
     if (IsSupported == false)
     {
         return;
     }
     Texture.UnBind(Settings.DEPTH_TEXUNIT);
 }
Ejemplo n.º 4
0
 void Loading()
 {
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     try
     {
         BitmapFont font = BitmapFont.Load("fonts/comic12.png");
         Texture.UnBind(0);
         Camera.Set2D();
         font.Write("Loading...", 0, 0);
         font.Dispose();
         Texture.UnBind(0);
     }
     catch (Exception) { }
     SwapBuffers();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// renderoidaan näkyvät objektit listoista jotka Render() metodi on luonut.
        /// </summary>
        public void RenderAgain()
        {
            GLExt.PushMatrix();

            // renderointi
            foreach (Renderable o in visibleObjects)
            {
                o.RenderModel();
            }
            foreach (SortedList_Model o in transparentObjects)
            {
                Model m = o.model;
                m.RenderModel();
            }
            Texture.UnBind(Settings.COLOR_TEXUNIT);
            GLExt.PopMatrix();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// putsaa listat ja poista gl-datat
        /// </summary>
        public void ClearArrays()
        {
            Texture.DisposeAll();
            GLSLShader.DisposeAll();
            Material.DisposeAll();
            Particles.DisposeAll();

            Light.Lights.Clear();
            Path.Paths.Clear();

            world            = null;
            world            = new Renderable("World");
            Node.ObjectCount = 0;
            for (int q = 0; q < Texture.MaxTextures; q++)
            {
                Texture.UnBind(q);
            }
            GLSLShader.UnBindShader();

            GLSLShader.SetShader("default.shader", "");

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Ejemplo n.º 7
0
 public static void UnBindLightMask()
 {
     Texture.UnBind(Settings.LIGHTMASK_TEXUNIT);
 }