瀏覽代碼

Fixed cone emitter with GPU particles

David Catuhe 6 年之前
父節點
當前提交
ec9126f079
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Shaders/gpuUpdateParticles.vertex.fx

+ 2 - 2
src/Shaders/gpuUpdateParticles.vertex.fx

@@ -279,7 +279,7 @@ void main() {
     float s = 2.0 * PI * randoms2.x;
 
     #ifdef CONEEMITTERSPAWNPOINT
-        float h = 0.00001;
+        float h = 0.0001;
     #else
         float h = randoms2.y * height.y;
         
@@ -301,7 +301,7 @@ void main() {
         direction = vec3(0., 1.0, 0.);
     } else {
         vec3 randoms3 = getRandomVec3(seed.z);
-        direction = position + directionRandomizer * randoms3;
+        direction = normalize(position + directionRandomizer * randoms3);        
     }
 #else    
     // Create the particle at origin