Shader scale to improve performance #10330
Unanswered
martindotburke
asked this question in
Q&A
Replies: 1 comment
-
I think I might have actually figured out a solution using a RenderTexture. https://jsfiddle.net/68zw3rLu/7/ So I make a small Sprite and set the filter on that. Create a RednerTexture the same size as the small Sprite. Create a larger Sprite, passing it that new RenderTexture. Then on each render loop, user the Pixi renderer to update the RederTexture from the small Sprite. Not sure if this is the best way to do it, but I'm definitely seeing an improvement on low end devices |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a shader/filter which runs great on most devices but really struggles with older devices. I was wondering perhaps it might be possible to scale down the Sprite which the filter is applied to, so the shader has fewer pixels to iterate over, then scale it back up to normal size. I expect this would come at a cost in quality, but that's fine.
Here's an example of what I'm trying to do...
https://jsfiddle.net/68zw3rLu/1/
So lets say, I set the scaleFactor to something like 0.25. I see the smaller sized sprite rendering as expected. I would like to somehow stretch this back to 100% without affecting the number of pixels the shader iterates. I've tried wrapping the Sprite in a Container, then scaling the Container to 400%, but the shader seems to be applied to the final Sprite scale (0.25 x 400 = 100%) so I'm left back where I began.
Beta Was this translation helpful? Give feedback.
All reactions