You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some surface and line plots recently and found the amount of aliasing rather distracting. Then I discovered SMAA and SSAA postprocessing in three.js and tried to add them to the plots. After a lot of trial and error (I'm not really familiar with js/ts and dev workflow) I was lucky and got:
(from left to right: master branch, master + smaa, master + ssaa)
There is WebGLRenderer(...antialias=true...) but never saw any antialiasing applied. Are plots supposed to be antialiased? If not, optional SSAA would be a very nice feature.
Misc:
I had to modify three.js/postprocessing/SSAARenderPass to render multiple scenes to make it work, and ignored large parts like volume rendering and resize events, so its a rather hacky solution
the plot looks the same in Firefox, Chrome and Linux, Windows
The text was updated successfully, but these errors were encountered:
part2
Out of curiosity I tried to figure out how SSAA would work for volume rendering and didn't find a simple solution. Then I noticed WebGLMultisampleRenderTarget which was introduced to threejs in r101. Again, dodging the obstacles as they appeared I managed to bump threejs to r137 and got a nicely multisampled output.
r101 didn't work because of a stencil format issue which was fixed in r106. r106 didn't work because for some reason rendering to the multisampled target would force clear. So I decided to try r137 and there the issue has been resolved. The necessary adjustments to ipyvolume were minor, just one obstacle remained: pythreejs deserializes the ShaderMaterial objects without three.ShaderMaterial as prototype. I "fixed" it by using Object.setPrototypeOf just before the exception (before material.onBeforeRender in three.module.js:~27080). Obviously volume rendering is still broken, but maybe the remaining issues are easier to solve.
Long story short: I believe ipyvolume would benefit from a more recent version of threejs. Afaik the main obstacle is pythreejs which isn't going to support newer releases of threejs anytime soon (jupyter-widgets/pythreejs#359).
Anyways, it was a fun experience and maybe someday its actually useful. If anyone is interested, I will fork and push the changes.
Hi,
I did some surface and line plots recently and found the amount of aliasing rather distracting. Then I discovered SMAA and SSAA postprocessing in three.js and tried to add them to the plots. After a lot of trial and error (I'm not really familiar with js/ts and dev workflow) I was lucky and got:
(from left to right: master branch, master + smaa, master + ssaa)
There is
WebGLRenderer(...antialias=true...)
but never saw any antialiasing applied. Are plots supposed to be antialiased? If not, optional SSAA would be a very nice feature.Misc:
The text was updated successfully, but these errors were encountered: