I am trying to achieve an effect with layered materials that I hope is
possible with away3D. The issue is with having different levels of
specular highlights on each layer of the composite material. The first
layer consists of a PhongBitmapMaterial instance with an fully opaque
image, and its specular value set to 0. The second layer consists of
another PhongBitmapMaterial instance with a semi transparent image
with its specular level > 0. There is a directional light in the scene
as well.

When I rotate the object the specular highlight of the topmost
material seems to get applied to the layer underneath, even in places
where the topmost bitmap is fully transparent. If I disable the
topmost layer the object renders correctly with no specular highlight.
What I was hoping for is that the specular highlight would only draw
into the semi-transparent and opaque areas of the topmost layer with
transparent areas receiving no specular. This is essential for the
effect I am trying to achieve–the topmost material is gold leaf (quite
shiny) and the bottom material is old leather (not shiny).

Does the engine support this type of masking of specular highlights? I
haven't looked at the source code for the renderer itself, but it
doesn't seem like it would be too hard to add this. It could be
accomplished using a bitmap that could be applied to each material
layer to specify where the specular should be visible–black = no
specular, grey = scaled specular (greyscale value * specular value),
white = full specular. As I envision it, I don't see it requiring a
huge amount of processing power–it is similar to an effect I used in
another project with bitmaps in Flash–but I could be wrong. If it
isn't supported, and I want to try to tackle it, how do I go about
contributing code?

If it helps, I can upload a SWF to illustrate what I am trying to
accomplish.

Thanks for the great engine, and your help!

d

Reply via email to