Skip to content

FAQ: how about fill getProgramParameter ?

huangkui edited this page Feb 12, 2018 · 2 revisions

一个最常用的方法 gl.getProgramParameter(program,pnam),通过此方法寻找program中可用的attributes和uniforms,并进行赋值。 在kiwi.gl中,使用了kiwi.glsl预先处理shader文本,寻找出actived attribute和uniform,一般来说attribute的命名比较简单,但是unfiromLocation是对象,这层性质导致glsl中声明unfirom对象的时候更加灵活,故在attribute我做了严格的匹配,按照location的顺序返回对象地址,但是unfirom使用了增补方式,一旦unform也能被完整解析出来,我会修改此部分,即不再提供增补uniformLocation。

Clone this wiki locally