Hello! Just started a new branch of my project to migrate to Away3D 4. And I faced some issues:
First of all, I have an object (Mesh) and I want to apply a transformation matrix to all of it’s vertices (on GPU). So I did the following: extended ShadingMethodBase and created my own simple shading method that should just affect vertex positions. Here is it’s AGAL code:
m44 <temp reg>, va0, <my matrix reg>
m44 op, <temp reg>, vc0
It’s pretty simple, but there is a problem: if my transformation matrix contains translation, and I move the object via object.x and object.y (my matrix stays the same), my object just dissapears at some point. If I don’t multiply vertex positons with my matrix, everything is fine. I’ve already checked camera.lens and so on, but no luck yet. Another important thing: I looked through the source of AGALProgram3DCache and found out that it already adds clipspace transformation (in the very beggining of each shader)... Why? If I want to compute vertex positions on GPU I may want to calculate resulting positions myself, without any dead code (like in my case). So maybe I’m missing something, but I haven’t found any better way to write vertex shaders (my project requires some heavy computations which better should be ran on GPU, it’s quite a common case for effects like water, particles, skeleton things an so on, I suppose). Any help or advise would be appreciated Thanks in advance