Can't set uniform value in OpenGL shader

前端 未结 1 1125
别那么骄傲
别那么骄傲 2021-01-21 07:14

I am currently learning OpenGL programming, and I have made some good progress, but I seem to be stuck now.

Currently, I am trying to get simple shaders to work. To be m

相关标签:
1条回答
  • 2021-01-21 07:36

    Are you calling glUseProgram before setting the uniforms ? A full working listing can be found in many examples online, including what I had written sometime back (https://github.com/prabindh/sgxperf/blob/master/sgxperf_gles20_vg.cpp) that shows the sequence to be:

    glCreateProgram();

    glAttachShader()

    glLinkProgram

    glUseProgram()

    glGetUniformLocation()

    glUniformMatrix4fv

    0 讨论(0)
提交回复
热议问题