Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

有谁遇到过cocos2dx-lua shader setUniformLocationF32 无效问题

$
0
0

@jesson55 写道:

glProgram:use()
glProgram:setUniformsForBuiltins()
local uniformCenter = gl.getUniformLocation(glProgram:getProgram(), "center")
glProgram:setUniformLocationF32(uniformCenter, 100.2, 20.2)

这个设置没有任何效果

vsh 代码

attribute vec4 a_position;
attribute vec2 a_texCoord;

ifdef GL_ES

varying mediump vec2 v_texCoord;

else

varying vec2 v_texCoord;

endif

uniform vec2 center;

void main()
{
mat4 bworld = mat4(1.0, 0.0, 0.0, 0.0,0.0, 1.0, 0.0, 0.0,0.0, 0.0, 1.0, 0.0,0.0, 0.0, 0.0, 1.0);
vec4 position1 = CC_PMatrix * a_position;
position1.x += center.x;
position1.y += center.y;
gl_Position = position1*bworld ;
v_texCoord = a_texCoord;
}

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>