Skip to content
New issue

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

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

Already on GitHub? # to your account

MaskedBatchRenderer requires 'highp' fragment shader precision #23

Open
cellcrowd opened this issue Jan 21, 2022 · 0 comments
Open

MaskedBatchRenderer requires 'highp' fragment shader precision #23

cellcrowd opened this issue Jan 21, 2022 · 0 comments

Comments

@cellcrowd
Copy link

cellcrowd commented Jan 21, 2022

Thanks for this repo! I'm having issues where some masked sprites won't render on Android. I narrowed this down to the default PIXI.settings.PRECISION_FRAGMENT value, which is 'mediump' on Android and 'highp' on iOS.

Setting PIXI.settings.PRECISION_FRAGMENT = 'highp' fixes the problem on Android, however I don't like risking crashes on older devices. Or rather re-introducing this render bug as I did notice in the Pixi source code it automatically degrades the precision if it is not available.

I could not wrap my head around the shader code itself, however seeing the arithmetic of determining the texture and mask ids, I tried lowering the MaskedPluginFactory.MAX_TEXTURES to 2, which seems to have fixed the rendering without the shader requiring 'highp' precision.

I was wondering if this 'fix' will sustain on all devices and if it affects batching performance, @ivanpopelyshev ?

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

No branches or pull requests

1 participant