defold
defold copied to clipboard
Option to set GLSL ES precision for the whole shader
Is your feature request related to a problem? Please describe (REQUIRED):
The GLSL ES spec does not define a default float precision for fragment shaders, so Defold have to specify it, and now it is mediump by default.
If you have a large fragment shader and want to use highp everywhere by default, then you have to bloat shader's source code by adding highp prefix everywhere.
Describe the solution you'd like (REQUIRED):
Defold's shader compiler should check for the line precision <PRECISIONHERE> float; in the shader's code to not add the line with the precision again, i.e. Defold adds precision mediump float into all fragment shaders.
Describe alternatives you've considered (REQUIRED): We had to add "highp" at almost every line.
hmm, It seems like we have this logic in the ShaderUtil code. Now I'm not sure if it's outdated issue or bug in this code
ah, ok. it seems like it is bug
With the new pipeline you can specify this in the shader, so I’m not sure this issue is needed any more :)
EDIT: I’ll close this once I’ve added the info to the manual on how to set it