Three.AreaLight with Three.Points Highlight在对象上创建光照/反射人工制品

时间:2017-12-07 14:37:50

标签: javascript 3d three.js particle-system

Comparison我创建了一个简单的粒子系统,其纹理为THREE.PointsMaterial。它是一个带有透明度的白色圆点16x16px png。粒子按预期显示。在场景中,我还有一个加载了THREE.JSONLoader()和基本材料material.color.setHex( 0xFF0000 )THREE.RectAreaLight的测试对象。

当我添加粒子系统时,我在测试对象上有巨大的白色人工制品,如反射或高光。

当我移除AreaLight时,不同的光反射消失了。因此,以某种方式添加Particlesystem会改变Testobject的反射/光照。为什么添加粒子系统会改变独立物体的材料?

非常感谢您的帮助

var particleGeometry = new THREE.Geometry();
    var textureLoader = new THREE.TextureLoader();
    var sprite1 = textureLoader.load(  '/assets/js/libs/app/textures/particle.png' );

    for ( var i = 0; i < 1000; i ++ ) {

        var particle = new THREE.Vector3();
        particle.x = THREE.Math.randFloat( -200, 200 );
        particle.y = THREE.Math.randFloat( -200, 200 );
        particle.z = THREE.Math.randFloat( -200, 200 );

        particleGeometry.vertices.push( particle );

    }

    var particleMaterial = new THREE.PointsMaterial( { size: 1.0, map: sprite1, blending: THREE.AdditiveBlending, depthTest: true, transparent : true } );
    particleSystem = new THREE.Points( particleGeometry, particleMaterial );

    scene.add( particleSystem );

0 个答案:

没有答案