GLSL Shader will not render color from uniform variable

前端 未结 2 1253
猫巷女王i
猫巷女王i 2021-01-14 07:52

I am currently building an app for Android, but have run into some problems with a shader that refuses to render.

Consider the following fragment shader:



        
2条回答
  •  有刺的猬
    2021-01-14 08:21

    Ok, so I finally figured it out after a load of testing.
    In my code, I was using multiple shaders, but I had accidentally only got the mvpMatrix-uniform for one shader and was using that one for every shader, which funnily enough worked for all shaders I had before creating this one (it got id 0 for all the earlier shaders).
    However with this shader it seems that my new vec4 got id 0, which caused the code to wrongly assign my vector data to the mvp-matrix. getting new ids for each shader made the program work.

提交回复
热议问题