105 lines
2.5 KiB
NASM
105 lines
2.5 KiB
NASM
-- CONST[0] = { time, 1.2, 0.01, 0.4 }
|
|
-- CONST[1] = { PI_2, I_PI_2, 0, 0 },
|
|
-- CONST[2] = { 0.25, 0.40625, 0.5625, 0 },
|
|
|
|
-- temp[0] : { uv0.xy , _, l }
|
|
-- temp[1] : { uv.xy , _, d }
|
|
-- temp[2] : final_color.xyzw
|
|
-- temp[3] : {col.xyz , i }
|
|
|
|
-- vec2 uv = uv0; // temp[1]
|
|
src0.rgb = temp[0] : -- uv0
|
|
temp[1].rg = MAX src0.rg_ src0.rg_ ;
|
|
|
|
-- vec4 final_color = vec4(0, 0, 0, 1);
|
|
:
|
|
temp[2].a = MAX src0.1 src0.1 ,
|
|
temp[2].rgb = MAX src0.000 src0.000 ;
|
|
|
|
-- i = 0;
|
|
:
|
|
temp[3].a = MAX src0.0 src0.0 ;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- loop start
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- uv = uv * 1.5;
|
|
src0.rgb = temp[1] , -- uv
|
|
src0.a = float(60) : -- 1.5
|
|
temp[1].rg = MAD src0.rg_ src0.aa_ src0.00_ ;
|
|
|
|
-- uv = fract(uv);
|
|
src0.rgb = temp[1] : -- uv
|
|
temp[1].rg = FRC src0.rg_ ;
|
|
|
|
-- uv = uv - 0.5;
|
|
src0.a = float(48) : -- 0.5
|
|
temp[1].rg = MAD src0.rg_ src0.11_ src0.aa_ ;
|
|
|
|
-- l = length(uv0);
|
|
src0.rgb = temp[0] : -- uv0
|
|
DP3 src0.rg0 src0.rg0 ,
|
|
temp[0].a = DP ;
|
|
src0.a = temp[0] :
|
|
temp[0].a = RSQ |src0.a| ;
|
|
src0.a = temp[0] :
|
|
temp[0].a = RCP src0.a ;
|
|
|
|
-- d = i * 0.4 + l;
|
|
src0.a = const[0] , -- 0.4
|
|
src1.a = temp[0] , -- l
|
|
src2.a = temp[3] : -- i
|
|
temp[1].a = MAD src2.a src0.a src1.a ;
|
|
|
|
-- d = time * 0.4 + d;
|
|
src0.a = const[0] , -- 0.4
|
|
src1.a = temp[1] , -- d
|
|
src0.rgb = const[0] : -- time (r)
|
|
temp[1].a = MAD src0.r src0.a src1.a ;
|
|
|
|
-- palette
|
|
-- v = d + (vec3(0.25, 0.40625, 0.5625) + 0.5)
|
|
src0.a = temp[1] , -- d
|
|
src0.rgb = const[2] , -- vec3(0.25, 0.40625, 0.5625)
|
|
src1.rgb = float(48) , -- 0.5
|
|
srcp.rgb = add : -- (vec3(0.25, 0.40625, 0.5625) + 0.5)
|
|
temp[3].rgb = MAD src0.111 src0.aaa srcp.rgb ;
|
|
|
|
-- v = frac(v)
|
|
src0.rgb = temp[3] : -- v
|
|
temp[3].rgb = FRC src0.rgb ;
|
|
|
|
src0.rgb = temp[3] , -- v
|
|
src1.rgb = float(48) : -- 0.5
|
|
temp[3].rgb = MAD src0.111 src0.rgb -src1.rgb ;
|
|
|
|
-- v = cos(v)
|
|
src0.rgb = temp[3] : -- v
|
|
COS src0.r ,
|
|
temp[3].r = SOP ;
|
|
src0.rgb = temp[3] : -- v
|
|
COS src0.g ,
|
|
temp[3].g = SOP ;
|
|
src0.rgb = temp[3] : -- v
|
|
COS src0.b ,
|
|
temp[3].b = SOP ;
|
|
|
|
-- col = vec3(0.5, 0.5, 0.5) * v + vec3(0.5, 0.5, 0.5)
|
|
src0.rgb = temp[3] , -- v
|
|
src1.rgb = float(48) : -- 0.5
|
|
temp[3].rgb = MAD src1.rgb src0.rgb src1.rgb;
|
|
|
|
-- end of 'palette' function
|
|
|
|
-----
|
|
-----
|
|
-----
|
|
|
|
OUT TEX_SEM_WAIT
|
|
src0.a = temp[0] ,
|
|
src0.rgb = temp[0] ,
|
|
src1.rgb = temp[3] :
|
|
out[0].a = MAX src0.1 src0.1 ,
|
|
out[0].rgb = MAX src1.rgb src1.rgb ;
|