error uniform.type == GL_SAMPLER_2D or GL_SAMPLER_CUBE after shader compile #2250
-
|
my fragment shader: i want realise a simple darkness effect, but I get an error from title of topic. This error from string 392 of "ProgramGL.cpp" file, and i see a hint "must be sampler: sampler2D or samplerCube". But i dont use a texture, just vertices, like the shader from the tests called "quadColor_fs", the structure of which i was guided by. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
|
You seem to have deleted lines from Try something like this: |
Beta Was this translation helpful? Give feedback.
-
|
I grabbed the info from #1279 and added it to the wiki here, since these shader questions seem to be coming up more often. |
Beta Was this translation helpful? Give feedback.

Here are the fixed shaders based on your project and the original fragment shader you posted, where I accidentally removed
v_position:vertext_shader.vsh:and
fragment_shader.fsh(with v_position re-added):