Thin edge on entire object

Hey guys, … long time no see you :slight_smile:
I have a small issue. I want to show a thin wire on edges, and this is almost working by enableEdgesRendering() but seems to be not enough. Inside edges missing.
https://playground.babylonjs.com/#1P4HGN#1

Any sugestion is welcome. Cheers!

1 Like

I don’t know what the problem is, but I feel it’s easier to see what’s going on with this setup:

https://playground.babylonjs.com/#1P4HGN#3

I didn’t understand at first that the box was hollowed!

Hi.
Inside lines are missing


They apear but not all the time, and depend on camera position
image

It’s a typical z-fighting issue, which is not so easy to correct…

One can use the zOffset parameter of the material used to draw the lines to mitigate the issue.

As this material is not directly exposed, you will need a small hack:

    batten.edgesRenderer._lineShader.zOffset = -3;

@Deltakosh: maybe _lineShader could be made visible to the outside? Or simply a method to change the zOffset value on the EdgesRenderer?

https://playground.babylonjs.com/#1P4HGN#4

It does work to a degree, but depending on the view angle you will still experience disappearing edges. You can play with the -3 value, but you will also see some artifacts with values too low.

2 Likes

Thanks Evgeni. I’ll use like this for now. Cheers!:beers: