소스 검색

Merge pull request #9800 from sfreed141/patch-2

Fix out of date comment about depth buffer
Matthew 11 달 전
부모
커밋
11434476a0
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      tutorials/shaders/advanced_postprocessing.rst

+ 3 - 4
tutorials/shaders/advanced_postprocessing.rst

@@ -93,11 +93,10 @@ Once defined, the depth texture can be read with the ``texture()`` function.
           possible when reading from the current viewport. The depth texture cannot be
           accessed from another viewport to which you have rendered.
 
-The values returned by ``depth_texture`` are between ``0.0`` and ``1.0`` and are nonlinear.
+The values returned by ``depth_texture`` are between ``1.0`` and ``0.0`` (corresponding to
+the near and far plane, respectively, because of using a "reverse-z" depth buffer) and are nonlinear.
 When displaying depth directly from the ``depth_texture``, everything will look almost
-white unless it is very close. This is because the depth buffer stores objects closer
-to the camera using more bits than those further, so most of the detail in depth
-buffer is found close to the camera. In order to make the depth value align with world or
+black unless it is very close due to that nonlinearity. In order to make the depth value align with world or
 model coordinates, we need to linearize the value. When we apply the projection matrix to the
 vertex position, the z value is made nonlinear, so to linearize it, we multiply it by the
 inverse of the projection matrix, which in Godot, is accessible with the variable