Xor Profile Banner
Xor Profile
Xor

@XorDev

Followers
15,612
Following
716
Media
2,447
Statuses
16,755
Explore trending content on Musk Viewer
Pinned Tweet
@XorDev
Xor
2 years
Here's a thread of my best tweet shaders (>280 chars):
14
65
441
@XorDev
Xor
2 years
Down to 190 characters! #つぶやきGLSL vec3 p=vec3(t/.1,cos(t+r)),d=r.x/(r.xxy-round(FC.zxy)*2.),a;for(;o.w++<9e2&&snoise3D(a=ceil(p)/28.)+1.>length(a.yz);p+=min(a=fract(-p*sign(d))*abs(d)+1e-4,min(a.y,a.z)).x/d);o.rgb=fwidth(p);
24
364
3K
@XorDev
Xor
1 year
@todayyearsoldig Also X percent of Y is just multiplying the two together and dividing by 100. 7% of 11 = 77/100 = 0.77 4% of 20 = 0.80 This method works on any pair of numbers. After all this is what percent means
18
175
3K
@XorDev
Xor
1 year
"Dust" Here's an infinite, mathematically generated space station with volumetric shadows in just 439 characters of code!
34
297
3K
@XorDev
Xor
11 months
Someone's selling my shader as an NFT...
51
172
2K
@XorDev
Xor
3 years
#つぶやきGLSL vec3 i,a,b,p=vec3(t/.1,rotate2D(t)),d=normalize(r.xxy-vec3(0,ivec2(FC*.5+.5)*4));for(;i.x++<9e2&&snoise3D(a=ceil(p+d*step(a,b))/28.)<1.-length(a.zy);)a=sign(d),b+=step(b=fract(-p*a),-b),a*=b/d,b=min(a,min(a.yzx,a.zxy)),p+=d*b;o.rgb=fwidth(p+p);
25
323
2K
@XorDev
Xor
9 months
2023 update: 181 characters! Saved 13 characters, but added 4 for compatibility. vec3 p=vec3(t/.1,cos(t+r)),d=r.yxy-roundEven(FC.zxy)*2.,a;for(;o.w++<9e2&&snoise3D(a)+1.>length(a.yz);a=ceil(p+=min(a=mod(-p,sign(d))/d+1e-7,min(a.y,a.z)).x*d)/28.);o.rgb=fwidth(p);
@XorDev
Xor
2 years
Down to 190 characters! #つぶやきGLSL vec3 p=vec3(t/.1,cos(t+r)),d=r.x/(r.xxy-round(FC.zxy)*2.),a;for(;o.w++<9e2&&snoise3D(a=ceil(p)/28.)+1.>length(a.yz);p+=min(a=fract(-p*sign(d))*abs(d)+1e-4,min(a.y,a.z)).x/d);o.rgb=fwidth(p);
24
364
3K
23
163
2K
@XorDev
Xor
1 year
Let’s take a moment to appreciate the work our GPUs do in milliseconds with minimal errors
Tweet media one
14
93
2K
@XorDev
Xor
1 year
My favorite, simple rotation trick: angle = time - sin(time); This makes it smoothly start and stop every 2pi radians. You can also rotate quarter turns like so angle = time - sin(time*4.)/4.; Demo code: o+=length(max(abs((FC.xy-r*.5)*rotate2D(t-sin(t*4.)/4.))-.3*r.y,0.));
22
173
2K
@XorDev
Xor
9 months
"Vortex" #つぶやきGLSL vec2 p=(FC.xy*2.-r)/r.y,v;for(float i=.2,l;i<1.;o+=(cos(i*5.+vec4(0,1,2,3))+1.)*(1.+v.y/(l=length(v)+.003))/l/1e2)v=vec2(mod(atan(p.y,p.x)+i+i*t,PI2)-PI,1)*length(p)-i,v.x-=clamp(v.x+=i,-i,i),i+=.05;o=tanh(o);
9
187
2K
@XorDev
Xor
5 months
"Caustics" in 146 chars of #GLSL vec2 p=FC.xy/r.y*2e1+t;for(float i;i++<8.;)p+=sin(p+t/.2+i)*.4,p*=mat2(6,-8,8,6)/9.;o=vec4(tanh(length(fwidth(sin(p*.3)/.1))),texture(b,FC.xy/r));
16
173
2K
@XorDev
Xor
9 months
Polar coordinates vs polar-log coordinates
Tweet media one
Tweet media two
8
112
2K
@XorDev
Xor
2 months
The graphics programmer's flag
Tweet media one
20
83
1K
@XorDev
Xor
9 months
"Projection" in 327 chars of #GLSL for(float i,s,d,l,K,P;d+i++<1e2;){vec3
10
134
1K
@XorDev
Xor
2 years
"Shooting Stars" in 164 chars #つぶやきGLSL vec2 p,b=vec2(0,.2);for(float i=.9;i++<20.;)o+=1e-3/length(clamp(p=rotate2D(i)*(fract((FC.xy/r.y*i*.2+t*b)*rotate2D(i))-.5),-b,b)-p)*(cos(p.y/.1+vec4(0,1,2,3))+1.); Demo:
7
120
1K
@XorDev
Xor
6 months
If you're new to shaders, you shouldn't start with something complex like god rays, procedural generation or fluid sim. Your first 5 shaders should probably be: -Color invert: Invert the RGB color channels -Desaturate: Average the RGB to get approximate brightness -Motion
15
129
1K
@XorDev
Xor
6 months
Are there games in this aesthetic?
@TomaszBolek
bolek_3d
6 months
premonition
6
204
2K
89
45
961
@XorDev
Xor
2 years
NEW "Fractal Texturing" tutorial: This is the technique I used to detail terrain in my latest project. ShaderToy Demo:
Tweet media one
11
143
932
@XorDev
Xor
8 months
Fixed it
Tweet media one
@Rainmaker1973
Massimo
8 months
Math skills required in your life's stages
Tweet media one
304
3K
22K
13
78
922
@XorDev
Xor
4 months
Additive blending can lead to overexposure/clipping and lead to harsh color changes. Screen blending is smoother. It's done by simply inverting both textures, multiplying and then inverting the results: screen = 1.0- (1.0 - tex1.rgb) * (1.0 - tex2.rgb);
Tweet media one
17
94
896
@XorDev
Xor
4 months
Visualizing DDA raytracing in 2D
10
90
880
@XorDev
Xor
9 months
"Origami" #つぶやきGLSL o++;vec4 h;vec2 u;for(float A,l,a,i=.6;i>.1;i-=.1)a-=sin(a-=sin(a=(t+i)*4.)),u=(FC.xy*2.-r)/r.y,l=max(length(u-=rotate2D(a/=4.)*clamp(u*rotate2D(a),-i,+i)),.1),A=min((l-.1)*r.y*.2,1.),o=mix(h=sin(i/.1+a+vec4(1,3,5,0))*.2+.7,o,A)*mix(h/h,h+.5*A*u.y/l,.1/l);
9
93
855
@XorDev
Xor
2 months
Tiny approximation for HSV to RGB color: rgb = (cos(h*6.3+vec3(0,4,2))*s+2.-s)*v*.5;
Tweet media one
16
65
845
@XorDev
Xor
1 year
How to zoom correctly. Multiply and divide instead of adding/subtracting or just multiplying. You want scrolling up and down to be equal but opposite. Since 1.2*0.8 = 0.96, scrolling up and down would result in 0.96x scale
Tweet media one
16
51
833
@XorDev
Xor
4 months
GLSL trick for adding outlines to anything. fwidth()
Tweet media one
Tweet media two
4
51
826
@XorDev
Xor
3 months
@ibxtoycat And they’re adding hardcore mode? Some people are going to have a very bad time
8
1
811
@XorDev
Xor
9 months
"Milky" #つぶやきGLSL for(float i=-fract(t/.1),j;i++<1e2;o+=(cos((j=round(i+t/.1))*j+vec4(0,1,2,3))+1.)*exp(cos(j*j/.1)/.6)*min(1e3-i/.1+9.,i)/5e4/length((FC.xy-r*.5)/r.y+.05*cos(j*j/F4+vec2(0,5))*sqrt(i)));o=tanh(o*o);
3
81
807
@XorDev
Xor
9 months
"Accident" float i,d,s,l,c;for(vec3 p,v;i++<1e2;c+=max(.01-s*s,0.))p=(FC.rgb*2.-r.xyy)/r.x*d,p.z+=5e1,v=abs(cos(atan(p*=rotate3D(t*.3+l,FC.zwz),vec3(p.yx,l=length(p.xy)))*6.)),d+=s=length(vec2(min(v.x,v.z*.1*l),cos(log(l=length(p))*4.)*l*.2))-.3;o=vec4(c,texture(b,FC.xy/r-c/r));
7
112
811
@XorDev
Xor
2 months
abs(x) is boring. I like: max(x*a, -x*b) which allows you to scale the positive and negative numbers independently
Tweet media one
12
58
818
@XorDev
Xor
2 months
@Dexerto I would have died to have this as a kid
4
1
804
@XorDev
Xor
10 months
vec2 p=FC.xy*2.-r;for(float i;i++<t/.1;o+=(cos(i+vec4(6,1,2,3))+1.)*r.y/1e2/pow(t,.6)/length(p+.8*r*(abs(mod(vec2(.2,F4)*(t/.1-i)*.4,4.)-2.)-1.)));o*=o;
7
65
764
@XorDev
Xor
5 months
The sort of horrors that graphics programmers accept as normal
Tweet media one
18
28
761
@XorDev
Xor
3 months
Every game needs a sprite like this
Tweet media one
21
21
767
@XorDev
Xor
2 months
@hamish_kerr This is the work of @kishimisu and not AI generated
@kishimisu
kishimisu
2 months
I found a copy of my work labelled as « impressive AI generation » and without any attribution… I created this animation for my shader coding tutorial a year ago:
107
798
5K
6
16
745
@XorDev
Xor
1 year
In case you missed it, here's a statement from Russell Kay, Head of GameMaker:
Tweet media one
14
76
731
@XorDev
Xor
2 years
#つぶやきGLSL vec2 p,q;for(float i,a;i++<3e1;o+=5e-3/(abs(length(q=p*mat2(1,-1,2,2)/(r.y-p-p.yx))-i/4e1)+1./r.y)*clamp(cos(a=atan(q.y,q.x)*ceil(i*.1)+t*sin(i*i)+i*i),.0,.6)*(cos(a-i+vec4(0,1,2,0))+1.))p=FC.xy-r*.6; Demo:
6
92
715
@XorDev
Xor
11 months
"Palantir" in #GLSL vec2 p=(FC.xy*2.-r)/r.y;for(float d=.7-dot(p,p),z=sqrt(max(d,-d*.1)),i;i<1e2;i++)o+=(cos(snoise3D(vec3(p/(.3+i/5e1),z)*rotate3D(t,vec3(1)))*7.+vec4(6,1,2,3))+1.)/2e2/max(1.-d*2e1,1.);
14
62
703
@XorDev
Xor
1 year
Graphics effects I have explored: -Forward rendering -Deferred rendering -Normal mapping -Bump mapping -Parallax Occlusion mapping -Screenspace ambient occlusion -Screenspace shadows -Screenspace global illumination -Spatial/temporal denoising -Area lights -Voxel raytracing -SDF
14
38
703
@XorDev
Xor
1 year
vec2 I=ceil(FC.xy/r.y*40.)-vec2(37,23);float v=I.y,h=dot(I,I),z;o=vec4(240,0,300,0)+I.x-4.*I.y;if (h<2e2){o=vec4(420,0,520,0);I*=(5e3+8.*h)/1e2;z=(I.x-I.y*2.)/1e2+18.;z>0.?o.r+=z*z:z;o=o*(I.y+11e2)/5e3+max(I.x+I.y,0.)*.1;}else
Tweet media one
@iquilezles
inigo quilez
1 year
Hello, I present you with the Human Shader, a project where anybody can participate and help create the first ever human-brain-only powered shader and mathematical image! Please join us and be part of history!
Tweet media one
102
687
3K
7
57
687
@XorDev
Xor
6 months
Noise is overrated. All you need is a few layers of a periodic function like sin() and with some rotation and scaling you'll have no visible patterns for(vec2 p=(FC.xy*2.-r)/r.y*exp(3.-cos(t)),i;i.x<5e1;o+=.01/length(cos(p+i++)))p*=mat2(3,-9,9,3)*.1;o=tanh(o*o);
19
65
675
@XorDev
Xor
9 months
"Shield" #つぶやきGLSL for(float i,z;i<1.;i+=.01){vec2 p=(FC.xy*2.-r)/r.y*i,v;p/=.2+sqrt(z=max(1.-dot(p,p),0.))*.3;p.y+=fract(ceil(p.x=p.x/.9+t)*.5)+t*.2;v=abs(fract(p)-.5);o+=vec4(2,3,5,1)/2e3*z/(abs(max(v.x*1.5+v,v+v).y-1.)+.1-i*.09);}o=tanh(o*o);
11
72
658
@XorDev
Xor
1 year
"Nebula" in 192 bytes: for(vec3 p;o.a++<1e2;o.r+=.03/o.a/abs(snoise3D(p)+2.*dot(sin(p),cos(p.yzx))))p=vec3(FC.xy*2.-r,r)/r.x*(fsnoise(FC.xy/r)+o.a)*.1,p.y-=1e1,p*=rotate3D(t*.1,r.yyx);o.gb+=texture(b,FC.xy/r).rg/.7;
6
85
655
@XorDev
Xor
4 months
Another blendmode example. Add (A+B) vs Screen (A+B-A*B)
Tweet media one
Tweet media two
8
51
650
@XorDev
Xor
4 months
Here's a useful math thread for bookmarking:
7
89
639
@XorDev
Xor
9 months
Fractal texturing is sick! Detail at every scale
14
45
605
@XorDev
Xor
4 months
"Voxel AO" in #GLSL #define M (dot(cos(v.zxy*.1),sin(v*F4))-v.y*.1) vec3 R=normalize(r.x*.51-FC.xyz),d=sign(R),p=vec3(cos(r+t)-2e1,t/.1),v=round(p),l=(v-p+.5*d)/R,i,A,P;for(;i.x<2e2&&M>.3;i++)A=step(P=l,min(l.yzx,l.zxy)),v+=d*A,l+=d/R*A;v=p+dot(P,A)*R;o.rgb=mix(M*A/.4,i/=2e2,i);
9
70
601
@XorDev
Xor
6 months
"Fake fluid" in 118 chars of GLSL vec2 p=FC.xy/r.y*6.;for(float i;i++<8.;o=sin(p.xyxy*.3+vec4(0,1,2,3))*.5+.5)p.x+=sin(p.y+t*.3+i),p*=mat2(6,-8,8,6)/8.;
12
59
589
@XorDev
Xor
8 months
Should I recreate this in GameMaker?
@FluidNinjaLIVE
Andras Ketzer
2 years
NinjaLIVE 1.7 released - sea, sand, volumes and foliage 4K video: #FluidNinja #UE4 #UE5 #realtimeVFX #VFX #gamedev
63
901
6K
21
26
582
@XorDev
Xor
5 months
#glsl for(float i;i++<4e1;)o+=4e-3/length(sin((FC.xy-r*.5)/1e2+i*vec2(t*.1,1))-.99);o=vec4(tanh(o*o).r,texture(b,FC.xy/r));
5
57
585
@XorDev
Xor
1 year
I wanna share some neat numbers I use all the time and what I use them for. Starting with sqrt(0.5), 0.7071... The point on a circle at 45 degrees is at (r*hr, r*hr) where r=radius and hr=sqrt(0.5). To rotate 45 degrees, you can use this 2x2 matrix: mat2(hr, -hr, hr, hr)
Tweet media one
6
67
570
@XorDev
Xor
2 years
Advanced graphics system in #GameMaker for a private project
43
68
545
@XorDev
Xor
1 year
"Quantum" #GLSL vec3 p,q;for(float i=1.,j,z;i>0.;i-=.02)z=p.z+=sqrt(max(z=i-dot(p=vec3(FC.xy*2.-r,0)/r.y,p),-z/1e6)),p/=2.+p.z,p.xz*=rotate2D(t),o+=pow( z*z,.2)*i*pow(cos(j=cos(j)*dot(cos(q+=p),sin(q.yzx))/.3)*.5+.5,8.)*(sin(i*3e1+vec4(0,1,2,3))+1.)/8.;o*=o;
9
60
529
@XorDev
Xor
4 months
Raymarching a fractal one step per frame
10
40
539
@XorDev
Xor
3 months
I've published 50+ shader tutorials so far. Topics vary widely, including specific effects, math, abstract concepts, shader theory and algorithms I hope you find these helpful! I'll give someone who shares this a free subscription for full access
Tweet media one
3
125
539
@XorDev
Xor
2 years
"Rings" #つぶやきGLSL vec2 i=r/r,p=(FC.xy-r/vec2(-9,9))*mat2(2,1,-2,4)/4e1,l=p/p*length(p);o1+=(snoise2D(l)+snoise2D(p*rotate2D(t*.1))*.3)/l.x*vec4(70,40,30,1);p=p.yy/1e2;for(vec4 S;i.x<16.;i+=1./i)p*=rotate2D(2.4),S=texture(b1,FC.xy/r+p*i/r),o0+=S*=S*=S*=S;o0=sqrt(sqrt(o0)*.1);
10
89
508
@XorDev
Xor
3 years
#define A rotate3D(t*.3,r.yxy) #define N snoise3D float s=3.,i,R;vec3 d=normalize(FC .xyz*2.-r.xyx),p,q;for(p.z=s;i++<3e1&&s>1e-3;p+=d*s)s=clamp(abs(R=length(q=p*A)-1.)-.2,abs(q.y)+N(q+R*3e1)/2e2,R+.4)+N(q/.2)*N(q/.04)/3e2,o.rgb+=max((1.-d)/2e2/(.1+s),N(d*A/.01)-1.1+i/9e1); #GLSL
12
73
507
@XorDev
Xor
7 months
To get this, I had to survive this
Tweet media one
Tweet media two
@MadMaraca
Mari
7 months
To get this I had to survive this
Tweet media one
Tweet media two
23
95
2K
6
27
505
@XorDev
Xor
2 years
NEW tutorial on noise algorithms for shaders: ShaderToy Demo:
Tweet media one
5
98
507
@XorDev
Xor
9 months
"Passage" #つぶやきGLSL for(float i,s,d;i++<1e2;o+=1e-5/(.001-s)){vec3 p=vec3((FC.xy*2.-r)/r.x*d,d-9.)*.7*rotate3D(.7,FC.wzz);d-=s=min(p.z,cos(dot(modf(fract((vec3(atan(p.y,p.x),log(s=length(p.xy)),0)/PI2-t/2e1)*mat3(1,1,0,1,-1,0,p-p))*15.,p),sign(cos(p+p.y)))*PI2)*s/4e1);}
8
54
503
@XorDev
Xor
13 days
Random point distribution on a unit circle: //Direction and radius: d = random(pi*2); r = sqrt(random(1)); //Point coordinates: x = r*cos(d); y = r*sin(d);
7
39
503
@XorDev
Xor
5 months
Path-traced version of my fractal by @Michael_Moroz_
8
37
479
@XorDev
Xor
6 months
"Circuits" in 160 chars of #GLSL vec2 p=(FC.xy*2.-r)/r.y;for(float i;i++<9.;)o+=(cos(i+vec4(6,1,2,3))+1.)/length(min(sin(vec2(atan(p.y,p.x)+i,log(length(p))-t/i+i*i)*i)-.5,.3));o=tanh(o*o/4e2);
9
48
475
@XorDev
Xor
1 year
Tweet media one
7
43
472
@XorDev
Xor
2 months
I might have to do a tutorial on analytic antialiasing in shaders
Tweet media one
16
15
471
@XorDev
Xor
11 months
@memecrashes Future. It's less likely to actually happen
3
0
455
@XorDev
Xor
4 months
I will write a shader with as many characters as likes on this post. You have 72 hours
14
6
464
@XorDev
Xor
6 months
"Fracture" in 115 chars of #GLSL for(vec2 i,p=roundEven(FC.xy)/r.y+9.;i.x++<9.;o+=ceil(p.xyxy+o.gbra*.4+t/i.x/1e1))p*=mat2(8,-6,6,8)/9.;o=fwidth(o);
8
54
451
@XorDev
Xor
10 months
"Bricks" #GLSL int j;for(vec2 u=round(FC.xy)-r*.5,p,z=p+2e1,c;z.x<1e2&&(j=int(p)^int(p.y)^int(z))%93%43<32;p=u*z/r.y+t*vec2(2,9))c=min(fract(-p*sign(u))/abs(u)*r.y,fract(-z))+2e-5,z+=min(c,c.yx),o.rgb=(1e2-z.x)*(2.-cos(vec3(j/=3,j+5,j+4)));o/=2e2+fwidth(o.g)*5e2;
9
57
447
@XorDev
Xor
2 months
#GLSL accident. Using the noise functions feels like cheating, but 92 chars: for(float i,d;i++<1e2;)o+=(cos(snoise3D((FC.rgb*2.-r.xyy)/r.y*i*.1+t)+i+vec4(0,1,2,3)))/1e1;
5
54
453
@XorDev
Xor
2 years
Starfield #つぶやきGLSL vec2 p;for(float i,f;i++<1e1;o+=(1e1-f)/max(length(p=mod((FC.xy*2.-r)/r.y*f*rotate2D(i),2.)-1.)+cos(atan(p.y,p.x)*5.+t*cos(i))/3e1-vec4(7,8,9,0)/6e1,.01)/8e2)f=mod(i-t,1e1);
5
48
423
@XorDev
Xor
9 months
sRGB color blending (top) vs gamma corrected (bottom)
Tweet media one
10
30
421
@XorDev
Xor
4 months
"Voxels 2" #GLSL vec3 R=normalize(r.x*.51-FC.xyz),d=sign(R),p=vec3(cos(r+t)-4.,t/.1),v=round(p),l=(v-p+.5*d)/R,i;for(int A;i.x<2e2&&dot(sin(v.zxy*.1),cos(v*F4))+v.y*.1<1.;o.rgb=cos(vec3(A+A)-vec3(0,2,4))+i++/1e2)A=l.x<l.z?l.x<l.y?0:1:l.z<l.y?2:1,v[A]+=d[A],l-=l[A],l[A]=(d/R)[A];
9
39
422
@XorDev
Xor
11 months
Thanks to you guys and many kind people in the NFT community, we got this removed quickly. The swift response was much better than I expected. Gonna rest easy tonight. Good night
Tweet media one
7
5
418
@XorDev
Xor
3 years
vec3 p,d=(r.xxy-vec3(0,FC*2.))/r.y,i,a,c;for(p.x+=t/.1;i.x++<9e2;p+=d*min(a=fract(-abs(p))/abs(d)+1e-4,min(a.yzx,a.zxy)))snoise3D(a=ceil(p)/20.)+1.>length(a.yz)?c:c==-c?d=cos(sin(fsnoise(FC.xy/r+t)*r.xyy)*r.xxy),c=p:i+=9e2;o=texture(b,FC.xy/r)+(d.rgbb+1.)*(length(c-p)*.01-.1);
2
58
399
@XorDev
Xor
1 year
Using ChatGPT, it appears to have correctly ported my ShaderToy shader to a mathematical equation with the RGB channels plotted in terms of x, and y coordinates!
Tweet media one
Tweet media two
Tweet media three
7
36
411
@XorDev
Xor
1 year
Who's interested in a shader tutorial covering tips on how to imagine visuals from shader code in your head? I've developed many techniques to help speed my workflow process and it might be helpful to some of you as well.
26
13
413
@XorDev
Xor
9 months
World gen
11
25
403
@XorDev
Xor
7 months
The legend is back
@zozuar
yonatan
7 months
for(float e,i,a,w,x,g,h;i++<90.;o+=.01-.02/exp(max(s,e)*3e3)/h){vec3 p=vec3((FC.xy-.5*r)/r.y*g+2.,g);p.zy*=rotate2D(.5);e=p.y;h=e+p.x*.3;p.z+=t;for(a=.6;a>.001;a*=.7)p.xz*=rotate2D(5.),x=(p.x+p.z)/a+t+t,e-=w=exp(sin(x)-3.)*a,h+=abs(dot(sin(p.xz/a*.3)*a,r/r));g+=e=min(e,h*.5-1.);}
179
2K
18K
3
25
401
@XorDev
Xor
3 years
float i,e,a,l,y;for(vec3 A,p,q,d=(FC .xyz*2.-r.xyx)/r.x*rotate3D(t*.2,(A.y++,A)),b=2.+d;i++<2e2;e=clamp(-e,++y-PI,y)){o.rgb+=i>1e2?l=log(1.+(e+=1e-4))/2e2,d/=d,b.brg*l:b*e;p=q+=d*e*.7;y=++p.y;for(a=3.;a>.04;a*=.6)e=min(e,max(p=abs(p*=rotate3D(1.9,A))-a,max(p.y,p.z)).x);}o*=o/1e3;
3
58
397
@XorDev
Xor
4 months
Ah yes, exactly what I was after...
33
15
397
@XorDev
Xor
10 months
vec3 p=FC.xy*mat3x2(2,1,2,-1,0,-2)/.1/r.y+t;o+=cos(dot(sin(p.yzx),cos(p))/.4)*.5+.5;o+=dFdx(o)*vec4(8,4,0,0);
5
40
385
@XorDev
Xor
9 months
This is a sick feature that more programming languages should have (from "Jai")
Tweet media one
87
12
389
@XorDev
Xor
1 year
"Submerge" #GLSL vec3 d=normalize(FC.rgb*2.-r.xyy),p;vec2 u=FC.xy/r-.5;for(float i,j;i++<1e1;p+=d*(snoise3D(p*.1*j-t*.2)/j+6.-p.y*.5+p.z*.5))j=exp(mod(i,5.)*.6);o=vec4(texture(b,.5+u-u*fsnoise(u+t)/4e1).gba,refract(normalize(cross(dFdx(p),dFdy(p))),d,1.2).z+.02/length(u));
7
33
384
@XorDev
Xor
2 years
#つぶやきGLSL #define M (snoise3D(a*.1)+2.-length(a.yz)*.2) vec3 p,d=r.x/(r.xxy-FC.zxy*2.),a;for(p.x+=t/.1;o.w++<9e2&&M>.4;a=ceil(p+=min(a=fract(-abs(p))*abs(d)+1e-4,min(a.y,a.z)).x/d));a--;o=vec4(M>.4?9.+p-p:vec3(9,6,4),a=p+.5)*M*(snoise3D(ceil(p*6.))+2.)/(p.x-t/.1+9.);
8
64
381
@XorDev
Xor
4 months
SDF model challenge
Tweet media one
Tweet media two
@odd_enough
Jordan Cain
4 months
Here's my first modeling challenge! I've modeled a form and I want you guys to attempt the same thing. 😤 Guidelines for this: Quote reply with your solution smoothed and with wires. Must be subdiv only! Next week, I'll post my solution! 😄
Tweet media one
285
114
2K
4
22
383
@XorDev
Xor
1 year
Since I taught myself programming, it took me a while to learn how to manage physical health, mental health, and the risks associated (e.g. Carpal tunnel syndrome, back pain, acne, eyestrain, etc). I wanted to share what I've learned in hopes that it might help the newcomers:
10
48
374
@XorDev
Xor
10 months
"Waves" 151 chars of #GLSL vec3 p;for(float i=fsnoise(FC.xy/r)+9.;i++<1e2;o+=max(cos(dot(cos(p=vec3((FC.xy-r*.5)/r.x*i,i+t/.1)*.2),sin(p.yzx*.8))*4.+p.z+vec4(0,1,2,3)),0.)/i*.7);
7
40
369
@XorDev
Xor
1 year
for(vec2 p=FC.xy,c,i;i.x++<2e1;p/=2.)o+=(c=cos(p)).x*c.y;o=cos(o+vec4(0,1,2,3));
Tweet media one
2
36
371
@XorDev
Xor
3 years
#define N snoise3D mat3 A=rotate3D(t/8.,vec3(0,2,9));float i,R,a=.01;vec3 q,d=(FC.zxy*2.-r.xxy)/r.x,p;for(p.x=4.,p+=d;i++<2e2;d-=p/4e2/R/R,p+=d/40.)o.rgb+=(1.-d)*(N(q=p*A/.1)+N(q*.3)+1.)*(a*=min(R=dot(p,p),.2)/.2)/max(q*q,R).z/R;o=max(o,(N(d/length(d)*A*1e2)-.7)*a*1e2); #GLSL
10
55
374
@XorDev
Xor
11 months
Poor mans color grading. Before and after fragColor = tanh(color); This maps the range [-∞, +∞] to the range [-1, +1]. Here's my demo code: o+=vec4(1,.5,.2,1)*pow(r.y/length(FC.xy*2.-r),2.); o=tanh(o);
Tweet media one
Tweet media two
9
28
365
@XorDev
Xor
18 days
64x64x64 map stored on a 512x512 single channel surface texture
Tweet media one
6
10
370
@XorDev
Xor
3 months
Glowy illustrations or nah?
Tweet media one
84
18
368
@XorDev
Xor
1 year
Because I keep forgetting the formula for quintic interpolation, I'll leave this here: x*x*x*(10.0 + x*(-15.0 + 6.0*x))
Tweet media one
9
26
343
@XorDev
Xor
1 year
@johanvinet If you don’t mind semi-colons…
@XorDev
Xor
2 years
Down to 190 characters! #つぶやきGLSL vec3 p=vec3(t/.1,cos(t+r)),d=r.x/(r.xxy-round(FC.zxy)*2.),a;for(;o.w++<9e2&&snoise3D(a=ceil(p)/28.)+1.>length(a.yz);p+=min(a=fract(-p*sign(d))*abs(d)+1e-4,min(a.y,a.z)).x/d);o.rgb=fwidth(p);
24
364
3K
5
7
345
@XorDev
Xor
1 month
@Moral_Wisdom_ The facebookafication is complete
4
1
344
@XorDev
Xor
1 year
vec3 a=vec3(1,0,0),q,p=-.5-a*t,v=rotate3D(.7,a)*vec3(FC.xy*2.-r,r.y);for(float d,i,l;l++<2e2;p-=v/length(v)*d)for(q=p,d=-q.y,i=58.;i>.05;i*=.5)d=max(d,min(min(q=i*.9-abs(mod(q*rotate3D(.5,a.zxz),i+i)-i),q.y).x,q.z)),l>1e2?d+=1e-5,v/=v,o:o+=max(5e-4-d*d,0.);o*=log(7.-p.y)*.1; #GLSL
3
40
337
@XorDev
Xor
18 days
Easy light attenuation formula: If you have a radial gradient that ranges from 0 to 1 radial = length(fragCoord-res*0.5)/res.y; You can make it start at a brightness of 1 and fade out using this simple formula: light = x / (x+radial); "x" is falloff strength
Tweet media one
6
26
334
@XorDev
Xor
6 months
Embracing the noise/artifacts for Acerola jam. Raymarching makes fun things possible like real motion blur and cheaper raytraced ambient occlusion
12
21
326
@XorDev
Xor
7 months
Making a shader demo for strong and cheap blurring using mipmaps
6
23
325