Xor
@xordev.com
📤 3543
📥 157
📝 923
Shaderboy xordev.com
pinned post!
Here are some techniques I discovered through 14 years of shader programming:
1 day ago
4
161
35
Here are some techniques I discovered through 14 years of shader programming:
1 day ago
4
161
35
Orchard vec3 p,v=normalize(FC.rgb*2.-r.xyx),c=v/v.y;c.z+=.5*t;for(float z,i,b,g,m;i++<5e1;z+=.8*max(b=length((p.y-m)/1e2/(abs(sin(c.xz/.1))-.05/v.y)),min(4.-m,g=length(sin(p.xz)+1.-.1*(1.+sin(p.y-p.zx*.5))*m))-b),o.rgb+=(.7-v)/(g+b))p=z*v+1.,p.z-=t,m=abs(++p.y);o=tanh(o/5e2);
loading . . .
1 day ago
3
58
5
Reef for(float z,d,i;i++<5e1;z+=d,o+=(.9+sin(i*.1-vec4(6,1,2,0)))/d/d/z+d*z/vec4(4,2,1,0)){vec3 p=z*normalize(FC.rgb*2.-r.xyx);for(d=0.;d++<9.;)p+=.4*sin(p.yzx*d-z+t+i)/d+.5;d=length(vec4(abs(p.y+p.z*.5),sin(p-z)/7.))/(4.+z*z/1e2);}o=tanh(o/2e3);
loading . . .
1 day ago
0
77
13
Port vec3 w,p;for(float z,d=.1,i,f;i++<1e2;o+=.03/abs(mix(p,w,.1).y+vec4(0,1,2,3)/1e2)*d,z+=d=.3*(length(cos(p.xz))-.4))for(p=z*(FC.rgb*2.-r.xyy)/r.y+1.,w=p,f=0.;f++<5.;)w+=sin(w.zxy*f-9.*exp(-d/.1)+t)/f;o=tanh(o);
loading . . .
2 days ago
0
67
8
The start of greatness: for(float i,d,z...
2 days ago
2
12
0
Game devs, look at your game in grayscale. How does the contrast look? Is lighting used intentionally (e.g. to separate elements from the background)? Also use texture sharpness for focus points and lower detail for backgrounds
6 days ago
1
20
1
vec3 rotate(vec3 pos, vec3 axis, float angle) { return mix(dot(pos, axis) * axis, pos, sin(angle)) + cos(angle) * cross(axis, pos); }
6 days ago
2
18
1
Structure Normals Here's a quick thread of raymarching tricks, tested on this scene. First, how to compute normals...
add a skeleton here at some point
7 days ago
1
44
6
reposted by
Xor
GameMaker
7 days ago
It's with a very heavy heart that we share the news of YoYo Games founder and original CEO, Sandy Duncan's passing. GameMaker would not be where it is today without Sandy and our hearts are with his family at this very difficult time. Rest in peace.
www.linkedin.com/posts/sandyd...
loading . . .
Hello, Caitlin here, Sandy’s wife. With a few of his good friends - Michel, Jesse, Spencer, Mike, Russel, Stuart, we have put together Sandy’s last message as he would have liked to send it to you… | ...
Hello, Caitlin here, Sandy’s wife. With a few of his good friends - Michel, Jesse, Spencer, Mike, Russel, Stuart, we have put together Sandy’s last message as he would have liked to send it to you all...
https://www.linkedin.com/posts/sandyd_hello-caitlin-here-sandys-wife-with-a-activity-7425164308071759872-pvhF/
5
228
82
Drip vec2 p=(FC.xy*2.-r)/r.y*vec2(10,1), a=vec2(.5,.1), f=fract(vec2(p.x,p.y+t*4./PI+sin(ceil(p.x)/.1+t)))-a, m=1.-max(f/(1.-a),-f/a); o+=tanh(.1/(1.-m.x))*m.x*m.y;
loading . . .
7 days ago
1
64
5
Particles vec3 p,v;for(float d,z,i,f;i++<6e1;p=z*normalize(FC.rgb*2.-r.xyy),p.z+=9.)z+=d=.4*max(f=abs(z-5.)*.05,length(vec4(dot(sin(p),sin(p/.6))-length(p)+5.,sin(p/.1+t)*cos(p.yzx/.1+t)*.3))-f),o+=(cos(p.y+i*.2+d/.2+vec4(0,1,2,3))+1.1)/d;o=tanh(o*o/3e5);
loading . . .
8 days ago
0
30
2
Structure vec3 q,p;for(float d,i,l;l++<1e2;p+=normalize(round(FC.rgb)*2.-r.xyy)*d)for(q=p-8.,d=q.y,i=1e2;i>.4;i*=.3)q.xz*=.1*mat2(8,6,-6,8),d=max(d,min(min(q=i*.8-abs(mod(q,i+i)-i),q.y).x,q.z));o=vec4(1,1.2,1.4,1)-fwidth(ceil(p.z/.1));
9 days ago
3
64
15
Mainframe vec2 p=abs(FC.xy*2.-r)/r.y/.4,v;for(float i,l,f;i++<9.;o+=.02/(l=length(sin(v)))/l*(cos(i*.3+l-vec4(4,5,6,0))+1.))for(v=p-i*.2,f=0.;f++<7.;v=(v+sin(ceil(v.yx+i*.1)*9.+t)/f).yx);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.05*sin(FC.xy+FC.yx/.6))/r))*o),0.);
loading . . .
11 days ago
0
70
6
Buffer vec2 p=(FC.xy*2.-r)/r.y; float l=length(p)-.6,a=atan(p.y,p.x)+t*.5; o=tanh(.3*(.7+vec4(-p,p))*dot(p,cos(t+vec2(0,2)))/length(vec2(min(l*4.,l)*4.,cos(a*8.)-.9)));
loading . . .
13 days ago
1
46
3
reposted by
Xor
Coloring 0: Capped brightness
5 months ago
1
17
4
vec2 p=(FC.xy*2.-r)/r.y,v; o=tanh(.03*vec4(2,1,1.+p) /(.05+max(v+=length(p)-.5,-v/.1)).x /(.1+abs(p.x-p.y)));
14 days ago
1
49
8
Frames vec2 p=(FC.xy*2.-r)/r.y/.4,v;for(float i,l,f;i++<9.;o+=.04/abs(l=length(v)-1.)*(cos(i*.3+.1/l+vec4(0,1,2,3))+1.))for(v=p,f=0.;f++<7.;v=(v+sin(v*f/.6+i*.3+cos(i+vec2(0,2)+t/2.))/f).yx);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.02*sin(FC.xy+FC.yx/.6))/r))*o),.0);
loading . . .
14 days ago
1
42
6
Phoenix vec2 p=(FC.xy*2.-r)/r.y/.4,v;for(float i,l,f;i++<9.;o+=.01/(l=length(v*v.yx))*(cos(i/4.+v.y+vec4(0,1,2,4))+1.))for(v=p,f=0.;f++<9.;v+=cos(ceil(v.yx*f+i*.1)+t/2.)/f);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.05*sin(FC.xy+FC.yx/.6))/r))*o),.0);
loading . . .
15 days ago
2
66
6
Event 2 vec2 p=(FC.xy*2.-r)/r.y/.3,v;for(float i,l,f;i++<9.;o+=.1/abs(l=dot(p,p)-5.-2./v.y)*(cos(i/3.+.1/l+vec4(1,2,3,4))+1.))for(v=p,f=0.;f++<9.;v+=sin(ceil(v.yx*f+i*.3)+r-t/2.)/f);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.04*sin(FC.xy+FC.yx/.6))/r))*o),.0);
loading . . .
15 days ago
1
71
12
Event 1 vec2 p=(FC.xy*2.-r)/r.y/.3,v;for(float i,l,f;i++<9.;o+=.03/max(l=length(p)-2.-1./(v.y-v.x),-l*9.)*(cos(i/3.+.1/l+vec4(0,1,2,3))+1.))for(v=p,f=0.;f++<9.;v+=sin(ceil(v.yx*f+i*.7)+r-t/2.)/f);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.03*sin(FC.xy+FC.yx/.6))/r))*o),.0);
loading . . .
15 days ago
1
45
6
RAM
loading . . .
15 days ago
0
20
0
Observer vec2 p=(FC.xy*2.-r)/r.y/.2,v;for(float i,l,f;i++<1e1;o+=.03/max(l=length(v)-i,-l*3.)*(cos(t-i*.4+.1/l+vec4(0,1,2,3))+1.1))for(v=p,f=0.;f++<9.;v+=sin(ceil(v*f+i*.9)-t/2.)/f);o=max(tanh(o+(o=texture(b,(FC.xy+r.y*.05*sin(FC.xy+FC.yx/.6))/r))*o),.0);
loading . . .
15 days ago
1
48
4
Rocaille 2 vec2 p=(FC.xy*2.-r)/r.y/.3,v;for(float i,f;i++<1e1;o+=(cos(i+vec4(0,1,2,3))+1.)/6./length(v))for(v=p,f=0.;f++<9.;v+=sin(v.yx*f+i+t)/f);o=tanh(o*o);
add a skeleton here at some point
17 days ago
2
93
17
Rocaille vec2 p=(FC.xy*2.-r)/r.y/.3,v;for(float i,f;i++<1e1;o+=(cos(i+vec4(0,1,2,3))+1.)/6./length(v))for(v=p,f=0.;f++<9.;v+=sin(v.yx*f+i+r+t)/f);o=tanh(o*o);
loading . . .
17 days ago
3
56
8
One person who is skilled in multiple relevant domains is more valuable than a team with independent skills. If you're a programmer, learn art/design. If you're an artist, learn code
22 days ago
4
23
4
reposted by
Xor
Daniel James Diggle
22 days ago
I'm going to be available for new freelance projects at the end of march, so if you have any design, illustration, animation, game design, UI/UX or pixelart needs, feel free to give me a shout! I should also finally get around to adding the last few years of work to my folio!
loading . . .
0
10
5
vec2 p=abs(FC.xy/r-.5); o=p.xyxy/p.yxyx/vec4(3,6,9,1); o=tanh(o+.1*length(o));
23 days ago
1
20
0
I want to become the best shader artist in the world if I can
27 days ago
5
28
1
Portfolio update. New shaders!
loading . . .
27 days ago
2
45
4
loading . . .
28 days ago
0
60
5
Electro vec2 p=(FC.xy*2.-r)/r.y; float d=.9-dot(p,p); o=tanh(.3/abs(tan(p.y*sqrt(max(d,-d*.1)/.3)+p.x+t+vec4(6,0,9,0))));
loading . . .
28 days ago
2
40
4
reposted by
Xor
Pixelated Pope
28 days ago
This is a pretty incredible opportunity for all you
#GameMaker
developers out there. There's a guide on how to get started here:
github.com/reddit/devvi...
Good luck, everyone!
add a skeleton here at some point
0
13
7
Cleanse vec2 p=(FC.xy*2.-r)/r.y/.3;for(float f;f++<1e2;p+=.02*sin(p.yx+.5*t))o+=(cos(f/27.+vec4(0,1,3,0))+1.1)/length(sin(p*sin(r+f)/.7));o=tanh(o*o/4e4);
loading . . .
29 days ago
1
46
8
2026 will be a wild year. It will not be boring
about 1 month ago
2
10
0
Stairs for(float i,z,d;i++<55.;o+=vec4(9,4,2,1)/d){vec3 p=z*normalize(FC.rgb*2.-r.xyy);for(d=0.;d++<9.;p+=sin(ceil(p/9.).zxy+t));z+=d=.1*abs(p.z+40.);}o=tanh(o/6e3);
loading . . .
about 1 month ago
1
52
9
Artifacts for(float i,z,d;i++<77.;o+=vec4(z,z,9,1)/d){vec3 p=z*normalize(FC.rgb*2.-r.xyy);p.xy+=t; for(d=0.;d++<9.;p+=sin(round(p)+d*3.).zxy); z+=d=abs(p.z/30.+.2);}o=tanh(o/8e4);
loading . . .
about 1 month ago
2
92
18
reposted by
Xor
mmalex
about 1 month ago
#genuary5
wrapping paper: void mainImage(out vec4 o,in vec2 u){u*=0.1;for(float i=1.;i<32.;i*=2.)u.yx+=i*sin(u.xy*0.2/i+iTime)-5.;u.y=mod(u.y,10.);o=vec4((((u.y>5.)?0:(u.y>4.)?898651:(u.y>3.)?829147:(u.y>2.)?571082:(u.y>1.)?832731:0)>>int(u.x+31.))&1);}
www.shadertoy.com/view/WcVfWG
0
20
4
reposted by
Xor
Kenney
about 1 month ago
I've updated my Development Essentials
#gameassets
pack which now includes 4×4 pixels, noise, gradients and more. The pack is (obviously) CC0 licensed and can be used by anyone for anything. Please leave feedback or ideas on what to add! 🙇♂️
kenney.nl/assets/devel...
7
287
43
Scatter 2 vec2 p=(2.*FC.xy-r)/r.y+.02/fract(dot(FC,sin(FC.yxyx))); o=tanh((p.xyyx+p.xxyx+1.)*.01/abs(max(abs(p.x),abs(p.y))-.5));
about 2 months ago
1
56
4
Scatter vec2 u=(r-2.*FC.xy)/r.y,c=ceil((u*1e2+sin(u*3e2-t))/(.1+length(u))),p=u+.01*tan(dot(c,sin(c.yx)));o=tanh(tanh(vec4(p-.3,p))*.1/(abs(length(p)-.6)));
loading . . .
about 2 months ago
0
33
4
reposted by
Xor
SaraJS
about 2 months ago
shaders are so gdam cool
1
42
4
reposted by
Xor
Ultimate Walrus
about 2 months ago
raymarching through a 3D texture in Godot
#godot
#shaders
loading . . .
0
33
3
reposted by
Xor
Clem Boissiere
2 months ago
Finally, someone got shaders running on the Vegas sphere! Next step: let’s make this happen in mixed reality so everyone can write shaders on a virtual version of the sphere 😃 (credits to
@xordev.com
for the video)
loading . . .
1
32
7
Combustion vec2 p=FC.xy*6./r.y; for(float i;i++<1e1;i) p+=sin(p.yx*i+i*i+t*i+r)/i; o=tanh(.2/tan(p.y+vec4(0,.1,.3,0))); o*=o;
loading . . .
2 months ago
0
48
5
reposted by
Xor
Λriane Two ☑️
2 months ago
I have no idea how this shader works, but reducing the iteration count in the second loop kinda looks nice too.
loading . . .
0
19
1
reposted by
Xor
brennan
3 months ago
ayyy it's
@xordev.com
on the sphere!
0
42
4
Lily for(float i,z,d;i++<6e1;o+=vec4(z,9,1,1)/d/d){vec3 p=round(z*normalize(FC.rgb*2.-r.xyy)/.1)*.1;p.z-=9.; for(d=0.;d++<9.;p+=.2*sin(p*d-t+z).yzx);z+=d=length(cos(p)-1.)/20.;} o=tanh(o/3e5);
loading . . .
3 months ago
0
108
12
reposted by
Xor
Nikita Lisitsa
3 months ago
Trying a new voxel scene to test memory vs compute GPU performance in my raytracer, using
@xordev.com
's dot noise:
mini.gmshaders.com/p/dot-noise
loading . . .
1
120
6
Nether for(float i,z,d;i++<6e1;o+=vec4(19,z,1,1)/d/d){vec3 p=z*normalize(FC.rgb*2.-r.xyy);p.z-=t;p=round(p/.1)*.1; for(d=0.;d++<9.;p+=.2*cos(p*d+z).zzx);z+=d=abs(abs(p.y)-3.)/20.;} o=tanh(o/7e5);
loading . . .
3 months ago
0
57
7
Porting shaders to C/C++: by
@tsoding.bsky.social
youtu.be/xNX9H_ZkfNE
loading . . .
Graphics API is irrelevant
YouTube video by Tsoding
https://youtu.be/xNX9H_ZkfNE
3 months ago
1
62
5
Load more
feeds!
log in