Skip to content

Commit 449a981

Browse files
committed
CanvasRenderer: Added distance(falloff) to PointLight. Removed illumination to ParticleCanvasMaterial.
1 parent 377d190 commit 449a981

14 files changed

Lines changed: 69 additions & 88 deletions

examples/canvas_interactive_cubes.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@
6969
particleMaterial = new THREE.ParticleCanvasMaterial( {
7070

7171
color: 0x000000,
72-
program: function ( context, color ) {
72+
program: function ( context ) {
7373

74-
context.fillStyle = color.__styleString;
7574
context.beginPath();
7675
context.arc( 0, 0, 1, 0, PI2, true );
7776
context.closePath();

examples/canvas_lights_pointlights.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,18 @@
6464

6565
scene.addLight( new THREE.AmbientLight( 0x00020 ) );
6666

67-
light1 = new THREE.PointLight( 0xff0040 );
67+
light1 = new THREE.PointLight( 0xff0040, 1, 50 );
6868
scene.addLight( light1 );
6969

70-
light2 = new THREE.PointLight( 0x0040ff );
70+
light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
7171
scene.addLight( light2 );
7272

73-
light3 = new THREE.PointLight( 0x80ff80 );
73+
light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
7474
scene.addLight( light3 );
7575

7676
var PI2 = Math.PI * 2;
77-
var program = function ( context, color ) {
77+
var program = function ( context ) {
7878

79-
context.fillStyle = color.__styleString;
8079
context.beginPath();
8180
context.arc( 0, 0, 1, 0, PI2, true );
8281
context.closePath();

examples/canvas_lights_pointlights_smooth.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,18 @@
6464

6565
scene.addLight( new THREE.AmbientLight( 0x00020 ) );
6666

67-
light1 = new THREE.PointLight( 0xff0040 );
67+
light1 = new THREE.PointLight( 0xff0040, 1, 50 );
6868
scene.addLight( light1 );
6969

70-
light2 = new THREE.PointLight( 0x0040ff );
70+
light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
7171
scene.addLight( light2 );
7272

73-
light3 = new THREE.PointLight( 0x80ff80 );
73+
light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
7474
scene.addLight( light3 );
7575

7676
var PI2 = Math.PI * 2;
77-
var program = function ( context, color ) {
77+
var program = function ( context ) {
7878

79-
context.fillStyle = color.__styleString;
8079
context.beginPath();
8180
context.arc( 0, 0, 1, 0, PI2, true );
8281
context.closePath();

examples/canvas_lines.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,15 @@
6060
var PI2 = Math.PI * 2;
6161
var material = new THREE.ParticleCanvasMaterial( {
6262

63-
color: 0xffffff,
64-
program: function ( context, color ) {
63+
color: 0xffffff,
64+
program: function ( context ) {
6565

66-
context.fillStyle = color.__styleString;
67-
context.beginPath();
68-
context.arc( 0, 0, 1, 0, PI2, true );
69-
context.closePath();
70-
context.fill();
66+
context.beginPath();
67+
context.arc( 0, 0, 1, 0, PI2, true );
68+
context.closePath();
69+
context.fill();
7170

72-
}
71+
}
7372

7473
} );
7574

examples/canvas_lines_sphere.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,15 @@
6363
var PI2 = Math.PI * 2;
6464
var material = new THREE.ParticleCanvasMaterial( {
6565

66-
color: 0xffffff,
67-
program: function ( context, color ) {
66+
color: 0xffffff,
67+
program: function ( context ) {
6868

69-
context.fillStyle = color.__styleString;
70-
context.beginPath();
71-
context.arc( 0, 0, 1, 0, PI2, true );
72-
context.closePath();
73-
context.fill();
69+
context.beginPath();
70+
context.arc( 0, 0, 1, 0, PI2, true );
71+
context.closePath();
72+
context.fill();
7473

75-
}
74+
}
7675

7776
} );
7877

examples/canvas_materials.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,8 @@
112112
}
113113

114114
var PI2 = Math.PI * 2;
115-
var program = function ( context, color ) {
115+
var program = function ( context ) {
116116

117-
context.fillStyle = color.__styleString;
118117
context.beginPath();
119118
context.arc( 0, 0, 1, 0, PI2, true );
120119
context.closePath();

examples/canvas_materials_video.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,15 @@
128128
var PI2 = Math.PI * 2;
129129
var material = new THREE.ParticleCanvasMaterial( {
130130

131-
color: 0x0808080,
132-
program: function ( context, color ) {
131+
color: 0x0808080,
132+
program: function ( context ) {
133133

134-
context.fillStyle = color.__styleString;
135-
context.beginPath();
136-
context.arc( 0, 0, 1, 0, PI2, true );
137-
context.closePath();
138-
context.fill();
134+
context.beginPath();
135+
context.arc( 0, 0, 1, 0, PI2, true );
136+
context.closePath();
137+
context.fill();
139138

140-
}
139+
}
141140

142141
} );
143142

examples/canvas_particles_floor.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@
5353
var material = new THREE.ParticleCanvasMaterial( {
5454

5555
color: 0xffffff,
56-
program: function ( context, color ) {
56+
program: function ( context ) {
5757

58-
context.fillStyle = color.__styleString;
5958
context.beginPath();
6059
context.arc( 0, 0, 1, 0, PI2, true );
6160
context.closePath();

examples/canvas_particles_random.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@
4646
scene = new THREE.Scene();
4747

4848
var PI2 = Math.PI * 2;
49-
var program = function ( context, color ) {
49+
var program = function ( context ) {
5050

51-
context.fillStyle = color.__styleString;
5251
context.beginPath();
5352
context.arc( 0, 0, 1, 0, PI2, true );
5453
context.closePath();

examples/canvas_particles_waves.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,15 @@
5454
var PI2 = Math.PI * 2;
5555
var material = new THREE.ParticleCanvasMaterial( {
5656

57-
color: 0xffffff,
58-
program: function ( context, color ) {
57+
color: 0xffffff,
58+
program: function ( context ) {
5959

60-
context.strokeStyle = color.__styleString;
61-
context.beginPath();
62-
context.arc( 0, 0, 1, 0, PI2, true );
63-
context.closePath();
64-
context.stroke();
60+
context.beginPath();
61+
context.arc( 0, 0, 1, 0, PI2, true );
62+
context.closePath();
63+
context.stroke();
6564

66-
}
65+
}
6766

6867
} );
6968

0 commit comments

Comments
 (0)