-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Fire and smoke example #15366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fire and smoke example #15366
Conversation
examples/webgl_fire.html
Outdated
| camera.add( pointLight ); | ||
| scene.add( camera ); | ||
|
|
||
| var plane = new THREE.PlaneGeometry( 20, 20 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use BufferGeometry at all places. So in this case PlaneBufferGeometry.
examples/webgl_fire.html
Outdated
| renderer.setPixelRatio( window.devicePixelRatio ); | ||
| renderer.setSize( window.innerWidth, window.innerHeight ); | ||
| renderer.autoClear = false; | ||
| renderer.antialias = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems redundant to me.
examples/js/Fire.js
Outdated
| this.orthoCamera = new THREE.OrthographicCamera( textureWidth / - 2, textureWidth / 2, textureHeight / 2, textureHeight / - 2, 1, 2 ); | ||
| this.orthoCamera.position.z = 1; | ||
|
|
||
| this.fieldGeometry = new THREE.PlaneGeometry( textureWidth, textureHeight ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlaneBufferGeometry.
examples/js/Fire.js
Outdated
| this.field0.background = new THREE.Color( 0x000000 ); | ||
|
|
||
| this.field1 = new THREE.WebGLRenderTarget( textureWidth, | ||
| textureHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some formatting issues.
examples/js/Fire.js
Outdated
| var parameters = { | ||
| minFilter: THREE.NearestFilter, | ||
| magFilter: THREE.NearestFilter, | ||
| format: THREE.RGBAFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is already THREE.RGBAFormat.
|
A better place for |
|
Review comments fixed. |
|
Thanks! |
This is my first contribution to three.js. I think this library is amazing and I want to give back.
This is an example of fire and smoke based on the research paper:
"Real-Time Fluid Dynamics for Games" by Jos Stam
http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf