Actual flare doesnt' show up in official lensflare example


I copied the exact code from the official three.js example and when I run the file no errors appear. However, the lensflare appears to be missing, as you can see here: nolensflare All I can see is the emitted light, with no actual source. What could be the cause? The code is exactly the same.

Thank you!

just a thought, what if the lensflare textures are not successfully loading.

be sure to check in your console for assets that might not be loaded. You may need to include XHR and ‘Requests’ in the filter. Also see that the request returned 200, not 404 or some other error.

And read this:
Three.js uses textures for flares in this example and in your case it loads them from your local disk.

As far as I can see, there’s no reason why the textures shouldn’t load. All my paths are correct, and I’ve changed Chrome’s local files security policy, so all my textures from other projects load well. Could the lensflare code itself have an issue?

When I include those filters, all I see is “1 hidden”. I don’t know what that means, or how to unhide it.

Try Firefox :slight_smile:

help is needed!!

headlights. as in everything will accept libraries + textures

while the light does not work well, the light trembles when it covers the 3d prayer.

    var textureLoader = new THREE.TextureLoader();

    var textureFlare0 = textureLoader.load( 'model/lensflare0.png' );
    var textureFlare3 = textureLoader.load( 'model/lensflare3.png' );

    addLight( 0.1, 0.8, 0.8, 8, -146, -136 );

    function addLight( h, s, l, x, y, z ) {

      var lensflare = new THREE.Lensflare();
      lensflare.addElement( new THREE.LensflareElement( textureFlare0, 80, 0, light.color ) );
      lensflare.addElement( new THREE.LensflareElement( textureFlare3, 5, 0 ) );
      lensflare.position.set( x, y, z );
      lensflare.castShadow = true;
      light.add( lensflare );