z-fighting
来源:互联网 发布:windows文件夹加密软件 编辑:程序博客网 时间:2024/04/30 16:00
https://en.wikipedia.org/wiki/Z-fighting
Z-fighting is a phenomenon in 3D rendering that occurs when two or more primitives have similar values in the z-buffer. It is particularly prevalent with coplanar polygons, where two faces occupy essentially the same space, with neither in front. Affected pixels are rendered withfragments from one polygon or the other arbitrarily, in a manner determined by the precision of the z-buffer. It can also vary as the scene or camera is changed, causing one polygon to "win" the z test, then another, and so on. The overall effect is a flickering, noisy rasterization of two polygons which "fight" to color the screen pixels. This problem is usually caused by limited sub-pixel precision andfloating point and fixed point round-off errors.
Z-fighting can be reduced through the use of a higher resolution depth buffer, by z-buffering in some scenarios, or by simply moving the polygons further apart. Z-fighting which cannot be entirely eliminated in this manner is often resolved by the use of astencil buffer, or by applying a post transformation screen space z-buffer offset to one polygon which does not affect the projected shape on screen, but does affect the z-buffer value to eliminate the overlap during pixel interpolation and comparison. Where z-fighting is caused by different transformation paths in hardware for the same geometry (for example in a multi-pass rendering scheme) it can sometimes be resolved by requesting that the hardware uses invariant vertex transformation.
The more z-buffer precision one uses, the less likely it is that z-fighting will be encountered. But for coplanar polygons, the problem is inevitable unless corrective action is taken.
As the distance between near and far clip planes increases and in particular the near plane is selected near the eye, the greater the likelihood exists that z-fighting between primitives will occur. With large virtual environments inevitably there is an inherent conflict between the need to resolve visibility in the distance and in the foreground, so for example in a space flight simulator if you draw a distant galaxy to scale, you will not have the precision to resolve visibility on any cockpit geometry in the foreground (although even a numerical representation would present problems prior to z-buffered rendering). To mitigate these problems, z-buffer precision is weighted towards the near clip plane, but this is not the case with all visibility schemes and it is insufficient to eliminate all z-fighting issues.
Z-fighting which is caused by insufficent precision in the depth buffer can be resolved by simply reducing the visible distance in the world. This reduces the distance between the near and far planes, and solves the precision issue. However, in certain virtual environments, such as a space simulator, or a flight simulator, this is not possible. Alternative techniques exist in these cases. One of these techniques is to "simulate" the distance of objects far from the user without actually changing their position. For example, if the maximum safe view distance (beyond which z-fighting occurs) is 10,000 units, and an object to be rendered is 15,000 units away, that object could instead be rendered at 10,000 units but it could be scaled down in proportion to the distance that it was moved. So, an object that has been scaled down by half will look like it is twice as far as it actually is. If this is done only for objects that are already close to, or at, the maximum view distance, and objects close to the user are rendered normally, this technique should not be noticeable.
- z-fighting
- Z-fighting
- Z-fighting (深度冲突)
- offset 是 z-fighting
- threejs- z-fighting 问题
- z-fighting的经典处理
- Z - Fighting 和 Depth-bias
- z-fighting在unity中的解决方式
- ShaderLab Tutorials-Z-Fighting and Offset
- 使用Z-Bias解决Z-Fighting问题的替代方案 Alternatives to Using Z-Bias to Fix Z-Fighting Issues
- Fighting!!
- fighting
- fighting
- fighting
- FIGHTING~~
- fighting
- fighting....
- fighting~~~
- 给UIview加上xib
- 转一个 Xcode 7 缺少 *.dylib库的解决方法
- 密码学中的“盐值 Salt”
- 关于fseek不能定位大于2G文件的问题
- Apriori算法的R语言实现
- z-fighting
- Java中的位移操作 >>、<<
- android studio import android-source-code
- linux 基本命令总结
- 基于Triplet loss 函数训练人脸识别深度网络
- HDbaseT 高清传输更简单——只需一根网线
- Linux流编程
- RabbitMQ 官方说明文档
- linux识别/查询/结束进程