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

Problems in Safari iOS on mediump #25

Open
gregtatum opened this issue Sep 9, 2021 · 25 comments
Open

Problems in Safari iOS on mediump #25

gregtatum opened this issue Sep 9, 2021 · 25 comments

Comments

@gregtatum
Copy link

It seems like snoise(vec3) and maybe others are only working using precision highp float; on Safari in iOS. I spent a bit of time debugging some older shaders of mine that aren't working anymore and this appeared to fix it.

@gregtatum gregtatum changed the title Problems in iOS on mediump Problems in Safari iOS on mediump Sep 9, 2021
@gregtatum
Copy link
Author

This random codepen I found seems to exhibit the behavior: https://codepen.io/ykob/pen/qbwLaY

I'm not sure if it's the exact latest version of the shader in this repo.

Steps to reproduce:

@stegu
Copy link
Contributor

stegu commented Sep 9, 2021 via email

@tgrajewski
Copy link

The wiki page still says

NOTE: You do not need a super fast GPU to use these functions. They are useful even on low end hardware, old hardware and embedded OpenGL ES hardware with low performance.

suggesting that mediump would be supported, which is not true.

@stegu
Copy link
Contributor

stegu commented Mar 25, 2022 via email

@tgrajewski
Copy link

Thanks, would be great if mediump support would be stated plainly somewhere for this repository.
It's very hard to obtain noise/random functions that work with mediump well, if at all.

I'm working on games and targeting mostly mobile devices. From my experience even if a smartphone supports highp it is usually slower than mediump. Also there is still small percentage of devices not supporting highp in fragment shaders at all, but I don't collect details about this. Because of these issues, all my fragment shaders always use mediump.

@stegu
Copy link
Contributor

stegu commented Mar 26, 2022 via email

@tgrajewski
Copy link

tgrajewski commented Mar 26, 2022

Hey, awesome! Yes, I'm in :)

Here is a list of some devices that do not support highp at all in fragment shaders:

  • Huawei P8 Lite (ALE-L21)
  • Samsung Galaxy S5 mini (SM-G800F)
  • Samsung Galaxy S20 Pro
  • Samsung Galaxy J3 (SM-J320FN)
  • Samsung Galaxy S3 (GT-I9305)
  • Lenovo Tab 2 A7-10F

Unfortunately I don't own any of them, but I have some devices with mediump support, so I can test on those if needed. I'm using WebGL 1, but don't have data on int precision for now.

@stegu
Copy link
Contributor

stegu commented Mar 26, 2022 via email

@tgrajewski
Copy link

WebGL 2 is not good, too low adoption, it needs few more years.

Regarding float precision for mediump, then I think it's the 16-bit half/fixed size most common, yes.

@stegu
Copy link
Contributor

stegu commented Mar 27, 2022 via email

@stegu
Copy link
Contributor

stegu commented Mar 27, 2022 via email

@tgrajewski
Copy link

tgrajewski commented Mar 28, 2022

This is what I get for:

  • Samsung Galaxy A9 (2018) (SM-A920F)
  • Samsung Galaxy M51 (SM-M515F/DSN)
  • Samsung Galaxy A11
  • Samsung Galaxy S22
  • Vivo Y50
  • Xiaomi Redmi Note 7
  • Xiaomi Redmi Note 8
  • OnePlus 7
  • OnePlus 7T
  • Samsung Galaxy Tab 4
  • Samsung Galaxy Tab S4
  • Samsung Galaxy Tab S5e

samsung_galaxy_a9

  • Huawei P30 Lite
  • Samsung Galaxy S6 (SM-920F)
  • Samsung Galaxy A10
  • Samsung Galaxy A8
  • Samsung Galaxy A51
  • Samsung Galaxy S5
  • Samsung Galaxy J7 Prime
  • Samsung Galaxy Note 4
  • Oppo Reno 6
  • Vivo V21
  • Xiaomi Redmi Note 9
  • Moto G7 Play
  • Moto G9 Play
  • Google Pixel 6

huawei_p30_line

  • iPhone X (Safari v11)

image

  • iPhone 12 Pro (Safari v14.4)

image

  • Oppo Reno 3 Pro
  • Vivo Y21

oppo_reno_3_pro

  • Motorola Moto G 2nd Gen

image

@stegu
Copy link
Contributor

stegu commented Mar 28, 2022 via email

@stegu
Copy link
Contributor

stegu commented Mar 28, 2022 via email

@tgrajewski
Copy link

Main obstacle for WebGL 2 is older Safari on iOS devices. Yes, new Safari supports WebGL 2, but from my experience many people still use older Safari v10, v11, etc., without WebGL 2 support.

@stegu
Copy link
Contributor

stegu commented Mar 29, 2022 via email

@stegu
Copy link
Contributor

stegu commented Mar 29, 2022 via email

@tgrajewski
Copy link

I can do some benchmarks on the devices I have, but give me few days.

@stegu
Copy link
Contributor

stegu commented Mar 30, 2022 via email

@tgrajewski
Copy link

I've tested the page
https://stegu.github.io/psrdnoise/test/psrdnoise2-mediump.html
on my phone and below is screenshot how it looks and looks good! Rendering was constant 60 FPS.

mediump_noise

@stegu
Copy link
Contributor

stegu commented Mar 31, 2022 via email

@tgrajewski
Copy link

I again get 60 FPS on this updated benchmark on the same phone.

@stegu
Copy link
Contributor

stegu commented Apr 2, 2022 via email

@tgrajewski
Copy link

I get 25 FPS on my Galaxy A9 when I modify the canvas to be full screen.

I don't yet have use of simplex/perlin noise, but used white noise found somewhere on the Internet for some shaders.

@stegu
Copy link
Contributor

stegu commented Apr 11, 2022 via email

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