-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGLGeometries: Ensure wireframes reflect the current geometry data #15198
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
Conversation
|
BTW: Updating the position buffer is no problem since |
Uh oh... Thanks! |
Oh sorry, I've made a mistake here. Because of hoisting, the variable |
|
I think this PR is ready to go now 😊🚀 |
|
/bump @mrdoob |
|
see #10638 (comment) |
|
Okay, I've added an additional change to ensure that the respective WebGLBuffer of an obsolete wireframe attribute is actually deleted. This change should prevent an evil memory leak^^ |
|
Late thanks! 😇 |
Fixes the problem mentioned in #12771 (comment)
WebGLGeometriesnow ensures that the wireframe attribute of a geometry is actually updated when the underlying index buffer changes. Before this fix, the wireframe attribute was created once and never updated.I've created a fiddle with the fixed build in order to illustrate the new behavior:
https://jsfiddle.net/f2Lommf5/15691/
The PR also does an optimization. Before the fix,getWireframeAttribute()always created an array object right here:three.js/src/renderers/webgl/WebGLGeometries.js
Line 123 in 771b015
Because of hoisting, it does not matter that the statement was placed after the return. The array was already created at this point. This is now fixed.