Limitations of Light Sources in Viewport3D

本文介绍了WPF中的光照模型,并指出其与真实世界中的光线行为的不同之处。文章详细解释了WPF为了确保光照模型在包含多个光源的3D场景中仍能高效运行所做的简化措施。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(Quoted from Pro WPF in C# 2008, Second Edition, Matthew MacDonald)

Before you delve into WPF lighting, it’s important that you realize that the WPF lighting
model doesn’t behave like light in the real world. Although the WPF lighting system is constructed
to emulate the real world, calculating true light reflections is a processor-intensive
task. WPF makes use of a number of simplifications that ensure the lighting model is practical,
even in animated 3-D scenes with multiple light sources. These simplifications include the
following:
• Light effects are calculated for objects individually. Light reflected from one object will
not reflect off another object. Similarly, an object will not cast a shadow on another
object, no matter where it’s placed.
• Lighting is calculated at the vertexes of each triangle and then interpolated over the
surface of the triangle. (In other words, WPF determines the light strength at each corner
and blends that to fill in the triangle.) As a result of this design, objects that have
relatively few triangles may not be illuminated correctly. To achieve better lighting,
you’ll need to divide your shapes into hundreds or thousands of triangles.
Depending on the effect you’re trying to achieve, you may need to work around these
issues by combining multiple light sources, using different materials, and even adding extra
shapes. In fact, getting the precise result you want is part of the art of 3-D scene design.

 

转载于:https://www.cnblogs.com/frankh/archive/2009/04/20/1440010.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值