changing alpha value of single mesh

Software: Away3D 4.x

seti3d, Newbie
Posted: 05 March 2013 02:19 PM   Total Posts: 19

Hi profs!
I’m using FlashDevelop with away3d 4.0.9 gold and Prefab 2.131.
With 3DS Max I created a helicopter with 8 tanks and exported it with the AWD exporter for Max.
Next step I imported it into Prefab3D and exported it in AWD2 format. The export file was copied to my assets folder of the flash project.

When nothing was changed with Prefab3D I am able to click on a button and the mesh named “Tank1” changed its alpha value.

But then I worked with Prefab3D and assigned one and the same material to every tank. I exported it again as AWD2 and started
my flash project.

And now - if clicking the button - Tank1 changed its alpha value. But also Tank2 and Tank3 and…
That means, if I use Prefab3D and assign the same material to different objects, it doesn’t matter which single mesh I want to change. All meshes will be changed. Is it a bug or wanted?? And is it a away3d-wanted or a Prefab-wanted??
Thanks for any hint.

   

Avatar
Fabrice Closier, Administrator
Posted: 05 March 2013 02:33 PM   Total Posts: 1265   [ # 1 ]

If you define one material, every changes you make affect all the meshes having this material. There is a duplicate material btn in material panel if you need it.
If you have a material with same maps, I would recommand share the texture and make materials reusing this texture. This is something that you will have to code as its not supported within Prefab.

   

seti3d, Newbie
Posted: 05 March 2013 02:49 PM   Total Posts: 19   [ # 2 ]

Thanks for your answer.
But in my eyes it makes no sense if I have lots of same objects which all have to have the same material - if I say I have to change a value of object1 that the value also changes for object2.

Example:
Small american village. You follow the street. Every house of that street looks equal - white with a black roof.
Now stopping in front of house3 you want to take a quick look through the wall. What happened? You have a look through all houses.
I guess that’s nothing anyone can use.

   

Avatar
Fabrice Closier, Administrator
Posted: 05 March 2013 04:40 PM   Total Posts: 1265   [ # 3 ]

The logic behind materials is directly linked to the way GPU’s like to have their data served. So I wouldn’t say it makes no sens.

I do not see where the problem is…
say you have one material for all your buildings, and one for the highlighted/selected buildings(no set). You simply swap the materials when you need a given mesh to have a the transparancy. Once you no longer need the highlight, simply set back the shared material.

   

seti3d, Newbie
Posted: 06 March 2013 07:14 AM   Total Posts: 19   [ # 4 ]

OH, now I understand!
I create one material which will have an alpha value 0.1
All stuff in my scene will have its own material. If I want to show a transparency I simply change the material of the object and not the alpha value of the mesh. That’s easy.
Thank you very much. You’re a star.

   

Avatar
Fabrice Closier, Administrator
Posted: 06 March 2013 10:51 AM   Total Posts: 1265   [ # 5 ]

eureka smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X