veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

294
active users

#shader

6 posts6 participants0 posts today
Replied in thread

@jasoncoon recently posted a cube shader that runs colorwaves around the cube's perimeter. I tried expanding that to three nesting cubes.

This color scheme is a throwaway, but I tried a spatial dither to smooth the hue changes at low brightness. There are interesting possibilities to explore there.

Source: gist.github.com/kbob/c93e9fcfd
Jason's post: leds.social/@jasoncoon/1149734

In #GLSL there is no isfinite(), so when you're doing an unsafe division, you need to check both isinf() *and* isnan(). Why? Because x/0.0 is inf, unless x=0.0 in which case it's NaN... And this makes me sad.

The trick r==r doesn't work because it is true for inf: it only works as an alternative for isnan() :(

Edit: I guess I could do

bool isfinite(float x) {
return (floatBitsToUint(x) & 0x7f800000u) != 0x7f800000u;
}

Just learned that my little visual cosine gradient generator tool (from 2015) is featured in this popular video tutorial (1.1M+ views) about artistic shader programming:

youtu.be/f4s1h2YETNY?t=971

The tool is still here:
dev.thi.ng/gradients/

If you want to use these gradients outside shaders (e.g. for dataviz purposes), the actual gradient functionality is also included in these two libraries:

thi.ng/color (TypeScript/JavaScript)

Related readme section with presets and code examples:
github.com/thi-ng/umbrella/blo

Clojure/ClojureScript version:
github.com/thi-ng/color/blob/m

The box cut is not perfect but we're getting there!

Edit: also, fun stuff, I realized I could return transparent pixels, so the web page background takes over and it looks like the shape is floating on it. It's stupid but I love it :3