GPU/AGAL Vertex animation

Software: Away3D 4.x

pete shand, Newbie
Posted: 17 June 2013 07:48 AM   Total Posts: 21

Can anyone shed some light on the best way to animate vertex via AGAL within away3d? I’ve created a basic custom material and material pass (see attachment) which simply sets a flat color and enables you to set the following params:

offsetX, amplitudeX, frequencyX, offsetY, amplitudeY and frequencyY

This produces a wave effect in both the x and y/z axis which is what I’m after. The problem I’m facing is that I’m wanted combine this effect with already existing away3d materials so I can use textures, lighting, normals, methods, etc.

Is creating a whole new material and pass the best way to do this, or is there another way? could it be done with a method? or VertexAnimator? there doesn’t seem to be any documentation around this kind of thing :S

 

File Attachments
WaveColorMaterial.zip  (File Size: 3KB - Downloads: 294)
   

Avatar
GoroMatsumoto, Sr. Member
Posted: 17 June 2013 09:04 AM   Total Posts: 166   [ # 1 ]

Hi, pete.

Great work:)
I have tried to make a custom material that have vertex animation with these tutorials. It’s similar to your way.

Writing Custom Materials 1: Getting Started
Writing Custom Materials 2: Adding Textures
Writing Custom Materials 3: Simple Lighting

I have not tried the lighting yet.
Anyway, I wait next tutorial for adding methods.

Cheers.

 

   

pete shand, Newbie
Posted: 17 June 2013 10:49 AM   Total Posts: 21   [ # 2 ]

Hey

Yeah so those tuts are want I originally based my material and pass off, very helpful. But there must be a way to inject vertex animation AGAL without having to write a material from scratch. Or is that kind of functionality simply not supported in Away3d?

 

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 18 June 2013 09:34 AM   Total Posts: 166   [ # 3 ]

Hi,

I tried making it as a material method.
You can use normal, methods,
but lighting is wrong…

Maybe this is caused by a order of rendering pass.
I guess.

I attached the code of method.
Usage:

var _anim:VertexAnimationMethod = new VertexAnimationMethod(.05.2);
_material.addMethod(_anim); 

I wonder that I can make it as a Animator/AnimationSet.
But I don’t know about Away animation classes very well.

 

File Attachments
VertexAnimationMethod.as.zip  (File Size: 2KB - Downloads: 311)
   

pete shand, Newbie
Posted: 20 June 2013 06:28 AM   Total Posts: 21   [ # 4 ]

For anyone interested I’ve written a blog post outlining on what I’m trying to achieve and issues I’m facing with the AGAL vertex animation stuff. This includes an embedded swf and source code.
http://peteshand.net/blog/index.php/away3d-agal-vertex-animation/

 

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 20 June 2013 10:13 AM   Total Posts: 166   [ # 5 ]

@pete

Hi,

Nice article.
Maybe it’s a 1st post about Away3D’s custom vertex animation on internet : )

Did you see my code?
It have a problem of lighting.
Maybe I should distort normals too.
But I don’t know how to do that…
I attached my swf.
(It has the method with EnvMapMethod.)

If you have any hint, please tell me.
Thank you.

 

File Attachments
SimpleAwayTest.swf  (File Size: 1249KB - Downloads: 428)
   

pete shand, Newbie
Posted: 20 June 2013 11:49 PM   Total Posts: 21   [ # 6 ]

@GoroMatsumoto

Nice work on the twisting cube! did you make that with the method you posted earlier? I’m working on a Method as well, but haven’t managed to get environment map working with it, as it appears you have.

 

   

pete shand, Newbie
Posted: 21 June 2013 02:11 AM   Total Posts: 21   [ # 7 ]

Got a WaveEffect method applied to a Material with an Environment Map
http://peteshand.net/blog/index.php/away3d-agal-vertex-animation-part-2/

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X