소스 검색

fixed typos in noise function

(cherry picked from commit acde1ab54e6f225e5c0c9274242a3d799d9e43ed)
clayjohn 7 년 전
부모
커밋
1f765078aa
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      tutorials/3d/vertex_displacement_with_shaders.rst

+ 3 - 3
tutorials/3d/vertex_displacement_with_shaders.rst

@@ -195,8 +195,8 @@ we increase the frequency each level, decrease the amplitude, and calculate a ne
     float frequency = 3.0;
     float frequency = 3.0;
     for (int i = 0; i < 6; i++){
     for (int i = 0; i < 6; i++){
       h += noise(x * frequency) * amplitude;
       h += noise(x * frequency) * amplitude;
-      a *= 0.5;
-      p *= 2.0;
+      amplitude *= 0.5;
+      frequency *= 2.0;
     }
     }
     return h;
     return h;
   }
   }
@@ -205,7 +205,7 @@ We can now use this noise function in place of ``cos`` and ``sin`` in the previo
 
 
 ::
 ::
 
 
-  float height = noise(VERTEX.xz * 4.0);
+  float height = fbm(VERTEX.xz * 4.0);
   VERTEX.y += height * 0.5;
   VERTEX.y += height * 0.5;
 
 
 .. image:: img/vertex_displacement_noise1.png
 .. image:: img/vertex_displacement_noise1.png