Gradient shader like flash’s gradient support

Software: Away3D 4.x

netphreak, Newbie
Posted: 08 October 2012 05:47 PM   Total Posts: 10

Hi, all!

Anyone got any source, examples, tutorials on making a gradient shader for Away3D 4?

Something like the flash gradient with color, ratio, alpha etc.?


Regards,

Netphreak

   

netphreak, Newbie
Posted: 09 October 2012 04:16 PM   Total Posts: 10   [ # 1 ]

Let me rephrase - what’s the correct way to create a gradient material/texture for a plane - mimicking the way the Flash 2D engine draws gradients?


Regards,
Netphreak

   

John Wilson, Member
Posted: 09 October 2012 04:28 PM   Total Posts: 62   [ # 2 ]

Hi

You can create a bitmap using standard AS3 code, then create a TextureMaterial from its bitmapData and assign as the material of your mesh.  Something like this:

var b:Bitmap theBitmapYouMade
var mat:TextureMaterial = new TextureMaterial(new BitmapTexture(b.bitmapData));
m.material mat

It works for me.

   

netphreak, Newbie
Posted: 09 October 2012 04:36 PM   Total Posts: 10   [ # 3 ]

Thanks for the suggestion wink

- but it is not very performant on tablets etc, when one wants to update the material on each enterframe.

- i’m looking for a performant solution, that can offer good fps etc.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X