@@ -58,7 +58,7 @@ THREE.Fire = function ( geometry, options ) {
5858
5959 }
6060
61- this . sourceMaterial . uniforms . sourceMap . value = this . internalSource ;
61+ this . sourceMaterial . uniforms [ " sourceMap" ] . value = this . internalSource ;
6262 this . sourceMaterial . needsUpdate = true ;
6363
6464 return this . sourceData ;
@@ -121,7 +121,7 @@ THREE.Fire = function ( geometry, options ) {
121121 // (0 -> 127 = 0.0 -> 1.0, 128 -> 255 = -1.0 -> 0.0 )
122122 this . setSourceMap = function ( texture ) {
123123
124- this . sourceMaterial . uniforms . sourceMap . value = texture ;
124+ this . sourceMaterial . uniforms [ " sourceMap" ] . value = texture ;
125125
126126 } ;
127127
@@ -190,8 +190,8 @@ THREE.Fire = function ( geometry, options ) {
190190 transparent : false
191191 } ) ;
192192
193- this . diffuseMaterial . uniforms . oneOverWidth . value = oneOverWidth ;
194- this . diffuseMaterial . uniforms . oneOverHeight . value = oneOverHeight ;
193+ this . diffuseMaterial . uniforms [ " oneOverWidth" ] . value = oneOverWidth ;
194+ this . diffuseMaterial . uniforms [ " oneOverHeight" ] . value = oneOverHeight ;
195195
196196 this . diffuseMesh = new THREE . Mesh ( this . fieldGeometry , this . diffuseMaterial ) ;
197197 this . fieldScene . add ( this . diffuseMesh ) ;
@@ -206,8 +206,8 @@ THREE.Fire = function ( geometry, options ) {
206206 transparent : false
207207 } ) ;
208208
209- this . driftMaterial . uniforms . oneOverWidth . value = oneOverWidth ;
210- this . driftMaterial . uniforms . oneOverHeight . value = oneOverHeight ;
209+ this . driftMaterial . uniforms [ " oneOverWidth" ] . value = oneOverWidth ;
210+ this . driftMaterial . uniforms [ " oneOverHeight" ] . value = oneOverHeight ;
211211
212212 this . driftMesh = new THREE . Mesh ( this . fieldGeometry , this . driftMaterial ) ;
213213 this . fieldScene . add ( this . driftMesh ) ;
@@ -222,8 +222,8 @@ THREE.Fire = function ( geometry, options ) {
222222 transparent : false
223223 } ) ;
224224
225- this . projMaterial1 . uniforms . oneOverWidth . value = oneOverWidth ;
226- this . projMaterial1 . uniforms . oneOverHeight . value = oneOverHeight ;
225+ this . projMaterial1 . uniforms [ " oneOverWidth" ] . value = oneOverWidth ;
226+ this . projMaterial1 . uniforms [ " oneOverHeight" ] . value = oneOverHeight ;
227227
228228 this . projMesh1 = new THREE . Mesh ( this . fieldGeometry , this . projMaterial1 ) ;
229229 this . fieldScene . add ( this . projMesh1 ) ;
@@ -239,8 +239,8 @@ THREE.Fire = function ( geometry, options ) {
239239 } ) ;
240240
241241
242- this . projMaterial2 . uniforms . oneOverWidth . value = oneOverWidth ;
243- this . projMaterial2 . uniforms . oneOverHeight . value = oneOverHeight ;
242+ this . projMaterial2 . uniforms [ " oneOverWidth" ] . value = oneOverWidth ;
243+ this . projMaterial2 . uniforms [ " oneOverHeight" ] . value = oneOverHeight ;
244244
245245 this . projMesh2 = new THREE . Mesh ( this . fieldGeometry , this . projMaterial2 ) ;
246246 this . fieldScene . add ( this . projMesh2 ) ;
@@ -256,8 +256,8 @@ THREE.Fire = function ( geometry, options ) {
256256 } ) ;
257257
258258
259- this . projMaterial3 . uniforms . oneOverWidth . value = oneOverWidth ;
260- this . projMaterial3 . uniforms . oneOverHeight . value = oneOverHeight ;
259+ this . projMaterial3 . uniforms [ " oneOverWidth" ] . value = oneOverWidth ;
260+ this . projMaterial3 . uniforms [ " oneOverHeight" ] . value = oneOverHeight ;
261261
262262 this . projMesh3 = new THREE . Mesh ( this . fieldGeometry , this . projMaterial3 ) ;
263263 this . fieldScene . add ( this . projMesh3 ) ;
@@ -280,31 +280,31 @@ THREE.Fire = function ( geometry, options ) {
280280 transparent : true
281281 } ) ;
282282
283- this . material . uniforms . densityMap . value = this . field1 . texture ;
283+ this . material . uniforms [ " densityMap" ] . value = this . field1 . texture ;
284284
285285 this . configShaders = function ( dt ) {
286286
287- this . diffuseMaterial . uniforms . diffuse . value = dt * 0.05 * this . diffuse ;
288- this . diffuseMaterial . uniforms . viscosity . value = dt * 0.05 * this . viscosity ;
289- this . diffuseMaterial . uniforms . expansion . value = Math . exp ( this . expansion * - 1.0 ) ;
290- this . diffuseMaterial . uniforms . swirl . value = Math . exp ( this . swirl * - 0.1 ) ;
291- this . diffuseMaterial . uniforms . drag . value = Math . exp ( this . drag * - 0.1 ) ;
292- this . diffuseMaterial . uniforms . burnRate . value = this . burnRate * dt * 0.01 ;
293- this . driftMaterial . uniforms . windVector . value = this . windVector ;
294- this . driftMaterial . uniforms . airSpeed . value = dt * this . airSpeed * 0.001 * textureHeight ;
295- this . material . uniforms . color1 . value = this . color1 ;
296- this . material . uniforms . color2 . value = this . color2 ;
297- this . material . uniforms . color3 . value = this . color3 ;
298- this . material . uniforms . colorBias . value = this . colorBias ;
287+ this . diffuseMaterial . uniforms [ " diffuse" ] . value = dt * 0.05 * this . diffuse ;
288+ this . diffuseMaterial . uniforms [ " viscosity" ] . value = dt * 0.05 * this . viscosity ;
289+ this . diffuseMaterial . uniforms [ " expansion" ] . value = Math . exp ( this . expansion * - 1.0 ) ;
290+ this . diffuseMaterial . uniforms [ " swirl" ] . value = Math . exp ( this . swirl * - 0.1 ) ;
291+ this . diffuseMaterial . uniforms [ " drag" ] . value = Math . exp ( this . drag * - 0.1 ) ;
292+ this . diffuseMaterial . uniforms [ " burnRate" ] . value = this . burnRate * dt * 0.01 ;
293+ this . driftMaterial . uniforms [ " windVector" ] . value = this . windVector ;
294+ this . driftMaterial . uniforms [ " airSpeed" ] . value = dt * this . airSpeed * 0.001 * textureHeight ;
295+ this . material . uniforms [ " color1" ] . value = this . color1 ;
296+ this . material . uniforms [ " color2" ] . value = this . color2 ;
297+ this . material . uniforms [ " color3" ] . value = this . color3 ;
298+ this . material . uniforms [ " colorBias" ] . value = this . colorBias ;
299299
300300 } ;
301301
302302 this . clearDiffuse = function ( ) {
303303
304- this . diffuseMaterial . uniforms . expansion . value = 1.0 ;
305- this . diffuseMaterial . uniforms . swirl . value = 1.0 ;
306- this . diffuseMaterial . uniforms . drag . value = 1.0 ;
307- this . diffuseMaterial . uniforms . burnRate . value = 0.0 ;
304+ this . diffuseMaterial . uniforms [ " expansion" ] . value = 1.0 ;
305+ this . diffuseMaterial . uniforms [ " swirl" ] . value = 1.0 ;
306+ this . diffuseMaterial . uniforms [ " drag" ] . value = 1.0 ;
307+ this . diffuseMaterial . uniforms [ " burnRate" ] . value = 0.0 ;
308308
309309 } ;
310310
@@ -340,7 +340,7 @@ THREE.Fire = function ( geometry, options ) {
340340
341341 this . sourceMesh . visible = true ;
342342
343- this . sourceMaterial . uniforms . densityMap . value = this . field0 . texture ;
343+ this . sourceMaterial . uniforms [ " densityMap" ] . value = this . field0 . texture ;
344344
345345 renderer . render ( this . fieldScene , this . orthoCamera , this . field1 ) ;
346346
@@ -354,7 +354,7 @@ THREE.Fire = function ( geometry, options ) {
354354
355355 this . diffuseMesh . visible = true ;
356356
357- this . diffuseMaterial . uniforms . densityMap . value = this . field0 . texture ;
357+ this . diffuseMaterial . uniforms [ " densityMap" ] . value = this . field0 . texture ;
358358
359359 renderer . render ( this . fieldScene , this . orthoCamera , this . field1 ) ;
360360
@@ -368,7 +368,7 @@ THREE.Fire = function ( geometry, options ) {
368368
369369 this . driftMesh . visible = true ;
370370
371- this . driftMaterial . uniforms . densityMap . value = this . field0 . texture ;
371+ this . driftMaterial . uniforms [ " densityMap" ] . value = this . field0 . texture ;
372372
373373 renderer . render ( this . fieldScene , this . orthoCamera , this . field1 ) ;
374374
@@ -384,13 +384,13 @@ THREE.Fire = function ( geometry, options ) {
384384
385385 this . projMesh1 . visible = true ;
386386
387- this . projMaterial1 . uniforms . densityMap . value = this . field0 . texture ;
387+ this . projMaterial1 . uniforms [ " densityMap" ] . value = this . field0 . texture ;
388388
389389 renderer . render ( this . fieldScene , this . orthoCamera , this . fieldProj ) ;
390390
391391 this . projMesh1 . visible = false ;
392392
393- this . projMaterial2 . uniforms . densityMap . value = this . fieldProj . texture ;
393+ this . projMaterial2 . uniforms [ " densityMap" ] . value = this . fieldProj . texture ;
394394
395395 // Projection pass 2
396396
@@ -404,14 +404,14 @@ THREE.Fire = function ( geometry, options ) {
404404 this . field1 = this . fieldProj ;
405405 this . fieldProj = temp ;
406406
407- this . projMaterial2 . uniforms . densityMap . value = this . fieldProj . texture ;
407+ this . projMaterial2 . uniforms [ " densityMap" ] . value = this . fieldProj . texture ;
408408
409409 }
410410
411411 this . projMesh2 . visible = false ;
412412
413- this . projMaterial3 . uniforms . densityMap . value = this . field0 . texture ;
414- this . projMaterial3 . uniforms . projMap . value = this . fieldProj . texture ;
413+ this . projMaterial3 . uniforms [ " densityMap" ] . value = this . field0 . texture ;
414+ this . projMaterial3 . uniforms [ " projMap" ] . value = this . fieldProj . texture ;
415415
416416 // Projection pass 3
417417
0 commit comments