Ok so I experimented with the idea a bit. I modified my fragment shader to accept 2 textures. The second texture has some parts that are transparent and will be applied as a decal on top of the first texture:
uniform sampler2D texture;
uniform sampler2D texture2;
void main()
{
vec4 color1 = texture2D(texture, gl_TexCoord[0].st);
vec4 color2 = texture2D(texture2, gl_TexCoord[0].st);
vec3 temp = mix(color1.rgb, color2.rgb, color2.a);
gl_FragColor = vec4(temp, 1) * gl_Color;
}
And here is my updated shader initialization code:
// Load the shadershader
= new Shader
("basic.vert",
"basic.frag");shader
.SetParameter("texture", Shader
.CurrentTexture);shader
.SetParameter("texture2", texture2
);RenderStates states
= new RenderStates
();states
.Texture = texture
;states
.Shader = shader
; It works! So I guess as long as I use "Shader.CurrentTexture" for my first texture, there won't be any problems with regards to texture coordinates introduced by Text rendering (and possibly other SFML built in drawables). This means I can now go wild in the fragment shader.
Thanks Laurent for a very very fascinating library! A special thank you too for continually updating the .NET bindings! Keep up the excellent work!