Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add lensflare using Three.js?

Tags:

three.js

I'd like to add lensflare in my own project,just like http://threejs.org/examples/webgl_lensflares.html

But the Chrome keeps warning me of "WebGL: INVALID_OPERATION: copyTexImage2D: framebuffer is incompatible format ",and the lens flare doesn't appear.

I searched a lot,But no right answer,please help.

like image 773
user1751755 Avatar asked Jan 12 '23 20:01

user1751755


1 Answers

Modify your renderer to add alpha to the framebuffer so it will be the same expected framebuffer format as lenflares uses (RGBA):

renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
like image 154
fernandojsg Avatar answered Mar 31 '23 03:03

fernandojsg