coldest, but not enabled

This commit is contained in:
micuat 2020-10-20 20:58:44 +02:00
parent 65d0ee7a85
commit d6edcc5e06
2 changed files with 36 additions and 3 deletions

View file

@ -19,6 +19,8 @@ uniform float elapsed;
uniform vec3 uHottest0; uniform vec3 uHottest0;
uniform vec3 uHottest1; uniform vec3 uHottest1;
uniform vec3 uColdest0;
uniform vec3 uColdest1;
in vec2 texCoordVarying; in vec2 texCoordVarying;
@ -161,7 +163,7 @@ void main()
if(age < 0.001) { if(age < 0.001) {
target.w = 0; target.w = 0;
if(random3(pos).x > pow(length(texCoordVarying.st - uHottest0.st)/20,16)+0) { if(random3(pos).x > pow(length(texCoordVarying.st - uHottest0.st)/5,16*16)+0) {
vec2 h = uHottest1.st; vec2 h = uHottest1.st;
vec4 hray = texture(u_world, h); vec4 hray = texture(u_world, h);
float hdepth = -depth * 65535.0; float hdepth = -depth * 65535.0;
@ -170,7 +172,7 @@ void main()
target.xyz = H + random3(pos); target.xyz = H + random3(pos);
target.w = 1; target.w = 1;
} }
else if(random3(pos).x > pow(length(texCoordVarying.st - uHottest1.st)/20,16)+0) { else if(random3(pos).x > pow(length(texCoordVarying.st - uHottest1.st)/5,16*16)+0) {
vec2 h = uHottest0.st; vec2 h = uHottest0.st;
vec4 hray = texture(u_world, h); vec4 hray = texture(u_world, h);
float hdepth = -depth * 65535.0; float hdepth = -depth * 65535.0;
@ -179,6 +181,24 @@ void main()
target.xyz = H + random3(pos); target.xyz = H + random3(pos);
target.w = 1; target.w = 1;
} }
// else if(random3(pos).x > pow(length(texCoordVarying.st - uColdest0.st)/20,16)+0) {
// vec2 h = uColdest1.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;
// }
// else if(random3(pos).x > pow(length(texCoordVarying.st - uColdest1.st)/20,16)+0) {
// vec2 h = uColdest0.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;
// }
} }
if(target.w > 0) { if(target.w > 0) {
@ -189,7 +209,7 @@ void main()
force.x = cos(th) * cos(phi); force.x = cos(th) * cos(phi);
force.y = sin(th) * cos(phi); force.y = sin(th) * cos(phi);
force.z = sin(phi); force.z = sin(phi);
force *= 350; force *= 200 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0));
// force += (target.xyz - pos) * 0.35; // force += (target.xyz - pos) * 0.35;
} }

View file

@ -213,6 +213,19 @@ void ofApp::onParticlesUpdate(ofxShader &shader)
{ {
shader.setUniform3f("uHottest1", hotspots.at(0).at(1)); shader.setUniform3f("uHottest1", hotspots.at(0).at(1));
} }
if (hotspots.size() > 0 && hotspots.at(0).size() > 0)
{
shader.setUniform3f("uColdest0", hotspots.at(0).back());
}
if (hotspots.size() > 1 && hotspots.at(1).size() > 0)
{
shader.setUniform3f("uColdest1", hotspots.at(1).back());
}
else if (hotspots.size() > 0 && hotspots.at(0).size() > 1)
{
shader.setUniform3f("uColdest1", hotspots.at(0).at(hotspots.at(0).size() - 2));
}
} }
void ofApp::onParticlesDraw(ofxShader &shader) void ofApp::onParticlesDraw(ofxShader &shader)