Search Unity

Differentiating between mobile and WebGL

Discussion in 'Shaders' started by Justafin, Oct 24, 2016.

  1. Justafin

    Justafin

    Joined:
    Aug 6, 2012
    Posts:
    30
    Searching for a way to differentiate between GLES2 mobile and GLES2 WebGL in my shaders so that I can treat them as different quality levels. In Unity 5.3 they had a pre-processor macro called UNITY_53_SPECIFIC_TARGET_WEBGL that handled this. With 5.4 this has gone away and they are setting all the Standard Shader quality settings through the editor when switching build targets. The pre-processor macro SHADER_API_GLES wont work since that gets triggered for both mobile and WebGL. Any ideas?
     
    Kronnect likes this.
  2. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,904
    Also SHADER_API_GLES is not set within Unity Editor, so there's no way to detect WebGL build in shaders.