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

I've tried this in Shadertoy and it looks pretty good.

Can this be adapted to work with classic line segments made from quads or is it just for drawing grids in screen space?



> Can this be adapted to work with classic line segments made from quads or is it just for drawing grids in screen space?

It can be applied like a texture in the fragment shader using UV coordinates and their partial derivatives.

You can't really use this technique with line segments because the grid density up close to the camera is higher than far away. You'd need to do a lot of math to figure out where to draw your line segments. If you calculate all the line segment geometry, a fancy shader isn't required any more.


Aha, I see. Line segments from quads suffer from all the issues mentioned in the article as well, especially in the distance, but I didn't quite understand in what context is the grid shader applicable. Thank you for clearing this up.




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

Search: