Hello
I'm trying to erase parts of a render_target with a shader by setting the alpha to 0 but it's stay to 1 (255).
here is the fragment shader :
void main() {
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0 );
}
and here the sfml code :
_renderTarget.clear(sf::Color(0,0,0, 255 ));
_window.clear(sf::Color(255,255,255,255);
_renderTarget.draw(_sprite,&erasingShader);// a 32x32 sprite at mouse location
_renderTarget.display();
sf::Sprite tempSprite(_renderTarget.getTexture());
_window.draw(tempSprite, sf::BlendAlpha);
_window.display();
Am I missing something ? it should displays a white square but its all black;