CanvasRenderer: Added distance(falloff) to PointLight. Removed illumination to ParticleCanvasMaterial.

This commit is contained in:
Mr.doob
2011-03-29 03:50:04 +01:00
parent 377d1904de
commit 449a981925
14 changed files with 69 additions and 88 deletions
+1 -2
View File
@@ -69,9 +69,8 @@
particleMaterial = new THREE.ParticleCanvasMaterial( {
color: 0x000000,
program: function ( context, color ) {
program: function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
+4 -5
View File
@@ -64,19 +64,18 @@
scene.addLight( new THREE.AmbientLight( 0x00020 ) );
light1 = new THREE.PointLight( 0xff0040 );
light1 = new THREE.PointLight( 0xff0040, 1, 50 );
scene.addLight( light1 );
light2 = new THREE.PointLight( 0x0040ff );
light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
scene.addLight( light2 );
light3 = new THREE.PointLight( 0x80ff80 );
light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
scene.addLight( light3 );
var PI2 = Math.PI * 2;
var program = function ( context, color ) {
var program = function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
@@ -64,19 +64,18 @@
scene.addLight( new THREE.AmbientLight( 0x00020 ) );
light1 = new THREE.PointLight( 0xff0040 );
light1 = new THREE.PointLight( 0xff0040, 1, 50 );
scene.addLight( light1 );
light2 = new THREE.PointLight( 0x0040ff );
light2 = new THREE.PointLight( 0x0040ff, 1, 50 );
scene.addLight( light2 );
light3 = new THREE.PointLight( 0x80ff80 );
light3 = new THREE.PointLight( 0x80ff80, 1, 50 );
scene.addLight( light3 );
var PI2 = Math.PI * 2;
var program = function ( context, color ) {
var program = function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
+7 -8
View File
@@ -60,16 +60,15 @@
var PI2 = Math.PI * 2;
var material = new THREE.ParticleCanvasMaterial( {
color: 0xffffff,
program: function ( context, color ) {
color: 0xffffff,
program: function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
}
}
} );
+7 -8
View File
@@ -63,16 +63,15 @@
var PI2 = Math.PI * 2;
var material = new THREE.ParticleCanvasMaterial( {
color: 0xffffff,
program: function ( context, color ) {
color: 0xffffff,
program: function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
}
}
} );
+1 -2
View File
@@ -112,9 +112,8 @@
}
var PI2 = Math.PI * 2;
var program = function ( context, color ) {
var program = function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
+7 -8
View File
@@ -128,16 +128,15 @@
var PI2 = Math.PI * 2;
var material = new THREE.ParticleCanvasMaterial( {
color: 0x0808080,
program: function ( context, color ) {
color: 0x0808080,
program: function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.fill();
}
}
} );
+1 -2
View File
@@ -53,9 +53,8 @@
var material = new THREE.ParticleCanvasMaterial( {
color: 0xffffff,
program: function ( context, color ) {
program: function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
+1 -2
View File
@@ -46,9 +46,8 @@
scene = new THREE.Scene();
var PI2 = Math.PI * 2;
var program = function ( context, color ) {
var program = function ( context ) {
context.fillStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
+7 -8
View File
@@ -54,16 +54,15 @@
var PI2 = Math.PI * 2;
var material = new THREE.ParticleCanvasMaterial( {
color: 0xffffff,
program: function ( context, color ) {
color: 0xffffff,
program: function ( context ) {
context.strokeStyle = color.__styleString;
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.stroke();
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.closePath();
context.stroke();
}
}
} );
+1 -1
View File
@@ -100,7 +100,7 @@
directionalLight.position.z = 0;
scene.addLight( directionalLight );
var pointLight = new THREE.PointLight( 0xff0000, 1 );
var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
scene.addLight( pointLight );
renderer = new THREE.CanvasRenderer();