This is great. Awesome effect! A lot more control of edge, but, right now I’m still having to use LineMesh to get a merged line, with a custom line width, and material that I can control. Though, this is amazing and, I can easily see its use in many things, including - “Instructions”, I still cant help but feel like the ThreeJS lines / edges need more work. Creating an edge, custom width, and coloring it, along any side of a geometry, should be properties to switch on and customize:
It could solve glow outline cases with SpriteMesh too. I mean, until an actual THREE.Neon (light emitting line) is created anyways. It would alleviate the need for THREE.line in a lot of uses cases that really want an “outline”. Right now, I have to create shapebuffer paths of existing geometries and wrap the lines where they need to go, then merge them. Its overhead. Granted, I’m not an expert, and if a better solution exists please point me in the right direction, but outlines in ThreeJS seem harder than they should be right now.
Thanks for this! This is awesome
I wish doing this was easier though, rather than having to create a whole new set of meshes and adding it in the scene
Love the demo gkjohnson! Will play around with it today.
Personally I would love if I could just mark edges in Blender like I already do for Freestyle renders, export gltf including custom vertex props and from there custom edges shader should figure out the rest in one render pass. Unfortunately my limited glsl knowledge isn’t enough to get there yet.
@prisoner849 i’m not quite sure i get what you mean, would i need to add a seperate instanced mesh for both the original gltf model with textures and such and then create a secondary instanced mesh for the conditional line segments?
Turned BufferGeometry into InstancedBufferGeometry, it’s for the outline.
Added an instanced attribute for positions instPos, also changed vertex shader.
@prisoner849 ohhh That is way more simple and efficient than the hacky approach i found!! i basically added createOutlineSegments(geometry, color) to container in a for loop for each instance and setting the oulineSegments position to the instance position…
@prisoner849 for sure, i’m just worried about performant issues if not using instanceMesh, i’m sure lineSegments is quite lightweight as it is but of course instanceMesh is always going to be more efficient in terms of performance
@prisoner849 one problem i have now is using r133 with the EdgesGeometry and createOutlineSegments functions you have created as r133, of course, no longer uses THREE.Geometry, trying to create a workaround for later versions than r124…
@prisoner849 i am having a really difficult time updating the example to bufferGeometry in r133, been trying for a while with no luck, any chance you have some pointers or guidance on how to update your example to use bufferGeometry in r133?
hey @prisoner849 i managed to upgrade your example to r133 using BufferGeometry without having to import the deprecated Geometry class was long but i managed it…
Thank you so much for all your help with this! you are a true legend!
EDIT: this only seems to work well with standard geometries with nicely spaced vertices, i think i’m still calculating something wrong and the bufferUtils.MergeVertices works strangely on models that have non uniformly spaced vertices