Search code examples
ioslibgdxglslshadertransparency

GLSL transparency issue only on iOS


I have a quite simple shader in my LibGDX application which is working perfectly on Windows 10, MacOS and on various Android devices, but everything is black on iOS (tested with two devices).

Is there a common "gotcha" which could explain this?

Solution:

I had to add the following at the top my fragment shader:

#ifdef GL_ES
  precision mediump float;
#endif

Now it's working everywhere.


Solution

  • If you or library doesn't check error returns it is common to get black screen without any visible reason because rendering context is silently failing. There is multiple reason that something might fail. Those mostly are caused by driver not supporting features that you are depending on. (features from newer GL version or unsupported extension) Other common case is partially missing rendering.