I had a problem rendering with a shader for android due to the precision of the float numbers, so I wanted to add these precompilation instructions so that the floats are automatically `highp` if possible.
ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 1
ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 3
ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 4
My question is why? Because on the other examples I've seen on the forum it seems to work for everyone.
The version of OpenGL ES on the device that produces this error is 3.2 if that helps.
Last edited by Bigfoot71 on Sun Jan 22, 2023 3:48 pm, edited 1 time in total.
Does anyone have any idea about this problem? The only solution I could find is to specify `highp` on a case-by-case basis but this can be problematic on some devices, does anyone use the technique I showed or another?
Bigfoot71 wrote: ↑Thu Jan 12, 2023 3:29 pm
My question is why? Because on the other examples I've seen on the forum it seems to work for everyone.
I don't know about other examples on the forum but that won't work because love declares the effect function before your default precision line, so the declaration would use mediump and the definition would use highp which isn't allowed.
Bigfoot71 wrote: ↑Sun Jan 22, 2023 9:48 am
specify `highp` on a case-by-case basis but this can be problematic on some devices
If you're talking about very old devices which don't support highp in pixel shaders at all, you could use the preprocessor to use highp for those variables when it's available and use mediump otherwise.
love does that itself for some of its internal variables, and it has a LOVE_HIGHP_OR_MEDIUMP define to make it a bit simpler to use.
slime wrote: ↑Sun Jan 22, 2023 2:06 pm
If you're talking about very old devices which don't support highp in pixel shaders at all, you could use the preprocessor to use highp for those variables when it's available and use mediump otherwise.
love does that itself for some of its internal variables, and it has a LOVE_HIGHP_OR_MEDIUMP define to make it a bit simpler to use.
Or you could just not support those old devices for your game.
Thank you very much for this solution it is what I needed!
And yes I very well could have but I'm doing this for a game using g3d and I've taken the trouble to optimize it so it can run on an old tablet as well as newer hardware, last issue was on a "stupid" shader so I would have liked to do things completely
Besides, I did not find this information in the documentation of Löve, should it have been there? (here or here) (or maybe i searched wrong)
slime wrote: ↑Sun Jan 22, 2023 2:06 pm
I don't know about other examples on the forum but that won't work because love declares the effect function before your default precision line, so the declaration would use mediump and the definition would use highp which isn't allowed.
For the other examples I had been able to find on the forum using the example I showed here are two:
Bigfoot71 wrote: ↑Sun Jan 22, 2023 3:36 pm
For the other examples I had been able to find on the forum using the example I showed here are two:
Ah, those were using love 0.10 where it might have incidentally worked because some of love's internals were different - but it was never an officially supported thing.