使用顶点着色器在 MoleHill 中变形
使用 Molehill 和 Flash 我希望创建一个顶点着色器,将一个网格变换为另一个网格,我已经看到可以使用 Flare,但是我不确定是否使用 Stage3D, 任何人都可以给我在 AGAL 中使用着色器的任何指示,以了解如何完成此操作。 谢谢
Using the Molehill with Flash I wish to create a vertiex shader, to have one mesh transform into another, I have seen that it is possible with Flare, However I am unsure if that was using Stage3D,
Can anyone give me any pointers in the use of shaders in AGAL as to how this might be done.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(也许太晚了)
变形“简单地”是两组位置之间的线性插值。
假设您有第一个顶点缓冲区 VA0 代表起点,第二个顶点缓冲区 VA1 代表目的地。你可以将它们存储在临时寄存器中:
然后你需要一个 T 值,你可以将其作为常量传递,如下所示:
如果你传递类似于
0<=T<=1 的内容作为常量并将其放在 id 0 处,则以下代码会将输出位置从起始位置转换(线性插值)到结束位置。
那么你需要投影 VT0 以获得正确的输出。
(maybe too late)
a morphing is "simply" a linear interpolation between 2 sets of positions.
assuming you have a first vertexBuffer VA0 representing the origins and a second vertexbuffer VA1 representing your destinations. you can store them in temporary registers:
then you'll need a T value that you can pass as a constant like this:
if you pass something like
with 0<=T<=1 as the constant and put it at id 0, the following code will transform (linearly inpterpolate) the output positions from the starting position to the end position.
then you need to project VT0 to get the correct output.
Pixel Bender 的下一版本应该支持创建 3D 顶点和片段着色器。预览版应该在此处提供
The next version of pixel bender should support creating both 3d vertex and fragment shaders. A preview release should be available here