Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Meelusyn

Pages: [1]
1
Graphics / Can't set lower alpha value
« on: August 19, 2020, 07:25:19 pm »
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;




Pages: [1]