Live data from Hacker News

Interactive intro to shaders

mayerowitz.io

11–20 of 72 posts

Re: Interactive intro to shaders

#13
This is neat! I've gone down the SDF rabbit hole a bit, recently. I'm glad you added some links to iq's site; he's got great stuff.

I feel compelled to link to his "happy bouncing" shader, which is phenomenal IMO: https://www.shadertoy.com/view/3lsSzf

(with associated 6 hour (!) youtube video on its creation)

That's a juicy ~500 lines of code (:

Re: Interactive intro to shaders

#14

I finally found the courage to write and expose myself to the internet. I've always wanted to learn shaders so I thought it would be nice to document my learning and share it with others.

This article is super fun. Thanks! I was curious if you’ve learned WGSL, the shader language for WebGPU? I’m struggling to wrap my head around what’s similar and different.. a fun and interactive guide like you’ve done here with GLSL would be amazing.

Re: Interactive intro to shaders

#15
The article is quite nice. However, it glosses over the primary problem with shaders.

A shader is a pain in the ass that most programs and applications don't want.

3D stuff likes triangles and the GPUs are happy to slot into that abstraction. Shaders are useful to interpolate over those triangles.

Triangles are mostly garbage for everybody else. 2D rendering wants paths. Font rendering wants paths or pixmaps. GUI's would work much better with paths and pixmaps. Compositors really want pixmaps. Video decoders really want pixmaps and parallel rendering.

What everybody non-3D wants is rectangular pixmaps and access to computation directly to those pixmaps. And GPUs don't like this very much, and shaders don't map very well to this.

Re: Interactive intro to shaders

#16

I finally found the courage to write and expose myself to the internet. I've always wanted to learn shaders so I thought it would be nice to document my learning and share it with others.

You can improve your antialiasing, assuming you're willing to use the well-supported OES_standard_derivatives extension (or WebGL 2). Instead of doing smoothstep(0.0f, 0.01f, dist); with the constants picks sort of at random, instead do smoothstep(fwidth(dist), -fwidth(dist), dist);

Re: Interactive intro to shaders

#17
post #10

I finally found the courage to write and expose myself to the internet. I've always wanted to learn shaders so I thought it would be nice to document my learning and share it with others.

Tangential to the main topic, what generative art artists are you following and/or where did you look to find them? I found a couple myself (@D_VISION7 @lv374 @beesandbombs @HAL09999), but ran into roadblocks trying to find more. There are a few fractals here and there, etc. Shadertoy seemed mostly like math demos/challenges rather than art, or at least it doesn't have an easy way to find the artsy ones.

Here’s a few artists you might like: @FEELSxart @ilithya_rocks @generativelight @thresfold @Tezumies @_nonfigurativ_ @Olga_f2727

Re: Interactive intro to shaders

#20
post #15

The article is quite nice. However, it glosses over the primary problem with shaders. A shader is a pain in the ass that most programs and applications don't want. 3D stuff likes triangles and the GPUs are happy to slot into that abstraction. Shaders are useful to interpolate over those triangles. Triangles are mostly garbage for everybody else. 2D rendering wants paths. Font rendering wants paths or pixmaps. GUI's w…

What part of a pixel/fragment shader does not map very well to pixmaps?
Post reply on HN