M
M
Mr_Vitas2021-05-07 16:45:55
Android
Mr_Vitas, 2021-05-07 16:45:55

How to change the precision in fragment shaders?

The problem is very strange.
Wrote a shader, tested it. It works on both the emulator and my device.
I threw a protest to a friend, but his shader does not work correctly. There are no compilation errors and no shaders binding.

Specifically, the problem is that on some Android devices, precision does not change, but remains by default.

For some reason this line of code doesn't work.

//glsl (fragment shader)
precision highp float;

I thought the problem was in the firewood, but the system update was recent.

Also, this design does not work for me:
#version 100
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

Although it works on webGL.

Thanks in advance for any help [^-^]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2021-05-07
@gbg

But no way. You should not sculpt highp in the texture shader - it slows down the performance. highp makes sense in the vertex shader.
If your code does not work without this, you are most likely doing something wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question