Пример #1
0
 public void Prepare(TransparencyRenderer renderer)
 {
     if (instances.Count == 0)
     {
         return;
     }
     UpdateBuffer(instances.Count);
 }
Пример #2
0
 public void Prepare(TransparencyRenderer renderer)
 {
     if (triangles.Count == 0)
     {
         return;
     }
     WriteDataToBuffer();
 }
Пример #3
0
 public void DrawTransparent(TransparencyRenderer renderer)
 {
     if (triangles.Count == 0)
     {
         return;
     }
     DrawTriangles(renderer.graphics, parent.shader);
 }
Пример #4
0
        public void DrawTransparent(TransparencyRenderer renderer)
        {
            GL.UseProgram(shader);
            GL.BindVertexArray(vertexArray);
            Matrix4 mat = renderer.graphics.ViewMatrix;

            GL.UniformMatrix4(GL.GetUniformLocation(shader, "viewProjection"), false, ref mat);
            DrawGeometry();
        }
Пример #5
0
 public void DrawMask(TransparencyRenderer renderer)
 {
     if (triangles.Count == 0)
     {
         return;
     }
     GL.UseProgram(shader);
     renderer.SetUniforms(shader);
     DrawTriangles(renderer.graphics, shader);
 }
Пример #6
0
 public void DrawMask(TransparencyRenderer renderer)
 {
     if (instances.Count == 0)
     {
         return;
     }
     BeginDraw(renderer.graphics, false);
     renderer.SetUniforms(shader);
     GL.Disable(EnableCap.CullFace);
     GL.DrawArraysInstanced(PrimitiveType.TriangleStrip, 0, 4, instances.Count);
     GL.BindVertexArray(0);
 }
Пример #7
0
            public void DrawTransparent(TransparencyRenderer renderer)
            {
                if (instances.Count == 0)
                {
                    return;
                }
                GL.UseProgram(parent.shader);
                GL.BindVertexArray(vertexArray);
                Matrix4 mat = ignoreView ? Matrix4.Identity : renderer.graphics.ViewMatrix;

                GL.UniformMatrix4(parent.uniform_viewProjection, false, ref mat);

                GL.ActiveTexture(TextureUnit.Texture0);
                GL.BindTexture(TextureTarget.Texture2DArray, parent.texture);
                GL.Uniform1(uniform_sampler, (int)0);
                GL.Disable(EnableCap.CullFace);
                GL.DrawArraysInstanced(PrimitiveType.TriangleStrip, 0, 4, instances.Count);
                GL.BindVertexArray(0);
            }
Пример #8
0
 public void Prepare(TransparencyRenderer renderer)
 {
     UpdateBuffer(instances.Count);
 }