Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

WarpRipple Effect and other shaders using mediump degrade rapidly on iOS over time #3893

Closed tcmg closed 4 years ago

tcmg commented 4 years ago

Problem description

The shaders for various warp effects become distorted over time when run on the iOS web renderer. For example, when the game starts, the WarpRipple shader is silky smooth on iOS. After two minutes of the shader running, the frame rate of the shader degrades and shader's graphics become pixelated as well.

The degradation of the frame rate is independent of the frame rate of the rest of the engine.

This bug existed in Construct 2 as well and was reported previously here:

https://www.construct.net/en/forum/construct-2/bugs-21/warping-effect-degenerates-93217?kws=shader%2bprecision

I believe it was caused by shaders using mediump instead of highp (i.e. lower precision float for time).

Attach a .c3p

C3P file here:

https://www.dropbox.com/s/q8rhavzn2zh7qq1/warpShaderPrecisionBug.c3p?dl=0

Steps to reproduce

  1. Open the project. Run the project on an iOS device (tested on iPhone XS and iPad Pro 2019).
  2. Observe the shader effect is smooth.
  3. Wait 2 minutes.
  4. Observe the shader has degraded in quality significantly.

Observed result

The frame rate of the shader degrades and shader's graphics become pixelated as well.

IMG_0113

Expected result

The shader animmation should stay smooth.

IMG_0114

More details

Tested on iPhone XS and iPad Pro 2018. This bug was present in all versions of iOS and webkit renderers.

This bug does not occur on desktop browsers from what I can tell.

System details

See above for system details.

AshleyScirra commented 4 years ago

Thanks, you're right that it's a precision issue on some GPUs. Using high precision fixes it, so it should be fixed in the next release.