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!