浏览代码

Merge pull request #3188 from Chaosus/fix_shader_structs

Fix formatting on shader structs examples
Yuri Roubinsky 5 年之前
父节点
当前提交
f885fa3ab7
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tutorials/shading/shading_reference/shading_language.rst

+ 5 - 0
tutorials/shading/shading_reference/shading_language.rst

@@ -297,6 +297,7 @@ Structs
 Structs are compound types which can be used for better abstaction of shader code. You can declare them at the global scope like:
 
 .. code-block:: glsl
+
     struct PointLight {
         vec3 position;
         vec3 color;
@@ -306,6 +307,7 @@ Structs are compound types which can be used for better abstaction of shader cod
 After declaration, you can instantiate and initialize them like:
 
 .. code-block:: glsl
+
     void fragment()
     {
         PointLight light;
@@ -317,11 +319,13 @@ After declaration, you can instantiate and initialize them like:
 Or use struct constructor for same purpose:
 
 .. code-block:: glsl
+
     PointLight light = PointLight(vec3(0.0), vec3(1.0, 0.0, 0.0), 0.5);
 
 Structs may contain other struct or array, you can also instance them as global constant:
 
 .. code-block:: glsl
+
     shader_type spatial;
 
     ...
@@ -340,6 +344,7 @@ Structs may contain other struct or array, you can also instance them as global
 You can also pass them to functions:
 
 .. code-block:: glsl
+
     shader_type canvas_item;
 
     ...