5
我有一個具有以下屬性的片段着色器:glGetUniformLocation返回-1的OpenGL ES(iPhone)
varying highp vec2 coordinate;
precision mediump float;
uniform sampler2D videoframe;
uniform sampler2D videosprite;
uniform vec4 mask;
uniform float threshold;
我得到他們的位置,後來設置它們:
_frame = glGetUniformLocation(_program, "videoframe");
_sprite = glGetUniformLocation(_program, "videosprite");
_mask = glGetUniformLocation(_program, "mask");
_threshold = glGetUniformLocation(_program, "threshold");
NSLog(@"%i %i %i %i", _frame, _sprite, _mask, _threshold);
但是,日誌揭示:0 2 1 -1
從文檔,我看到-1(門檻統一)意味着它失敗。爲什麼失敗? 謝謝
哇...即使我知道這一點,謝謝你的提醒。這是問題... – 0xSina 2012-03-22 18:31:44