瀏覽代碼

Let SimulationRenderer provide textures as output. (#8841)

tschw 9 年之前
父節點
當前提交
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 );