-
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 debug wireframe to ModelExperimental
#10332
Conversation
Thanks for the pull request @j9liu!
Reviewers, don't forget to make sure that:
|
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.
@j9liu for gl.TRIANGLES
, this is working very nicely! I had some comments about making this more robust to handle triangle strips/fans
@ptrgags updated, here's a Sandcastle with |
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.
@j9liu code updates look solid, and the new models are working properly.
One thing I noticed is that for some reason the GroundVehicle
model doesn't seem to render properly when switched to wireframe mode. Any idea why this might be?
@ptrgags I can't replicate the Ground Vehicle bug. It looks fine for me: |
Turns out on Linux, normal mapping doesn't work with lines because it handles the @ptrgags let me know if this solves the issue for you. |
@j9liu that still didn't work unfortunately... Even when I inspect the normals with a However, I also tried forcing it to render |
@j9liu oh wait I think I fetched without pulling 😅, let me try again |
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.
@ptrgags updated! |
@j9liu looks good, I'll merge once CI passes! |
Closes #9066. This PR adds the
debugWireframe
option toModelExperimental
. The current wireframe code inModel
leads to tangled / incorrect wireframes, butModelExperimental
implements it properly.Model
Here's a modified version of the Model Experimental sandcastle that allows you to toggle the wireframe.
This should also work for tilesets with
Cesium.ExperimentalFeatures.enableModelExperimental = true.
For example, here's the result of the changes in the 3D Tiles Inspector sandcastle (localhost)Model
ModelExperimental
Note: this required changes to
GltfIndexBufferLoader
because implementing the wireframe required the index buffer to be available on the CPU. Index buffers are now loaded as typed arrays only in WebGL1 since it's not possible to get data from the buffer directly. With WebGL2, either buffers or typed arrays are fine.