Shading a patch that is behind another one in the light direction
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!