Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Lensflare.js to be able to dispose textures #13355

Merged
merged 2 commits into from
Feb 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/js/objects/Lensflare.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ THREE.Lensflare = function () {

//

var elements = [];
elements = [];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to keep the var here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i did not notice that...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll clean it up after merging.


var shader = THREE.LensflareElement.Shader;

Expand Down Expand Up @@ -254,6 +254,10 @@ THREE.Lensflare = function () {

tempMap.dispose();
occlusionMap.dispose();

for ( var i = 0, l = elements.length; i < l; i ++ ) {
elements[i].texture.dispose();
}

};

Expand Down