1
Graphics / BlendMode and RenderTexture not updating
« on: March 17, 2016, 09:49:44 am »
Hello, trying to get additive blendmode to work with a lighting system.
Which works of course. Problem for me however, lights will always be "on top" of the screen at all times.
So if I use two framebuffers by adding all lights, then blocking lights to the first, then drawing it to the second buffer, I can achieve my affect.
Which works, except I get this glitch/artifact?

My best explanation, its like the scene isn't clearing when I call .clear(); Even though I clearly am.
If none of the lights move, it works.
Min. working code example:
If I add a rectangleshape with black, and draw it after .clear, it works. But it defeats the whole purpose of clear and also breaks my light blocking sprites.
Anyone know why this is happening? Spent too much time on something so trivial. Don't really want to settle for static lights either.
Thanks.
Which works of course. Problem for me however, lights will always be "on top" of the screen at all times.
So if I use two framebuffers by adding all lights, then blocking lights to the first, then drawing it to the second buffer, I can achieve my affect.
Which works, except I get this glitch/artifact?

My best explanation, its like the scene isn't clearing when I call .clear(); Even though I clearly am.
If none of the lights move, it works.
Min. working code example:
(click to show/hide)
If I add a rectangleshape with black, and draw it after .clear, it works. But it defeats the whole purpose of clear and also breaks my light blocking sprites.
Anyone know why this is happening? Spent too much time on something so trivial. Don't really want to settle for static lights either.
Thanks.