zz85/sparks.js — Issue #16: WebGL
Author: renegademaster88
Created: 2012-03-05 13:33:50+00:00
State: open

HI , i have been having some trouble moving my sparks code from Canvas Renderer to WebGL renderer. All my particles disapear.

if ( render_gl === false ) {

renderer = new THREE.CanvasRenderer();
renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
container.appendChild( renderer.domElement );

}
else
{

try
{

renderer = new THREE.WebGLRenderer();
renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
renderer.domElement.style.position = "relative";
renderer.autoClear = false;
container.appendChild( renderer.domElement );

has_gl = 1;

} catch (e) {
error.log('error');
}
}

Is there anything i need to configure to make them appear? I am using a ParticleBasicMaterial for example.

var material = new THREE.ParticleBasicMaterial( { size: 85, map: sprite, vertexColors: false ,transparent:false, blending: THREE.AdditiveBlending} );

I tried this material also:

var material = new THREE.ParticleCanvasMaterial( { map: sprite , program: SPARKS.CanvasShadersUtils.circles, blending:THREE.AdditiveBlending } );

thanx
Nick