Is there a way to tint a Mesh? Not material.
I have a lot of meshes sharing single material, but each of them should have own color.
Tinting the MeshSoftware: Away3D 4.x |
||
marronnier, Newbie
Posted: 13 May 2015 02:48 PM Total Posts: 17 |
||
Fabrice Closier, Administrator
Posted: 13 May 2015 04:26 PM Total Posts: 1265 [ # 1 ] you have 2 options: making more materials or have a TextureMaterial with squares of different colors and you offset/scale the meshes uvs accordingly. Giving a color to a mesh is actually what the ColorMaterial does. Underneath, the material holds 3x values 0-1 for each channel extracted from your hexadecimal color value and this constants are being used by the AGAL shader. Note that ColorMaterials are very light, so you can have a shit load of these without problems.
|
||
marronnier, Newbie
Posted: 14 May 2015 11:29 AM Total Posts: 17 [ # 2 ] Thanks Fabrice
|
||
Fabrice Closier, Administrator
Posted: 14 May 2015 11:36 AM Total Posts: 1265 [ # 3 ] yes well, you have more options like use the ColorMatrixMethod. Another one, economical and probably best if you have all black and white is to add and share a lightmap to mutiple colormaterials.
|
||
marronnier, Newbie
Posted: 14 May 2015 03:07 PM Total Posts: 17 [ # 4 ] * Using LightMapMethod on PlaneGeometry cause black background (may be I miss something? I haven’t used LightMap earlier) * As I understand, using ColorMatrixMethod or ColorTransform on material, I need to create a new TextureMaterial for each character, and have shared texture, normal & specular BitmapTextures.
//LightMapMethod PS: a very simple example in attachment. File Attachments coloring.zip (File Size: 13KB - Downloads: 205) |