Depth Bias(Direct3D 9)
来源:互联网 发布:java int转时间格式 编辑:程序博客网 时间:2024/05/22 04:26
Depth Bias (Direct3D 9)
Polygons that are coplanar inyour 3D space can be made to appear as if they are not coplanar byadding a z-bias to each one. This is a technique commonly used toensure that shadows in a scene are displayed properly. For instance, ashadow on a wall will likely have the same depth value as the walldoes. If you render the wall first and then the shadow, the shadowmight not be visible, or depth artifacts might be visible. You canreverse the order in which you render the coplanar objects in hopes ofreversing the effect, but depth artifacts are still likely.
Anapplication can help ensure that coplanar polygons are renderedproperly by adding a bias to the z-values that the system uses whenrendering the sets of coplanar polygons. To add a z-bias to a set ofpolygons, call the IDirect3DDevice9::SetRenderState method just before rendering them, setting the Stateparameter to D3DRS_DEPTHBIAS, and the Value parameter to a valuebetween 0-16 inclusive. A higher z-bias value increases the likelihoodthat the polygons you render will be visible when displayed with othercoplanar polygons.
Offset = m * D3DRS_SLOPESCALEDEPTHBIAS + D3DRS_DEPTHBIAS
where m is the maximum depth slope of the triangle being rendered.
m = max(abs(delta z / delta x), abs(delta z / delta y))
The units for the D3DRS_DEPTHBIAS andD3DRS_SLOPESCALEDEPTHBIAS render states depend on whether z-bufferingor w-buffering is enabled. The application must provide suitable values.
Thebias is not applied to any line and point primitive. However, this biasneeds to be applied to triangles drawn in wireframe mode.
// RenderStates
D3DRS_SLOPESCALEDEPTHBIAS, // Defaults to zero
D3DRS_DEPTHBIAS, // Defaults to zero
// Caps
D3DPRASTERCAPS_DEPTHBIAS
D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
- Depth Bias(Direct3D 9)
- Depth Bias(Direct3D 9) Alternatives to Using Z-Bias to Fix Z-Fighting Issues
- Depth Bias
- Depth Bias
- Depth Bias AMD Sample
- DirectX深度偏移(depth bias)
- Z - Fighting 和 Depth-bias
- depth bias的妙用:线框&描线
- Depth Bias 以及 Ogre材质中的depth_bias
- [Direct3D] Surfaces (Direct3D 9)
- Direct3D Surfaces (Direct3D 9)
- bias
- Direct3D 9,Direct3D 10,Direct3D 11渲染流水线
- Accurately Profiling Direct3D API Calls (Direct3D 9)
- Direct3D 9 硬件相关
- Queries (Direct3D 9)
- PRT Equations (Direct3D 9)
- Using UVAtlas (Direct3D 9)
- 又是两年
- UVA 10525
- 对网上流传的各个VS2005 Team Suite版比较及个人安装体会
- JasperReport初级教程(2.0.3)图文详解
- JSP常用指令
- Depth Bias(Direct3D 9)
- 222
- Depth Bias AMD Sample
- Depth Bias(Direct3D 9) Alternatives to Using Z-Bias to Fix Z-Fighting Issues
- 失业了...唉
- win2003 server 定时自动重启命令 不要第三方软件
- 深夜,豁然开朗
- Linux 系统中的超级权限的控制
- 理解/etc/sudoers配置文件的格式