Exemple #1
0
 /// <summary>
 /// Binds the uniform's <see cref="Texture"/> to the specified <see cref="TextureUnit"/> for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     // for explanation on how textures are set, review: http://www.opentk.com/node/2559
     GL.ActiveTexture(this.Target);
     GL.BindTexture(TextureTarget.Texture2D, this.Texture);
     GL.Uniform1(program.GetUniformLocation(this.name), this.Target - TextureUnit.Texture0);
 }
Exemple #2
0
 /// <summary>
 /// Sets the <see cref="Vector3"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform3(program.GetUniformLocation(this.name), this.Vector);
 }
Exemple #3
0
 /// <summary>
 /// Sets the <see cref="Matrix4"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 override public void Set(ShaderProgram program)
 {
     GL.UniformMatrix4(program.GetUniformLocation(this.name), false, ref this.Matrix);
 }
Exemple #4
0
 public override void Set(ShaderProgram program)
 {
     GL.ActiveTexture(Target);
     GL.BindTexture(TextureTarget.Texture2DArray, Texture);
     GL.Uniform1(program.GetUniformLocation(Name), Target - TextureUnit.Texture0);
 }
Exemple #5
0
 /// <summary>
 /// Sets the <see cref="Color"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform4(program.GetUniformLocation(this.name), this.Color.AsRGBAVector);
 }
Exemple #6
0
 /// <summary>
 /// Sets the <see cref="float"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform1(program.GetUniformLocation(this.name), this.Float);
 }
Exemple #7
0
 /// <summary>
 /// Sets the <see cref="Matrix4"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 override public void Set(ShaderProgram program)
 {
     GL.UniformMatrix4(program.GetUniformLocation(this.name), false, ref this.Matrix);
 }
 /// <summary>
 /// Sets the <see cref="Vector3"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform3(program.GetUniformLocation(this.name), this.Vector);
 }
Exemple #9
0
 /// <summary>
 /// Sets the <see cref="Color"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform4(program.GetUniformLocation(this.name), this.Color.AsRGBAVector);
 }
Exemple #10
0
 /// <summary>
 /// Sets the <see cref="float"/> uniform for a shader program. Is called before the draw call.
 /// </summary>
 /// <param name="program">The program.</param>
 public override void Set(ShaderProgram program)
 {
     GL.Uniform1(program.GetUniformLocation(this.name), this.Float);
 }