Shading a patch that is behind another one in the light direction

2 Ansichten (letzte 30 Tage)
Adina Stoica
Adina Stoica am 4 Jun. 2012
I am trying to make a lighting model on a set of leaves, and I am modeling the leaves as patches in Matlab. Unfortunately, when I have to 'leaves' behind each other, they both get lit, even if technically the one behind should be shaded (see image at https://dl.dropbox.com/u/43209398/Summer_Proj/results/shading.jpg). I've been trying to google this, but I couldn't find anything useful.
I am setting the light like this,
light('Position',lightPos,'Style','local');
The patches have, for now, these properties:
'FaceColor','green', 'EdgeColor', 'none',...,
'FaceLighting','phong',...
'SpecularExponent',1,...
'SpecularColorReflectance',0.2,'SpecularStrength',3,...
'FaceAlpha', 1,'AmbientStrength',0.0,...
'DiffuseStrength',0.0
Also, if I set 'FaceAlpha' to something smaller than 1 (eg 0.97), my images look completely different:
The results for the higher transparency level are closer to what I want, but the leaves still don't shade each other.
Any help would be appreciated. Thank you!

Antworten (0)

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by