-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Examples: Remove SubdivisionModifier. #21072
Conversation
Thanks! |
anyone knows a replacement for this? best for Buffer Geometry |
Offline subdivision with tools like gltfpack, Blender, or RapidCompact would be my recommendation. The implementation of SubdivisionModifier was never really robust even for Geometry, see #21067 (comment). |
my use case is generate a Terrain mesh from height map image generated mesh optimize with @mapbox/martini (https://github.com/mapbox/martini)
all is done on client side user browser |
I don't believe the three.js maintainers are able to provide a subdivision library right now. If someone would like to move SubdivisionModifier into a new repository, fix the known issues with it, and add support for BufferGeometry, that would probably be a useful project in its own right. The hard part is properly supporting UVs and other vertex attributes. |
thx a lot @donmccurdy for the clarification! will test the alternatives |
On second thought — finishing the work described by PixarAnimationStudios/OpenSubdiv#247 and getting OpenSubdiv compiled to WASM would be even better. That's a robust subdivision implementation, and would be valuable to have available in the web ecosystem. |
This comment has been minimized.
This comment has been minimized.
Hi, sorry for commenting again. How could my previous comment become disruptive content? We are in a university and teaching students for using your excellent work, thus we appreciate your work a lot. but removing it without providing an alternative solution actually breaks the educational content, and very unfortunately there are no provided solutions from what I saw in this thread. Of course, the OpenSubdiv is an alternative solution but the setup cost for students goes much higher. The only solution would install v124, but it is actually discouraged from the community, am I right? |
not sure from where his comes from https://github.com/mtnguru/ab/blob/1cd76561c4780a69e4db6e3287abec384499897d/js/threejs/modifiers/BufferSubdivisionModifier.js |
@donmccurdy would this be a good alternative? |
@arpu Looks great, thanks a lot! is it possible to merge it back or at least document the breaking change? |
three.js is an open source library and relies on contributors to maintain. SubdivisionModifier was effectively unmaintained, had serious bugs, and depended heavily on long-deprecated parts of three.js. With no contributors supporting something, that thing is likely to be eventually removed to allow the project to grow. The removal of SubdivisionModifier was documented under the r125 release notes. If someone would like to test |
And in the migration guide 😇 . https://github.com/mrdoob/three.js/wiki/Migration-Guide#r124--r125 BTW: I think we should also discuss if new modifiers should be added to the repo (see #21014 (comment)). I see them in third-party repositories. |
I recently implemented a new subdivision modifier for BufferGeometry using Loop subdivision. It does a pretty good job handling uv's, with an option to enable / disable the Loop averaging on uv coordinates. I did play with a Catmull-Clark version as well but I'm not that happy with it and haven't included it in the repo for now... I was able to achieve better results using Loop with a pre-split pass before smoothing. This enables much better smoothing of boxes / sharp corners. This thread was one of the first I came across when googling for a working BufferGeometry subdivision modifier, I thought I'd drop a link here for others looking for something similar. |
@stevinz Hmm, do you think we could/should bring back |
@mrdoob I think the Personally, I feel pretty good about my implementation. It does a nice job with all the built-in geometries and was specifically tested using geometries with 'position', 'normal', 'uv', and 'color' attributes. It does attempt to handle other attributes contained within the geometry, but it has not been tested much against geometries with other attributes. A few negatives I should mention, though:
I know there was discussion about reducing the amount of code to be maintained within three.js. However, if there is interest, I can submit a PR to bring back the |
I vote for that, as it reduces the burden on the three.js maintainers. |
Related issue: see #21067 (comment)
Description
This PR removes
SubdivisionModifier
.