Wireframe with solid inside for gltf

can anyone please help me? i am trying to make a camera have a wireframe with a solid color inside that matches the background. i was able to get the wireframe part working but cant add a solid color inside. here is my codepen. https://codepen.io/joshofdevelopment/pen/Jjjdqxa

i have been looking all over stackoverflow for something that can help but cant find anything for my specific use case. here is one i found but when trying to implement
i get a bunch of errors. https://stackoverflow.com/questions/31539130/display-wireframe-and-solid-color

i believe my use case is different because my meshes are in a group from the gltf file? To be honest im not sure. My head hurts.

i think i might have to combine all the mesh children in the group first but i cant figure that out either.

Hi!
Are you trying to achieve something like that:
https://codepen.io/prisoner849/pen/PooPEeR?editors=0010

3 Likes

omg yes!!! thank you so much!

you have saved me from going insane!

Neat!

Just to add alternatives, I think I saw a different approach on StackOverflow that suggests finding the edges in the Fragment shader, which gets rid of the tessellated look and helps with line thickness

… although this version is much more complicated to execute.

2 Likes

You’re welcome :slight_smile:
But I’m sure that there can be better solution. This one is just the first that popped up in my head :slight_smile:

1 Like