Browse Source

Correct examples/webgl_gpgpu_birds_gltf.html flapping speed.

gonnavis 4 years ago
parent
commit
8251a439f4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/webgl_gpgpu_birds_gltf.html

+ 2 - 2
examples/webgl_gpgpu_birds_gltf.html

@@ -525,7 +525,7 @@
 
 
 						vec3 pos = tmpPos.xyz;
 						vec3 pos = tmpPos.xyz;
 						vec3 velocity = normalize(texture2D( textureVelocity, reference.xy ).xyz);
 						vec3 velocity = normalize(texture2D( textureVelocity, reference.xy ).xyz);
-						vec3 aniPos = texture2D( textureAnimation, vec2( reference.z, mod( ( time + seeds.x ) * ( ( 0.0004 + seeds.y / 10000.0) + normalize( velocity ) / 20000.0 ), reference.w ) ) ).xyz;
+						vec3 aniPos = texture2D( textureAnimation, vec2( reference.z, mod( time + ( seeds.x ) * ( ( 0.0004 + seeds.y / 10000.0) + normalize( velocity ) / 20000.0 ), reference.w ) ) ).xyz;
 						vec3 newPosition = position;
 						vec3 newPosition = position;
 
 
 						newPosition = mat3( modelMatrix ) * ( newPosition + aniPos );
 						newPosition = mat3( modelMatrix ) * ( newPosition + aniPos );
@@ -649,7 +649,7 @@
 				positionUniforms[ "delta" ].value = delta;
 				positionUniforms[ "delta" ].value = delta;
 				velocityUniforms[ "time" ].value = now;
 				velocityUniforms[ "time" ].value = now;
 				velocityUniforms[ "delta" ].value = delta;
 				velocityUniforms[ "delta" ].value = delta;
-				if ( materialShader ) materialShader.uniforms[ "time" ].value = now;
+				if ( materialShader ) materialShader.uniforms[ "time" ].value = now / 1000;
 				if ( materialShader ) materialShader.uniforms[ "delta" ].value = delta;
 				if ( materialShader ) materialShader.uniforms[ "delta" ].value = delta;
 
 
 				velocityUniforms[ "predator" ].value.set( 0.5 * mouseX / windowHalfX, - 0.5 * mouseY / windowHalfY, 0 );
 				velocityUniforms[ "predator" ].value.set( 0.5 * mouseX / windowHalfX, - 0.5 * mouseY / windowHalfY, 0 );