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

조회 수: 2 (최근 30일)
Adina Stoica
Adina Stoica 2012년 6월 4일
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!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by