-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add enableDebugWireframe
to use wireframes for ModelExperimental in WebGL1
#10344
Conversation
Thanks for the pull request @j9liu!
Reviewers, don't forget to make sure that:
|
@@ -269,6 +267,7 @@ describe( | |||
|
|||
afterAll(function () { | |||
scene.destroyForSpecs(); | |||
sceneWithWebgl2.destroyForSpecs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
const useUint8Array = indicesBuffer.sizeInBytes === indicesCount; | ||
originalIndices = useUint8Array | ||
? new Uint8Array(indicesCount) | ||
: IndexDatatype.createTypedArray(vertexCount, indicesCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lilleyse do you know why IndexDatatype.createTypedArray
doesn't output 8-bit indices, and if there's any code that depends on it outputting 16/32 only? Or if there's any code that also has this workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, going to leave this code in, and address it in a future PR
I turned wireframe on and off (both before and after this PR) in WebGL1 in the Model Experimental 3D Model Sandcastle and the memory reduction is working as expected! New + No Wireframe: New + Wireframe: Old + No Wireframe: Old + Wireframe: |
Thanks @j9liu ! |
Closes #10340. Currently wireframes in
ModelExperimental
require the indices to be loaded as typed arrays for WebGL1. However, this will result in performance costs for users that don't need thedebugWireframe
option.The preferred solution is to require an option,
enableDebugWireframe
, to be explicitly set astrue
in theModelExperimental
constructors. If this is true, thendebugWireframe
will work for models in WebGL1. However, if this is not true, then togglingdebugWireframe
will have no effect. This will not affect models in WebGL2 because in WebGL2, data can be pulled from GPU buffers.ModelExperimental
Sandcastle and 3D Tiles sandcastle for testing. I left comments for the lines that should be toggled on / off for testing.