矩阵可以存在于除 AGAL 中的顶点常量之外的顶点寄存器上吗?
我见过的大多数示例都是将 Matrix3D 对象作为 AS3 中的顶点常量寄存器传递给 Context3D 对象。但从未在任何其他类型的寄存器中见过矩阵(临时或属性)。
是否有任何方法可以将矩阵顶点常量复制到临时寄存器,然后使用其他提供的值(顶点属性或其他常量)操作该矩阵临时寄存器的各个字段(例如:用于旋转)?
一个简单的 mov dest, source
操作就能解决问题吗?
I've mostly seen examples where a Matrix3D object is passed as a vertex constant register in AS3 to the Context3D object. But never seen a matrix in any other types of registers (temporary or attribute).
Would there be any way to copy a Matrix vertex constant to a temporary register, and then manipulate individual fields of that Matrix temporary register (ex:for the rotation), with other supplied values (vertex attributes or other constants)?
Could a simple mov dest, source
operation do the trick?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这有效(从鼹鼠那里得到它:))。只需确保复制足够的(3 或 4)个寄存器即可。考虑矩阵运算的一个好方法是,它们只是 3 或 4 点积指令的快捷方式。 AGAL 中实际上没有输入任何内容,矩阵只是几个连续的寄存器。矩阵上传功能只是为了方便一次调用上传到4个寄存器。在着色器中
m44 dest, src, srcmatrix
完全相同:
这里的 +1 等表示寄存器号 +1 等。
Yes, that works (take it from the Mole :)). Just make sure to copy enough (3 or 4) registers. Also a good way to think about matrix operations is that they are just a shortcut for 3 or 4 dot product instructions. There is really nothing typed in AGAL, a matrix is just a few consecutive registers. The matrix upload functions are only convenience for uploading to 4 registers in one call. And in the shader
m44 dest, src, srcmatrix
is the exact same as:
The +1 etc here means register number +1 etc.
我几乎可以肯定临时寄存器也包含矩阵,并且您的请求是可能的,但您可能会从像 Marco Scabia 这样的人那里得到最好的答案:
http://iflash3d.com/
他非常平易近人,而且对 AGAL 非常了解。
I'm almost certain temporary registers also contain Matrices and that your request is possible, but you may get your best answer from someone like Marco Scabia:
http://iflash3d.com/
He's very approachable and knowledgeable of AGAL.