I have log with shader

I have log with shader I want to know what is the problem When I open grade shader glslp give me this error

[Shader driver]: Using GLSL shader backend.

[GLSL]: Found GLSL vertex shader.

[GLSL]: Found GLSL fragment shader.

[GLSL]: Linking GLSL program.

[GLSL]: Found GLSL vertex shader.

[GLSL]: Using GLSL version 300 es.

[GLSL]: Found GLSL fragment shader.

[GLSL]: Using GLSL version 300 es.

Shader log: 3:160: S0032: no default precision defined for variable ‘FragColor’

Failed to compile fragment shader #0

Failed to link program #0.

Failed to create GL program #0.

[GL]: Stock GLSL shaders will be used.

[GLSL]: Found GLSL vertex shader.

[GLSL]: Found GLSL fragment shader.

[GLSL]: Linking GLSL program.

[GLSL]: Found GLSL fragment shader.

[GLSL]: Linking GLSL program.

[GLSL]: Found GLSL vertex shader.

[GLSL]: Found GLSL fragment shader.

[GLSL]: Linking GLSL program.

[GL]: Failed to set multipass shader.

Falling back to stock.

You didn’t say which shader you were trying to use (or if you are developing your own). However…

The no default precision defined for variable ‘FragColor’ error indicates the problem.

In OpenGL ES you either need to specify the precision of each variable or a default precision to be used when you don’t otherwise specify a precision. You can most easily do the latter by putting

#ifdef GL_ES
precision mediump float;
#endif

near the beginning of your .glsl file before any variables are defined.

2 Likes

Thank you very much for reply.I want to using grade shader in misc but It’s give me that error , I am not developer Could you explain what I do on Android?

That’s here

I’m no developer either, but your log accuses the error in line 160, while the code provided by dave_j appears only after line 167. So, maybe you could move that block of code to before the line 160.

1 Like

Thank you for your help me I will try I hope it work

Try to move the block between lines 167 and 176 to before line 157. See if that fixes it.

If not, only a shader creator coming here could help you.

1 Like

Ok I will trying this now You are the the best thank you a lot

Update- it works but give me black screen I think that shader unsupport andriod , now I will wait update fix this problem Sorry for my bad English

It may be unsupported. To my knowledge, some shaders are not perfectly ported, whereas others can’t be ported at all. The lead development in shaders is made on the slang ones, so stick to those if you can. Try changing your video driver to vulkan (or glcore) and check if the slang shaders work fine for you.

1 Like