游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1207|回复: 0

FAQ-7 我将我的程序升级到DX9以后,硬件阴影贴图不能用了

[复制链接]

41

主题

184

帖子

184

积分

注册会员

Rank: 2

积分
184
发表于 2006-12-14 18:04:00 | 显示全部楼层 |阅读模式
我将我的程序升级到DX9以后,硬件阴影贴图不能用了,为什么?

DX8和DX9的硬件阴影贴图的接口发生了一些变化。在DX8中,我们需要根据位深对z分量进行缩放。从DX9开始,我们改变了接口的行为,从而不再需要手工变换深度值值,所以不管位深是多少,z值始终在0-1之间。基本上,我们想实现这个简单的接口,而不愿意影响旧的程序,所以只在DX9中实现了这个接口。

/*******************************************/

I upgraded my application to DirectX9 and my hardware shadow maps no longer work!  What's up?   

We've changed the behavior of hardware shadow maps between the DirectX8 and DirectX9 interfaces.  In DirectX8, you're required to scale the interpolated z component (that will be compared with the value in the shadow map) by the bit depth of the shadow map itself.  Starting with the DirectX9 interfaces, we've changed this behavior to no longer require this scale, so the z value should be in the range [0..1], regardless of bit depth.  Basically, we wanted to implement this new cleaner behavior, but didn't want to break shipping apps that rely on the old behavior, so we changed it only for the new DX9 interfaces.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 01:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表