Flash 错误#3661:AGAL验证失败:临时寄存器索引超出范围
我有这个错误Flash 错误#3661:AGAL验证失败:临时寄存器索引超出范围,flash,stage3d,agal,Flash,Stage3d,Agal,我有这个错误 Error: Error #3661: AGAL validation failed: Temporary register index out of bounds for source operand 2 at token 5 of vertex program. 尝试转换此GLSL时: attribute vec3 aVertexPosition; uniform mat4 uMVMatrix; uniform mat4 uPMatrix; voi
Error: Error #3661: AGAL validation failed: Temporary register index out of bounds for source operand 2 at token 5 of vertex program.
尝试转换此GLSL时:
attribute vec3 aVertexPosition;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
}
根据本守则:
mov vt0.w, vc0.x
mov vt0.xyz, va0.xyz
mov vt1.xyzw, vc1
mul vt5.xyzw, vt1, vc5
m44 op.xyzw, vt0.xyzw, vt5
我怎样才能解决这个问题?有什么建议吗?谢谢 只有8个临时寄存器vt0-vt7。 您正试图在vt5中存储4x4矩阵,但之后只有两个寄存器:没有足够的空间 我建议您使用vt1来存储矩阵和接收矩阵乘法的内容:
mov vt0.w, vc0.x
mov vt0.xyz, va0.xyz
mov vt1, vc1
mul vt1, vt1, vc5
m44 op, vt0, vt1
唯一的问题是,我认为mul不会执行真正的矩阵乘法,而是执行分量乘法,m44执行4x4矩阵和4分量向量之间的乘法。从我所读到的,我不知道如何将两个矩阵相乘。您可能需要在actionscript中执行矩阵乘法。让我知道会发生什么