Skip to content

Commit 88ff50b

Browse files
authored
Merge pull request #11510 from Aurora-Bee/advanced_postprocessing_optimization_code_fix
Fixed code example in Shaders > Advanced post-processing > An optimization
2 parents 0fce3e7 + 8db87be commit 88ff50b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tutorials/shaders/advanced_postprocessing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ the depth value for ``z``.
122122
use Vulkan NDCs with a Z-range of ``[0.0, 1.0]``. In contrast, the Compatibility
123123
renderer uses OpenGL NDCs with a Z-range of ``[-1.0, 1.0]``. For the Compatibility
124124
renderer, replace the NDC calculation with this instead:
125-
125+
126126
.. code-block:: glsl
127127
128128
vec3 ndc = vec3(SCREEN_UV, depth) * 2.0 - 1.0;
@@ -154,7 +154,7 @@ the distance to the point.
154154
Because the camera is facing the negative ``z`` direction, the position will have a negative ``z`` value.
155155
In order to get a usable depth value, we have to negate ``view.z``.
156156

157-
The world position can be constructed from the depth buffer using the following code, using the
157+
The world position can be constructed from the depth buffer using the following code, using the
158158
``INV_VIEW_MATRIX`` to transform the position from view space into world space.
159159

160160
.. code-block:: glsl
@@ -168,8 +168,8 @@ The world position can be constructed from the depth buffer using the following
168168
Example shader
169169
--------------
170170

171-
Once we add a line to output to ``ALBEDO``, we have a complete shader that looks something like this.
172-
This shader lets you visualize the linear depth or world space coordinates, depending on which
171+
Once we add a line to output to ``ALBEDO``, we have a complete shader that looks something like this.
172+
This shader lets you visualize the linear depth or world space coordinates, depending on which
173173
line is commented out.
174174

175175
.. code-block:: glsl
@@ -223,8 +223,8 @@ Now, attach a script to the MeshInstance3D and use the following code:
223223
# Create a single triangle out of vertices:
224224
var verts = PackedVector3Array()
225225
verts.append(Vector3(-1.0, -1.0, 0.0))
226-
verts.append(Vector3(-1.0, 3.0, 0.0))
227226
verts.append(Vector3(3.0, -1.0, 0.0))
227+
verts.append(Vector3(-1.0, 3.0, 0.0))
228228

229229
# Create an array of arrays.
230230
# This could contain normals, colors, UVs, etc.

0 commit comments

Comments
 (0)