Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 4
0
 public override void Set(ShaderProgram program)
 {
     GL.ActiveTexture(Target);
     GL.BindTexture(TextureTarget.Texture2DArray, Texture);
     GL.Uniform1(program.GetUniformLocation(Name), Target - TextureUnit.Texture0);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 8
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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }