Update 124 to r133 buffer geometry faces

hello people,

can anyone help me update this spectacular example by @prisoner849 to r133 please?

it uses r124’s THREE.Geometry as to use the geometry vertices and geometry faces, i have been trying for hours going round in circles trying to update to r133 bufferGeometry with absolutely no luck so far

any help would be really appreciated!!

Thank you :slight_smile:

You will find migrating instructions in this thread:

https://discourse.threejs.org/t/three-geometry-will-be-removed-from-core-with-r125/22401

@vielzutun.ch ,thanks for your reply, yes i know the thread well, i understand the basic principles of bufferGeometry attributes, i’m just struggling understanding how to access the attributes in the right way…

here is what i am trying so far, i am served with this error… image

i’m still trying with no luck, i’m using geometry.attributes.position.index.count / 3 as the count of a for loop to create triangles where the faces are and then use those traingles to calculate edges but i’m completely lost as to whyt it’s not working…

position.index.count is something strangle, it should be position.count
or, if you want to rely on index, then it’s geometry.index

@prisoner849 sorry i had the wrong code in the pen, just updated, i’m having real difficulty working it out, there’s no relativity in the original vertices count and the geometry.attributes.position.count, i’m trying, will update you if i find the solution, just trying to experiment kind of blindly till it works.

would you happen to have an explaination of how this would work?

@prisoner849 i’ve found something very odd, if i simply import the deprecated Geometry class from examples/jsm/deprecated/Geometry.js and update to R133 but keep your original code it still breaks with the error…
image

would have expected that to work, unless the deprecated Geometry.js has been completely phased out now? still digging into it

EDIT: importing the Deprecated Geometry.js file seems to work in r132 but the above error is being thrown in r133 for some reason :confused:

@Mugen87 is this a know issue in R133? i have modified this pen to demonstrate the issue… https://codepen.io/forerunrun/pen/bGrWaKK
if you change the file imports to R132 this works as expected but with r133 there seems to be an internal three.js conflict, any idea why this might be?

InstancedMesh with morph attributes is not supported. You have to delete the morph attributes of the geometry if you want to use instanced rendering.

1 Like

@Mugen87 thanks man! that did help a lot! i tried loading a glb without morph attributes so importng the Deprecated Geometry.js with r133 worked a charm!

after being able to see and debug the result i managed to upgrade the example in question to use r133 and bufferGeometry without the need to import the old Geometry class

With modification to EdgesGeometry in r145 I was able to set contitional glowing for fat lines of batched geometry :sweat_smile: :

2 Likes

Wow @prisoner849 now that’s awesome! Looks really good! How’s the performance?

@Lawrence3DPK works pretty smooth even on my 9yo machine with built-in Intel graphics :slight_smile:

1 Like

Aaand finally, conditional edges with fat lines (r145) :smiling_face_with_tear:

1 Like

Beautiful! Have you had to modify edges geometry quite a bit to achieve this? Looks great!

Yeah, changes are quite minor. Most work is in shaders :slight_smile:

@Lawrence3DPK All the stuff is here: Tetrahedra (fat lines, batching, texelFetch)