Kekule.js icon indicating copy to clipboard operation
Kekule.js copied to clipboard

Issue with image quality

Open schneiderfelipe opened this issue 3 years ago • 2 comments

I am having a small issue with the quality of the image produced by Kekule.ChemWidget.Viewer3D. Namely, the image seems a bit pixelated (see below).

pixelating

It is likely due to the light-colored background, but I think I might tweak the rendering through three.js. Is there an easy way to smooth the 3D rendering? Thanks in advance!

schneiderfelipe avatar Oct 15 '20 21:10 schneiderfelipe

Hi @schneiderfelipe, please check the latest dist file in this repository, the antialias of WebGL context is turned to on by default in it. Of course you can turn it off for performance in certain limited devices:

viewer.getRenderConfigs().getEnvironmentConfigs().setAntiAlias(false);
viewer.resetRenderEnvironment();

Further more, you can also use the following code to improve the rendering quality of a 3D viewer:

viewer.getRenderConfigs().getEnvironmentConfigs().setGraphicQuality(Kekule.Render.Render3DGraphicQuality.EXTREME_HIGH);  // default is MEDIUM

partridgejiang avatar Oct 17 '20 04:10 partridgejiang

Hi @schneiderfelipe, please check the latest dist file in this repository, the antialias of WebGL context is turned to on by default in it. Of course you can turn it off for performance in certain limited devices:

viewer.getRenderConfigs().getEnvironmentConfigs().setAntiAlias(false);
viewer.resetRenderEnvironment();

Further more, you can also use the following code to improve the rendering quality of a 3D viewer:

viewer.getRenderConfigs().getEnvironmentConfigs().setGraphicQuality(Kekule.Render.Render3DGraphicQuality.EXTREME_HIGH);  // default is MEDIUM

Excellent, thanks a lot!

schneiderfelipe avatar Oct 17 '20 15:10 schneiderfelipe