Jump to content

Filters on mobile


Recommended Posts

Hello, fellow game makers!

Last day I was wrestling with PIXI's filters, or to be more precise, with applying filter to local coordinates of DisplayObject to make it scaling-consistent. 
So I got a smoke shader from the bottom of this tutorial and made it work at local coordinates of an object. I even adjusted frame and vTextureCoord for resolutions other than 1.
And look at this gorgeous pearl-like texture! It is even animated and looks so beautiful!


But alas, not on mobile...


This is Samsung A3 2016 with resolution 1280x720 and devicePixelRatio=2

I'm pretty sure that coordinates are correct and shader doesn't request anything other than coordinates.

PIXI.settings.FILTER_RESOLUTION and PIXI.settings.RESOLUTION are set to window.devicePixelRatio

Input textures have a right resolution and scaled back to fit object boundaries. 

But somehow results on mobile and desktop are inconsistent.
I have no idea how to approach this problem and I absolutely don't want to blindly adjust filter values with hope for it to work

This is working example. Please try it on your device and share results. Devices with resolutions other than 1 or 2 are very welcome!

I speak English and Russian. 
Please be welcome to contact me through Telegram: https://t.me/PastRecall

I really hope to use shaders for my personal project, so I hope there is a solution for this problem.
Thank you for reading and have a nice day!

Link to comment
Share on other sites

Thank you Ivan, you are magician! Everything working wonderful now
For anyone wondering, I added this lines at the top of fragment shader:

  precision highp float;
  precision mediump float;

Somehow my pc used highp even with implicit medump directive, but my phone was more obedient in this regard

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...