Просмотр исходного кода

Let SimulationRenderer provide textures as output. (#8841)

tschw 9 лет назад
Родитель
Сommit
e26356417d
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      examples/js/SimulationRenderer.js
  2. 2 2
      examples/webgl_gpgpu_birds.html

+ 2 - 2
examples/js/SimulationRenderer.js

@@ -148,7 +148,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		positionShader.uniforms.time.value = performance.now();
 		positionShader.uniforms.delta.value = delta;
 		renderer.render( scene, camera, output );
-		this.currentPosition = output;
+		this.currentPosition = output.texture;
 
 	};
 
@@ -160,7 +160,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		velocityShader.uniforms.time.value = performance.now();
 		velocityShader.uniforms.delta.value = delta;
 		renderer.render( scene, camera, output );
-		this.currentVelocity = output;
+		this.currentVelocity = output.texture;
 
 	};
 

+ 2 - 2
examples/webgl_gpgpu_birds.html

@@ -661,8 +661,8 @@
 				mouseX = 10000;
 				mouseY = 10000;
 
-				birdUniforms.texturePosition.value = simulator.currentPosition.texture;
-				birdUniforms.textureVelocity.value = simulator.currentVelocity.texture;
+				birdUniforms.texturePosition.value = simulator.currentPosition;
+				birdUniforms.textureVelocity.value = simulator.currentVelocity;
 
 				renderer.render( scene, camera );