Sfoglia il codice sorgente

Fixed cone emitter with GPU particles

David Catuhe 6 anni fa
parent
commit
ec9126f079
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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;
     float s = 2.0 * PI * randoms2.x;
 
 
     #ifdef CONEEMITTERSPAWNPOINT
     #ifdef CONEEMITTERSPAWNPOINT
-        float h = 0.00001;
+        float h = 0.0001;
     #else
     #else
         float h = randoms2.y * height.y;
         float h = randoms2.y * height.y;
         
         
@@ -301,7 +301,7 @@ void main() {
         direction = vec3(0., 1.0, 0.);
         direction = vec3(0., 1.0, 0.);
     } else {
     } else {
         vec3 randoms3 = getRandomVec3(seed.z);
         vec3 randoms3 = getRandomVec3(seed.z);
-        direction = position + directionRandomizer * randoms3;
+        direction = normalize(position + directionRandomizer * randoms3);        
     }
     }
 #else    
 #else    
     // Create the particle at origin
     // Create the particle at origin