Skip to content

Commit

Permalink
Searching through the Voids
Browse files Browse the repository at this point in the history
  • Loading branch information
peterekepeter committed Feb 1, 2019
1 parent 12c1d94 commit 60ec18d
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 8 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions data/search/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title=Searching through the Voids
audio=search.ogg
stream=1
Binary file added data/search/search.ogg
Binary file not shown.
File renamed without changes.
75 changes: 70 additions & 5 deletions data/something/shader.vert → data/search/shader.vert
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,8 @@ void pf3(int pid, float time, out part_t part){
float hash2 = fract(sin(pid%1000)*51.12);
float hash3 = fract(hash1*95.123 + hash2*17.1234);
//pos.y += (pow(hash3,10)+0.0001)*pow(max(0,time-10),2);
float destr_rep = mod(time,8.0f);
float destr_id = time - destr_rep;
float distr = max(0,mod(time,8.0f)-2.0f) * pow(hash3,4);
pos.xy += (cos(pos.yx*vec2(4+distr,8)+4*0.8+time*0.1)+sin(pos.yx*0.7+distr)+vec2(cos(destr_id),sin(destr_id)))*distr;
float distr = time * pow(hash3,4);
pos.xy += (cos(pos.yx*vec2(4+distr,8)+4*0.8+time*0.1)+sin(pos.yx*0.7+distr)+vec2(.5,.7))*distr;

pos.z+= 1;
part.pos=pos;
Expand Down Expand Up @@ -320,6 +318,64 @@ void pf_starfield(int pid, float time, out part_t part, out float t_implode){
part.pos = p;
}

float df(vec3 p, float time){
p.z+=time;
float anim = sin(time*0.1)*0.3+0.6;
float dist = 1000.0;
for (int i=0; i<4; i=i+1){
vec3 p2 = p+vec3(i);
p.z+=time*0.1;
float rep = 2+14*(1-anim)+i;
float ha=rep*0.5;
vec3 mp=mod(p2,rep)-ha;
vec3 id=p2-mp;
vec3 axes = abs(mp)-.6+sin(sin(id+i+p.z*0.))*0.2;
float box = max(max(axes.x, axes.y), axes.z);
dist = smin(dist,box,0.5);
}
return max(dist, 2-length(mod(p.xy+2.0, 4.0)-2.0));
}

void pfx(int pid, float time, out part_t part){
//if (pid>500000) return;
float hash1 = slash(slash(pid/1000)+pid%1000);
float hash2 = slash(hash1+pid%1000 );
float hash3 = slash(hash2);
float ab=pid%2;
//pos.y += (pow(hash3,10)+0.0001)*pow(max(0,time-10),2);
vec3 lpos=vec3(sin(time*0.3+ab),cos(time*0.3+ab*4),8+sin(time*0.4-ab)*4);
vec3 dir=normalize(vec3(hash1-.5, hash2-.5, hash3-.5));
dir.xy=rotate(dir.xy,time*0.1);dir.zy=rotate(dir.zy,time*0.05);
vec3 pos = lpos;

float travel = 0;
for (int i=0; i<20; i++){
float dist = df(pos,time);
pos += dist*dir;
if (dist<0.01) break;
};
float occ = 0.1;
vec3 d2 = -normalize(pos);
vec3 p2 = pos+d2*occ;
for (int i=0; i<20; i++)
{
float dist = df(p2, time);
p2 += dist*d2;
occ = min(dist, occ);
if (p2.z<0){
occ = 0.1;
break;
}
if (occ<0.01) break;
}
occ *= 10;

part.pos=pos;
part.size=0.002+abs (pos.z-8)/pos.z*0.01 + pow(slash(pid*0.0001),16);
part.energy = mix(vec3(0.8,0.25,0.1), vec3(0.1,0.25,0.4), ab)*16*occ;
part.blur = 0.0;
}


// snowfall

Expand Down Expand Up @@ -350,7 +406,7 @@ void seqencer(int pid, out part_t part1, out part_t part2){
part1 = mix_part(part1, p1tmp, implode1);
part2 = mix_part(part2, p2tmp, implode2);
}
if (247<time){
if (247<time && time<320){
part_t p1tmp=new_part(), p2tmp=new_part();
EVAL2(pf2, (time-251+51)*1.2 ,pid, p1tmp,p2tmp);
float pidf=pid/1000000.0*9;
Expand All @@ -359,6 +415,15 @@ void seqencer(int pid, out part_t part1, out part_t part2){
part1 = mix_part(part1, p1tmp, inter1);
part2 = mix_part(part2, p2tmp, inter2);
}
/*if (310<time) {
//EVAL(pf3, time-260, pid);
part_t p1tmp=new_part(), p2tmp=new_part();
EVAL2(pfx, time-310, pid, p1tmp,p2tmp);
float inter1 = ss(0,-1,part1.pos.z);
float inter2 = ss(0,-1,part2.pos.z);
part1 = mix_part(part1, p1tmp, inter1);
part2 = mix_part(part2, p2tmp, inter2);
}*/
}


Expand Down
3 changes: 0 additions & 3 deletions data/something/config.ini

This file was deleted.

Binary file removed data/something/silence.ogg
Binary file not shown.

0 comments on commit 60ec18d

Please sign in to comment.