Hacker Newsnew | past | comments | ask | show | jobs | submit | sixstring982's commentslogin

Very nice! Reminds me of something I built on Shadertoy a while back: https://www.shadertoy.com/view/4ttGRf


Nice! Where does one learn how to do this kind of thing (aside from the fractals)?


https://iquilezles.org/ is a legend, see the articles and video tutorials.

Aside from shadertoy I use https://glslsandbox.com/ (for some reason it has https errors now). It's the same concept and it has a lot of submissions that are more basic than shardertoy where you can easily change lines and see what happens.

My intuition for these kind of shaders: They are just pure functions mapping an x,y coordinate to a color (optionally making use of time and cursor position). From this you can derive anything, like drawing a circle by choosing black or white depending on the distance from the center. There is a lot of intuition to gain and it's fun playing around, because as long as it compiles you will see something and you are likely to be surprised about what you accidentally made. Very rewarding.


I built an OCaml starter project for Advent of Code that I've been using. Take a look if you'd like to give OCaml a spin!

https://github.com/Sixstring982/tanenbaum


Or just use recursion?

But hey, this article is an interesting way to get around that!


Well, I pointed out at the beginning that one can use recursion, and the implementation of the `while` construct itself uses recursion as well (in fact, you can't implement `while` without it in Elixir).

In any case, expressing the equivalent of a `while` loop with predicates and timeouts is quite syntactically noisy in Elixir - it is certainly doable, but much less clear than the imperative equivalent.


Hey nice, this is really cool!

This reminds me of some of the stuff on http://shadertoy.com . One of my favorite websites!


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

Search: