AGAL component-wise usage questions

Software: Away3D 4.x

Stephen Hopkins, Sr. Member
Posted: 12 August 2011 12:55 AM   Total Posts: 110

does anyone have any experience /knowledge doing component wise operations?

mul ft0, ft6.x, fc0.x

Does this put the result into ft0.r, .g, .b, .a? Code like this compiles, but I’m not sure what it does.

 Signature 

http://www-scf.usc.edu/~shopkins

   

Avatar
Alexander Seifert, Moderator
Posted: 12 August 2011 08:03 AM   Total Posts: 129   [ # 1 ]

You are correct,
mul ft0, ft6.x, fc0.x
is the same as
mul ft0.xyzw, ft6.x, fc0.x
(or mul ft0.rgba, ft6.x, fc0.x)

Shader languages typically allow any kind of component access and they will always compile gracefully.

E.g,
mul ft0.xy, ft6.xx, fc0.yz
is equivalent to
ft0.x = ft6.x * fc0.y; ft0.y = ft6.x * fc0.z

(Please correct me if I’m wrong raspberry )
Cheers!
Alex

 Signature 
signature_image

http://www.deltastrike.org

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X