Jagged and dotted boxes

dear all,

I am using MeshBuilder.CreateBox to create boxes. But as you can see in the attached image, the lines are jagged and dotted. How can I remove them/improve the output?
problem

Thanks in advance for any help

This looks like an aliasing issue. First you should enable AntiAliasing on the engine (the 2nd parameter of the constructor to true).

If that does not help, you may be on a device with high DPI so you could use : engine.setHardwareScalingLevel(0.5) to adapt to the device native pixels change the value in the parameter, the lower the bigger the quality but the slower.

@sebavan. Thanks for your reply. Using engine.setHardwareScalingLevel(1) and calling DefaultRenderingPipeline I got a better quality but not that much. I also turned on the engines adaptToDeviceRatio option, but still have the issue there.

You should try to use smthg smaller than one, also you should try to ensure the canvas is not rescaled after the engine starts without calling resize() on engine.

Can you reproduce the quality issue in the playground ?

@sebavan, thanks again for your helpful comment. In my project to keep the size of the texts unchanged when zooming, I was scaling the size of the text to align with the zoom size. With calling the resize() on the engine I got very nice output.
Thanks again

1 Like