Now with this method we are going to have to do a couple of rtt passes and grab different states of the shader.
The benefit of having it as a custom shader, is we can have a uniform in the main that we toggle when certain rtt renderstates are done and have our output be what ever we want.
So for example we can control it to be first the color pass of the front faces, second the color pass of the back faces, third the front face wireframes only, and last the backface wireframes.
We could then add and ramp the colors any way needed, pass the wireframes to a glow pass etc.
The sky’s the limit as long as we have barycentric coordinates on our mesh.
I always thought it was a bad way to test with a ball, because most of the models used in the scene are stereoscopic, and it was a bad way to test with a ball, so I’ll switch to a box and see the difference
The way I think about it is, normally, a cube is supposed to draw a whole face, by vertices, not by indexes, and triangles don’t have to be drawn
I guess the model is first drawn with wireframe and then pasted with transparent map
https://playground.babylonjs.com/#2EBLP5#4
Oh, I can prolly figure something out to make them quads not triangles, but I think even in your example scene there were triangles.
I bet at the very least they do two passes, one of the front faces, and one of the back then combine them.
I’m not sure if your geometry is the best for this. You might need a pro retoloplogist to clean up the geometry. They are pretty simple buildings so I bet you could handle it with a little patience in your favorite CAD program.
Look at the difference in poly counts, to achieve your effect you are going to need to do ultimate low poly like these examples. In one case I was able to get a building that was 206k polygons down to just over 3.5k and this was extremely detailed still, it was a huge skyscraper with a complex wavy roofed building as its floor complex. A little bit of hands on touch goes a long way.