From 3ad04282f055f10e7e7f34648bef8b5013f0365d Mon Sep 17 00:00:00 2001 From: micuat Date: Sat, 31 Oct 2020 11:49:35 +0100 Subject: [PATCH] testing? --- zoneb/bin/data/shaders/particles/update.frag | 36 ++++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/zoneb/bin/data/shaders/particles/update.frag b/zoneb/bin/data/shaders/particles/update.frag index 5c4d0f9..484194a 100755 --- a/zoneb/bin/data/shaders/particles/update.frag +++ b/zoneb/bin/data/shaders/particles/update.frag @@ -148,14 +148,14 @@ void main() thermo = misc.x; } else { // wandering - age += 0.02; + age += 10.02; // age += 0.01; thermo = misc.x; } - if(vValid == 1 && target.w > 0 && length(target.xy - pos.xy) < 100) { // arrived - age += 0.03; - } + // if(vValid == 1 && target.w > 0 && length(target.xy - pos.xy) < 100) { // arrived + // age += 0.03; + // } // wandering vec3 force = vec3(0,0,0); @@ -169,18 +169,32 @@ void main() if(age < 0.001) { // targetting target.w = 0; if(random3(pos).x > pow(length(texCoordVarying.st/4 - uHottest0.st)/5,16*16)+0) { - vec3 H = uHottest3d0; - H.x *= -1; - H.z *= -1; + vec2 h = uHottest1.st; + vec4 hray = texture(u_world, h); + 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.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) { - vec3 H = uHottest3d1; - H.x *= -1; - H.z *= -1; + vec2 h = uHottest0.st; + vec4 hray = texture(u_world, h); + 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.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) { // vec2 h = uColdest1.st; @@ -211,7 +225,7 @@ void main() force.y = sin(th) * cos(phi); force.z = sin(phi); force *= 200 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0)); - // force += (target.xyz - pos) * 0.35; + // force += (target.xyz - pos) * 0.3; } // damping