Tint color on shared materials

Software: Away3D 4.x

maitchison, Newbie
Posted: 15 April 2013 10:03 AM   Total Posts: 5

Hi,

I have around 100 objects all with identical geometry and unique materials. 

I found on the iPhone I was getting slow performance due to the 100 materials needing to be complied (they seem to compile as objects come into scene? which caused a jump).

Anyway way I thought I’d tidy things up a bit and have them share the same material (as their texture is the same).  However… what I realized is that with a shared material I have no way of ‘tinting’ or ‘coloring’ my objects uniquely.  This is something quite easy to do with starling, I was wondering if this is possible in Away3D as well?

I’m guessing what I’d need to do is to pass a constant to the fragment program with a color matrix, or a “add rgba” and a “mul rgba” vector.  But from what I can tell constants are linked to the material, and not the object being rendered?

Sorry if this is all a little complicated. 

TLDR Can I share materials across objects but uniquely tint them?

Thanks
-Matthew.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X