Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

THREE.js Custom Shader Doesn't Antialias Properly

Tags:

three.js

webgl

Even if I enable { antialias: true } when I initialize my renderer, the lines are not multisampled and still appear to have sharp edges. I have recreated by problem on JSFiddle that you can view here.

I suspect that the problem happens because the lines are generated by the fragment shader and are not part of the geometry itself. If that's the case, is there anything I can do to make it work the way I want?

Thanks!

like image 216
user1318416 Avatar asked Nov 13 '22 10:11

user1318416


1 Answers

This page may help. The antialiasing in WebGL isn't terribly good to begin with. I ended up using FXAA in THREE.js to get better scene quality.

like image 113
John McKnight Avatar answered Nov 15 '22 04:11

John McKnight