Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jastonpainter opened this issue Oct 12, 2018 · 4 comments

Comments

@jastonpainter
Copy link

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.

@D0NM
Copy link

D0NM commented Oct 26, 2018

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

@Ulydev
Copy link
Owner

Ulydev commented Oct 26, 2018

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 :-)

@jastonpainter
Copy link
Author

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

pushExample.zip

@D0NM
Copy link

D0NM commented May 22, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants