1
Graphics / Re: Can't set lower alpha value
« on: August 20, 2020, 12:40:36 am »
Thanks, i didn't know shader wasn't replacing blendmodes;
I put sf::BlendNone instead of the shader and it works, but i am using a shader because i want not to erase all the square of the sprite(i have simplified the code for looking what i was doing wrong);
but when i do
(when it will works i will put the renderStates as member instead of recreating it each draw call i suppose it would be better ? but here it just for the test)
also i have seen we could use vertex array instead of sprite now, thats great.
Edit : with a renderState outside the calldraw its work
I put sf::BlendNone instead of the shader and it works, but i am using a shader because i want not to erase all the square of the sprite(i have simplified the code for looking what i was doing wrong);
but when i do
draw(sprite, sf::RenderStates(sf::BlendNone, sprite.getTransform(), sprite.getTexture(), &erasingShader));
it still doesn't work(when it will works i will put the renderStates as member instead of recreating it each draw call i suppose it would be better ? but here it just for the test)
also i have seen we could use vertex array instead of sprite now, thats great.
Edit : with a renderState outside the calldraw its work