You should be able to achieve this rendering with a standard material.
Regarding the edge rendering, in the viewer they are simply drawing lines over the geometry.
You can try to generate the edges automatically in Babylon using the edge renderer or the screen space curvature post process, but as it is an automated process it does not always render the edges as you would like them and you won’t have a lot of control about that.
Yes, it’s looks way more like the reference with pbr marterial. And edge rendering plays definetely the most important role that the model looks like a drawing. I adjusted some parts of the cad in blender, added metallic pbr and enabled edgeRendering.
The result looks promising. But as you mentioned Evgeni the edgeRendering isn’t perfect - some lines are missing and sometimes there are two lines next to each other. What’s the best way to improve the edgeRendering? I am sure that the babylonjs team has created a way better script than I could. So manipulating the edgeRendering.js wouldn’t be very effective.
You can try to update the options passed to enableEdgesRendering (IEdgesRendererOptions | Babylon.js Documentation) as well as testing with other values for the first parameter (which is 0.95 by default).
But as explained, it will be very difficult/impossible to get rid of all the artifacts because the processing is using a heuristic to detect edges that does not always work. That’s the reason why the 3D viewer you pointed to previously does not use an automated process but draw real lines instead. That’s something you can do in Babylon too, but you will need to provide the starting/ending points of each line yourself (which can certainly be tedious).
Edge rendering also shows some geometry flaws which model has. So you can either manually correct geometry/polygons in problem areas (which is not the solution which I’d like, especially when you have hundreds of STP files) with DCC tool; or try to make edge lines a bit smoother and less contrast - https://playground.babylonjs.com/#LJG6ZD#8
Too bad that there is no universal solution. But I will try to wreak the parameters.
You’re right, @labris, there are some geometrical artifacts. That’s always a problem, but since I don’t have hundreds of cad models in this case I can modify the mesh in blender. Thanks for the article and pgs too. That looks good.