Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't get why the higher level frameworks can't make it easier though. I've used three.js before (without knowing any webgl) and was burned by the fact that lines can't even display consistently across devices. For example the line widths would be ignored in some cases but not others: https://threejs.org/docs/?q=line#api/en/materials/LineBasicM...


Because this is largely outside the scope of most 3D game engines. Rendering crisp 2D lines (or any anti-aliased complex vector polygon) on the GPU is hard: it involves a lot of high level decisions about how to process, structure & submit the data to the graphics pipeline. Depending on the application, one approach may be vastly superior to the other.

I do think ThreeJS should include basic thick screen space line support, though, as it covers most use cases and doesn’t add a lot of bloat/complexity to the core framework.


ThreeJS in fact has implementation for screen space 'fat lines'.

[0] https://threejs.org/examples/webgl_lines_fat.html


True. It's part of their examples, but would be worth having in core I feel, as most people are using THREE.Line for their apps/designs which is unreliable.


Do you know if these display the same across devices?

And also if the 10px limit is a hard limit or just of this demo?


I didn't actually used three.js, just studied the implementation a bit. It creates triangle geometry so I would expect it to work across all supported devices. The 10px is just the limit of demo slider.


I think it's because nice lines aren't a super big use case for WebGL. Most people use it for 3d scenes, 3d objects, etc.

In other words, I suppose that three.js doesn't have nice lines because nobody contributed it, which is usually a sign of low-ish demand. (I know nothing about three.js governance and goals so I might be mistaken)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: