mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 21:15:56 +10:00
CanvasRenderer: Added distance(falloff) to PointLight. Removed illumination to ParticleCanvasMaterial.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user