-
Notifications
You must be signed in to change notification settings - Fork 24
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
Any chance of Merge geometries? #6
Comments
For the moment i solved using BufferGeometryUtils, instead geometry.merge, it worked via gltfexporter! edit: i thought that i solved but positions are not preserved with this method... any help would be very appreciated! |
I tried to build zen-3d with a merge function implemented from threejs geometry... i needed to initialize some arrays... and import matrix3 i needed to put getNormalMatrix on matrix3 no errors.. but no geometry lol :D |
Im just trying to merge plane buffers, like mr doob did in a old cloud experiment…
So a cloud made of bunch of clouds merged is much more performant…
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Shawn Xie<mailto:notifications@github.com>
Sent: Wednesday, April 1, 2020 10:47 PM
To: shawn0326/zen-3d<mailto:zen-3d@noreply.github.com>
Cc: VanderSP<mailto:Xtronoid@live.com>; Author<mailto:author@noreply.github.com>
Subject: Re: [shawn0326/zen-3d] Any chance of Merge geometries? (#6)
Can you send me some examples to reproduce the problem? I will implement a geometry merge method later, but I'm not sure if this will solve your problem.
In addition, I checked the BufferGeometryUtils.mergeBufferGeometries method of three.js and it seems that if the atrributes of geometries do not match, the method will be skipped. Determine if the merged geometries will render properly in three.js?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANQVCXMYPNKXOV5BVLKNXYLRKPVBDANCNFSM4LY5WUZA>.
|
@VanderSP |
https://mrdoob.com/lab/javascript/webgl/clouds/ in this fashion style of coding calling .merge to join geometries in a faster one the source of this demo: <title>Clouds</title> <style type="text/css">
|
the shader is simple i converted already to zen3d, note that this example is OLD, so that utils is now on geometry.merge (and must call updateMatrix just before each merge) |
when i said about exporting and reimporting... was a way to try to avoid you creating the merge.... but gltf didnt liked merged... so i keep gltf just for simple geometry that we dont have on zen..so i can stuff from three to zen... and later i talked about my failed attempt to stuff a .merge on your geometry.js lol |
I modified the example to use THREE.BufferGeometry & THREE.BufferGeometryUtils.mergeBufferGeometries, and it works.
And I will implement the mergeBufferGeometries method in zen3d later and try this example. |
when i tried mergebuffergeometries (then exported it to zen3d via gltfexporter) it dont keep the positions of geometries... just stacked the clouds... when i used geometry.merge and exported to zen3d it got no geometry at all but wait, you are on THREE, im on zen3d, how do you merge in zen? |
i use this to convert between
|
Yeah your trick to recover position worked, i did with three things and exported gltf to zen, now position mantains!! at least is a solution! thanks Shawn! |
Done! zen-3d/examples/js/GeometryUtils.js Line 152 in 388c9b5
zen-3d/examples/lab_clouds.html Line 170 in 388c9b5
|
I will test it now... but just for curiosity, i tried the lab_clouds example via raw.githack... why it´s totally slow? do you think that the merging not really happened in performance level? |
Testing performance on my computer is normal. Also, weirdly, testing on mobile devices https://mrdoob.com/lab/javascript/webgl/clouds/ This page has very low performance, but my example is normal ... I can be sure that there are only two geometry in the scene.
|
i tried on laptop i7 chrome browser windows 10 gt630m using your html on raw githack misteriously veeery slow |
This code is for not stacking same positions.... it should be done in a .merge of the class in the future?
|
Yes, I will refactor this method later, maybe I should implement the geometry.applyMatrix4 method BTW. i just found a bug, normal vector should apply normalMatrix in transformNormalAttribute method |
Nice! the material must be both on the plane as in the final mesh? |
In this case, plane's material is not necessary. |
Oh yeah i forgot about zen defaulting antialias to true.... and there´s no such advantage on this billboard transparent case... after setting it to false, i earn a lot of fps... even in my gt630m, when clouds got near the camera it dropped to 6... after antialias false ~30fps... so that bottleneck was this (lol, not even metering the merge difference so... i will make more tests) about stencil true or false, i dont really understand how can affect in this case... but i guess that im fine with the default that´s false, right? |
I'm not sure, just in case, in general there is no difference. |
it´s very usefull for performance reasons... im trying to merge in threejs then gltfexporting to zen, but seems like geometries not generated... and i´ve already did this trick to use extrudebuffergeometry from three to zen, as another geometries that zen-3d don´t have yet... and it worked... but this time with merged, i dunno if it´s possible...
Sincerely, your project is very important to me... many thanks at moment!!!
The text was updated successfully, but these errors were encountered: