push icon indicating copy to clipboard operation
push copied to clipboard

Push:finish() Shader Processing After window resize or fullscreen mode

Open jastonpainter opened this issue 6 years ago • 4 comments

Issue: When you resize the window and apply a table of shaders to push using the push:finish(shaders) the first shader in the table is offset on screen in the incorrect position. Subsequent shaders in the table are processed in the correct position.

Created a scenario where I have a shader create a circle at a predefined pos. I made a table of copies of this one shader object and passed it to push:finish(). First is offset, subseuqent are applied in the same position. Problem goes away if you return screen to original non-resized position.

Problem does not exist if you are not in full screen mode or the window has not be resized.

jastonpainter avatar Oct 12 '18 18:10 jastonpainter

due to the problem i have to apply all the shaders manually... and use old version of the push lib.

D0NM avatar Oct 26 '18 07:10 D0NM

Hello, sorry for the delay. I haven’t looked into this yet, but have you tried updating the screen dimensions inside your shader? Something such as shader:send(‘screen_dimensions’, { push:getWidth(), push:getHeight() })? I will try replicating the issue, but if you could provide a .love file that would greatly help me. Have a nice day :-)

Ulydev avatar Oct 26 '18 08:10 Ulydev

No worries, please see attached a full demo of the bug.

pushExample.zip

jastonpainter avatar Nov 02 '18 22:11 jastonpainter

Hello, sorry for the delay. I haven’t looked into this yet, but have you tried updating the screen dimensions inside your shader? Something such as shader:send(‘screen_dimensions’, { push:getWidth(), push:getHeight() })? I will try replicating the issue, but if you could provide a .love file that would greatly help me.

O changing the game mode, all the loaded into GPU shaders are erased. Most of my shaders do not need any "screen_dimensions" extra variables. E.g. I use shaders for my game characters' palette swap. Thus on each toggle Full Screen / Window modes I reload all the shaders again in my code.

I do not see it as a problem. I think it might be noted in the readme or something. I'm staying with a modded old version of push.

D0NM avatar May 22 '20 07:05 D0NM