diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-10-29 13:56:01 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-10-29 13:56:01 +0100 |
| commit | 743e3b4692436fe4ab2312c22e4e7c19af0f29c3 (patch) | |
| tree | 1068c980e9ba182f36cd0aba8b128a6704614b23 /src/OpenGL/TexturedShader.cs | |
| parent | f31ffd683210c50b777dce4e76d0d9912ca925a8 (diff) | |
update shader base class and textured shader to reflect GGL class
changes
Diffstat (limited to 'src/OpenGL/TexturedShader.cs')
| -rw-r--r-- | src/OpenGL/TexturedShader.cs | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/src/OpenGL/TexturedShader.cs b/src/OpenGL/TexturedShader.cs index a410b16e..e62613d1 100644 --- a/src/OpenGL/TexturedShader.cs +++ b/src/OpenGL/TexturedShader.cs @@ -7,59 +7,36 @@ namespace go.GLBackend { public TexturedShader () { - vertSource = @" - #version 130 - - precision highp float; - - uniform mat4 projection_matrix; - uniform mat4 modelview_matrix; - - in vec2 in_position; - in vec2 in_tex; - out vec2 texCoord; - - - void main(void) - { - texCoord = in_tex; - gl_Position = projection_matrix * modelview_matrix * vec4(in_position,0, 1); - }"; fragSource = @" #version 130 precision highp float; - uniform vec4 color; uniform sampler2D tex; - uniform sampler2D stencil; in vec2 texCoord; out vec4 out_frag_color; void main(void) { -// vec4 s = texture( stencil, texCoord); -// if (s.r == 0) -// discard; - vec4 t = texture( tex, texCoord); - out_frag_color = t; + out_frag_color = texture( tex, texCoord); }"; Compile (); } - protected override void BindVertexAttributes () - { - base.BindVertexAttributes (); - GL.BindAttribLocation(pgmId, 1, "in_tex"); - } protected override void BindSamplesSlots () { - GL.Uniform1(GL.GetUniformLocation (pgmId, "tex"),0); + base.BindSamplesSlots (); + GL.Uniform1(GL.GetUniformLocation (pgmId, "stencil"),1); } + public override void Enable () + { + base.Enable (); + + } } } |