Xor

Xor

@xordev.com

Building FragCoord.xyz xordev.com

4.6K followers162 following1.4K posts

Pinned

Wave f z,d @(20) { f3 p = z * nor(2*C.rgb - R.xyy); d=4; @(6) d+=d, p = p.yzx+sin(p * d - T) / d; z += .1-len(p)/9; O += z*z*f4(2-sin(p*5),)/(.001+len(f4(sin(p*33)/99,p))) } O = tanh(O / 4e2)

Xor reposted

I made a little demonstration of how bloom works via the fast successive downsampling + upsampling/combining technique. All of this runs in 0.1ms at 4k! (link to more explanation below)

FragCoord has over 1,500 users and over 2,100 (>2% of ShaderToy) shaders and 94 articles so far! Reworking the interfaces to be less clunky and then working on tools to help developers intelligently optimize their code

I am quite happy with the versatility of FragCoord, but not happy with accessibility yet. It's hard to navigate code snippets, or write articles. Recording a video is clunky. Resolution, compute pipeline and texture settings are hard to find. What would you like to be prioritized?

Very cool! How does GameMaker make money?

GameMaker@gamemaker.io

📢 Some exciting news! 🎉 Our upcoming next-generation runtime, GMRT, will be free for commercial use and source avaliable for all non-console platforms! READ MORE gamemaker.io/en/blog/gmrt...

Xor reposted

Good advice, I'd add reverse depth testing to the list developer.nvidia.com/blog/visuali...

developer.nvidia.comVisualizing Depth Precision | NVIDIA Technical BlogDiscussion and diagrams to help you understand how nonlinear depth mapping works in different situations, intuitively and visually.
Tom Forsyth@tomforsyth.bsky.social

Starting a new project? Turn on and enforce the following right now: -sRGB for all rendertargets and source textures. -premultiplied alpha in both textures and blending. -fixed-point world time and world position. Retrofitting these after the fact is a giant pain. Learn from my (repeated) fail!

Worth considering

Tom Forsyth@tomforsyth.bsky.social

Starting a new project? Turn on and enforce the following right now: -sRGB for all rendertargets and source textures. -premultiplied alpha in both textures and blending. -fixed-point world time and world position. Retrofitting these after the fact is a giant pain. Learn from my (repeated) fail!

The levels of shader math (in my opinion): 0. Linear, Multiply color by a brightness scalar 1. Steps, Floor coordinates for pixelation 2. Vectors, Center and correct aspect ratios 3. Geometric, Dot product for lighting 4. Exponential, Square distance falloff

5. Trigonometry, Revolving light source 6. Matrix, Coordinate space transformations 7. Bitwise, Bitpacking G-buffers 8. Derivatives, tangent space normal mapping 9. Integration, analytic volumetric fog rendering

Should you replace x/y with x*(1.0/y) for shader optimization? If "y" is a constant, it makes no difference. Modern compilers optimize this either way. If "y" is not constant, x*(1.0/y) may be marginally faster on some hardware. Better to compute the reciprocal if used a lot.

Nuclear f2 c, p=(2*C.xy-R)/R.y*35 @(9) p*=m2(sin(T*.1+f4(0,33,11,0))), c+=cos(p) O+=tanh((.1+c.x*c.x)*.1*xp(.5*f4(-1,0,1,)*c.y)/(.1+abs(c.y)));

Xor reposted

Seeing Oklab enjoyed and used by so many is mind-boggling! I still can’t quite comprehend that I wrote a blog post that ended up as a web standard and in software everywhere. Best part is seeing so many people say they enjoy Oklab and that it is a tool they regularly use.

Xor@xordev.com

If you need a random color (e.g. procedurally coloring objects), you should use Oklab or Oklch color space instead of RGB or HSV. RGB may span the whole spectrum, but it does not pick fairly (leaning dark/muddy). Oklab is designed to more closely map to how we perceive color

If you need a random color (e.g. procedurally coloring objects), you should use Oklab or Oklch color space instead of RGB or HSV. RGB may span the whole spectrum, but it does not pick fairly (leaning dark/muddy). Oklab is designed to more closely map to how we perceive color

View full thread

If you need a random color (e.g. procedurally coloring objects), you should use Oklab or Oklch color space instead of RGB or HSV. RGB may span the whole spectrum, but it does not pick fairly (leaning dark/muddy). Oklab is designed to more closely map to how we perceive color

In other words, equal steps in R, G or B do not produce equal visual changes. We are more sensitive to green than blue for example. Uniform sampling in RGB gives us darker, grayer colors than we might want. HSV or HSL is a little better, but still not ideal

HSV/HSL will bias towards grays, since there are many ways to create a gray in HSV. Hues are not even either. Some hues appear brighter and stronger than others

Woven 2 f2 c, p=C.xy/R.y*9 @(9) p*=m2(6,-8,8,6)/7, p+=sin(p+T)/2, c+=fwd(p)*R.y/3e3 O+=dot(c,c);

"Woven" f2 c, p=C.xy/R.y*9 @(9) p*=m2(6,-8,8,6)/7, p+=sin(p.yx+T)/2, c+=fwd(p)*R.y/3e3 O+=dot(c,c);

Xor reposted

In Mario Kart Wii, asphalt is slightly shiny, reflecting a band of light ahead of the player. This is implemented cleverly by leveraging something that the Wii is already doing, allowing it to not need to use any sort of additional lighting or post-processing.

Amazing

NocaToca@nocatoca.bsky.social

It's like looking into a mirror... Smth I made using fragcoord recently. Ive been convinced to share. fragcoord.xyz/s/sf602uma

Can't believe it's only $30

WeLoveIndieGames@weloveindiegames.bsky.social

Order of the Sinking Star is a massive puzzle game with 1000+ interconnected challenges, evolving mechanics, and unique characters in a nonlinear, exploration-driven world. 🏆 99% of 144 reviews ▶️ See it on Steam ($29.99) #steam #pcgaming #gaming #steamgame

Tunnel f2 c=(2*rnd(C.xy)-R)/R.y c=f2(atn(c.y,c.x)/2,sqt(dot(c,sgn(c)))*2-T*.5) @(9)c.yx+=sin(rnd(c)*5+T*.1); O=tanh(fwidth(c)).xyxy

The winners are: @noztol.bsky.social s "Making A Melting Cube" and @halbfettkaese.bsky.social's "Adjusting animation speed" Thanks for participating!

Xor@xordev.com

Less than 4 weeks left to write the best article for FragCoord. It could be a tutorial, breakdown, devlog, showcase anything graphics related. I'll be giving the best ones a FragCoord Pro for a year (which unlocks 3D buffers, compute shaders, MRT and more)

f2 u = (2*C.xy-R)/R.y,v=u/dot(u,u)+.1*T O=tanh(.1*len(O.rgb=1/(1-cos(v*mat3x2(-8,0,4,7,4,-7)))/len(u)/9)+O)