ソースを参照

Complete the example for "skip_vertex_transform"

Fix godotengine/godot-docs#9108
dawei-wang 1 年間 前
コミット
ec274eb46a
1 ファイル変更2 行追加1 行削除
  1. 2 1
      tutorials/shaders/shader_reference/spatial_shader.rst

+ 2 - 1
tutorials/shaders/shader_reference/spatial_shader.rst

@@ -130,7 +130,8 @@ it manually with the following code:
     void vertex() {
     void vertex() {
         VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
         VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
         NORMAL = normalize((MODELVIEW_MATRIX * vec4(NORMAL, 0.0)).xyz);
         NORMAL = normalize((MODELVIEW_MATRIX * vec4(NORMAL, 0.0)).xyz);
-        // same as above for binormal and tangent, if normal mapping is used
+        BINORMAL = normalize((MODELVIEW_MATRIX * vec4(BINORMAL, 0.0)).xyz);
+        TANGENT = normalize((MODELVIEW_MATRIX * vec4(TANGENT, 0.0)).xyz);
     }
     }
 
 
 Other built-ins, such as UV, UV2 and COLOR, are also passed through to the fragment function if not modified.
 Other built-ins, such as UV, UV2 and COLOR, are also passed through to the fragment function if not modified.