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