-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 color instantly #275
Conversation
Visit the preview URL for this PR (updated for commit ff62254): https://gcode-preview--pr275-poc-instant-color-ch-6qh01fy5.web.app (expires Thu, 13 Feb 2025 21:43:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 59bd114ae4847b32c2bba0b68620b9069a3e3531 |
- Added y-axis clipping support to shaders - Simplified clipping implementation using y values - Removed old Plane-based clipping system - Fixed material initialization and uniform access - Cleaned up all references to old implementation
- Added y-axis clipping for ShaderMaterial (tubes) - Restored plane-based clipping for LineMaterial (travel lines) - Added updateLineClipping method to sync both systems - Cleaned up imports and removed duplicates
# Conflicts: # src/dev-gui.ts # src/webgl-preview.ts
render.add(this.watchedObject.renderer.info.memory, 'geometries').listen(); | ||
render.add(this.watchedObject.renderer.info.memory, 'textures').listen(); | ||
render.add(this.watchedObject, '_lastRenderTime').listen(); | ||
render.add(this.webglPreview.renderer.info.render, 'triangles').listen(); |
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.
Be careful with changing watchedObject
. I had issues with this referencing some old objects when they are replaced.
We have many this.an_object = new ObjectClass()
that made it a challenge to watch on the GUI.
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.
Thanks for the heads-up. I doublechecked and I don't think this changes breaks anything. The watchedObject is still the same instance but now it is typed to make the compiler happy.
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.
Have you checked with the other places where watchedObject
is changed too?
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.
I'll check it again! Will try tomorrow.
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.
I checked all the dev helpers. Nothing is broken by this PR.
The Job info and _lastRenderTime don't update but I checked that was already the case be for this PR.
Only the types have changed and the namei of the instance but there shouldn't be even a change in the javascript code that is being generated.
btw, did you see you can now change the lighting through the dev helper?
This is an improvement to change the color of the model instantly, without having to rebuild the mesh.
It uses a simple ShaderMaterial which has an updatable uniform property for the color. Updating this doesn't require rebuilding the mesh, it only requires a renderer.render call.
It actually works better than expected so I promoted this from poc to pr.
TODO
fix drag n dropseparate issue Detect number of colors/tools when dropping a file #277I needed a good model to test shader with so I included Marlin (by cipis)
![image](https://private-user-images.githubusercontent.com/461650/403145301-7be550da-2eed-44f6-93fc-d64abb71c545.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5ODY1OTgsIm5iZiI6MTczOTk4NjI5OCwicGF0aCI6Ii80NjE2NTAvNDAzMTQ1MzAxLTdiZTU1MGRhLTJlZWQtNDRmNi05M2ZjLWQ2NGFiYjcxYzU0NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQxNzMxMzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMWQyZDAzMjEyMjE4ZGUwMjMwN2RjNjhkMzYyMWVlODM4MWEwYTdkNzk2MTdkMTBhMzY1YTE3NjI5NTkzMTVmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.RQfL62z783PIQaqrLDYSHTBOb70muJLm45qKbsPw-GE)
It looks great with this shader!