Aiv.Fast2D.Shader.SetUniform C# (CSharp) Метод

SetUniform() публичный Метод

public SetUniform ( string name, Matrix4 m ) : void
name string
m Matrix4
Результат void
        public void SetUniform(string name, Matrix4 m)
        {
            this.Use();
            int uid = this.GetUniform(name);
            GL.UniformMatrix4(uid, false, ref m);
        }

Same methods

Shader::SetUniform ( string name, System.Vector4 value ) : void
Shader::SetUniform ( string name, float n ) : void
Shader::SetUniform ( string name, int n ) : void

Usage Example

Пример #1
0
        public Mesh(Shader shader = null, int numberOfAxis = 2)
        {
            this.customBuffers = new Dictionary <int, VertexAttrib>();
            this.numberOfAxis  = numberOfAxis;

            // use VAO if possible
            this.vertexArrayId = Graphics.NewArray();
            if (this.vertexArrayId > -1)
            {
                this.Bind();
            }

            // vertex
            this.vBufferId = Graphics.NewBuffer();
            Graphics.MapBufferToArray(this.vBufferId, 0, numberOfAxis);

            // uv
            this.uvBufferId = Graphics.NewBuffer();
            Graphics.MapBufferToArray(this.uvBufferId, 1, 2);

            // vc
            this.vcBufferId = Graphics.NewBuffer();
            Graphics.MapBufferToArray(this.vcBufferId, 2, 4);

            if (shader == null)
            {
                shader = simpleShader;
                shader.SetUniform("tex", 0);
            }

            this.shader = shader;

            this.noMatrix          = false;
            this.hasVertexColors   = true;
            this.requireUseTexture = true;
        }
All Usage Examples Of Aiv.Fast2D.Shader::SetUniform