Esempio n. 1
0
 public void Render()
 {
     if (Disposed)
     {
         return;
     }
     if (_needUpdate)
     {
         lock (_updateLock)
         {
             _vertex?.DisposeAll();
             _vertex = _chunkVertexArrayProvider.ToElementArray().GetHandle();
             _chunkVertexArrayProvider = null;
             _needUpdate = false;
         }
     }
     lock (_renderLock)
     {
         if (_vertex == null || _shader == null)
         {
             return;
         }
         _textureDictionary.Bind();
         _shader.Use();
         _shader.Model      = Matrix4.Identity;
         _shader.Projection = _projectionMatrix.GetMatrix();
         _shader.View       = _viewMatrix.GetMatrix();
         _vertex.Bind();
         _vertex.Render();
     }
 }
Esempio n. 2
0
        public void Render()
        {
            _shader.Use();
            _shader.Color      = Color;
            _shader.Model      = Matrix4.CreateTranslation(Box.Min) * Matrix4.CreateScale(Box.Size);
            _shader.View       = _viewMatrix.GetMatrix();
            _shader.Projection = _projectionMatrix.GetMatrix();

            _eah.Bind();
            _eah.Render(OpenTK.Graphics.OpenGL4.PrimitiveType.Lines);
        }