This commit is contained in:
micuat 2020-10-31 11:49:35 +01:00
parent ca0613b705
commit 3ad04282f0

View file

@ -148,14 +148,14 @@ void main()
thermo = misc.x; thermo = misc.x;
} }
else { // wandering else { // wandering
age += 0.02; age += 10.02;
// age += 0.01; // age += 0.01;
thermo = misc.x; thermo = misc.x;
} }
if(vValid == 1 && target.w > 0 && length(target.xy - pos.xy) < 100) { // arrived // if(vValid == 1 && target.w > 0 && length(target.xy - pos.xy) < 100) { // arrived
age += 0.03; // age += 0.03;
} // }
// wandering // wandering
vec3 force = vec3(0,0,0); vec3 force = vec3(0,0,0);
@ -169,18 +169,32 @@ void main()
if(age < 0.001) { // targetting if(age < 0.001) { // targetting
target.w = 0; target.w = 0;
if(random3(pos).x > pow(length(texCoordVarying.st/4 - uHottest0.st)/5,16*16)+0) { if(random3(pos).x > pow(length(texCoordVarying.st/4 - uHottest0.st)/5,16*16)+0) {
vec3 H = uHottest3d0; vec2 h = uHottest1.st;
H.x *= -1; vec4 hray = texture(u_world, h);
H.z *= -1; float hdepth = -depth * 65535.0;
if(hdepth == 0) hdepth = -0.01 * 65535.0;
vec3 H = vec3(hray.xy * hdepth, hdepth);
target.xyz = H + random3(pos); target.xyz = H + random3(pos);
target.w = 1; target.w = 1;
// vec3 H = uHottest3d0;
// H.x *= -1;
// H.z *= -1;
// target.xyz = H + random3(pos);
// target.w = 1;
} }
else if(random3(pos).x > pow(length(texCoordVarying.st/4 - uHottest1.st)/5,16*16)+0) { else if(random3(pos).x > pow(length(texCoordVarying.st/4 - uHottest1.st)/5,16*16)+0) {
vec3 H = uHottest3d1; vec2 h = uHottest0.st;
H.x *= -1; vec4 hray = texture(u_world, h);
H.z *= -1; float hdepth = -depth * 65535.0;
if(hdepth == 0) hdepth = -0.01 * 65535.0;
vec3 H = vec3(hray.xy * hdepth, hdepth);
target.xyz = H + random3(pos); target.xyz = H + random3(pos);
target.w = 1; target.w = 1;
// vec3 H = uHottest3d1;
// // H.x *= -1;
// // H.z *= -1;
// target.xyz = H + random3(pos);
// target.w = 1;
} }
// else if(random3(pos).x > pow(length(texCoordVarying.st - uColdest0.st)/20,16)+0) { // else if(random3(pos).x > pow(length(texCoordVarying.st - uColdest0.st)/20,16)+0) {
// vec2 h = uColdest1.st; // vec2 h = uColdest1.st;
@ -211,7 +225,7 @@ void main()
force.y = sin(th) * cos(phi); force.y = sin(th) * cos(phi);
force.z = sin(phi); force.z = sin(phi);
force *= 200 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0)); force *= 200 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0));
// force += (target.xyz - pos) * 0.35; // force += (target.xyz - pos) * 0.3;
} }
// damping // damping