test
This commit is contained in:
parent
5726baafe0
commit
c45f50c439
3 changed files with 23 additions and 18 deletions
|
@ -104,6 +104,7 @@ float simplex3d_fractal(vec3 m) {
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
if(gAge >= 1) discard;
|
||||||
vec2 palette = vec2(gTemperature*3425, 0.5);
|
vec2 palette = vec2(gTemperature*3425, 0.5);
|
||||||
vec3 remapedColorW = texture(warm1, palette).xyz;
|
vec3 remapedColorW = texture(warm1, palette).xyz;
|
||||||
vec3 remapedColorC = texture(cold2, palette).xyz;
|
vec3 remapedColorC = texture(cold2, palette).xyz;
|
||||||
|
@ -113,7 +114,7 @@ void main()
|
||||||
float rate = 1-smoothstep(D - d, D + d, length(gPos.x + uBetween.x) + n);
|
float rate = 1-smoothstep(D - d, D + d, length(gPos.x + uBetween.x) + n);
|
||||||
rate *= uAreThereTwoPeopleTween;
|
rate *= uAreThereTwoPeopleTween;
|
||||||
vec3 remapedColor = mix(remapedColorC, remapedColorW, rate);
|
vec3 remapedColor = mix(remapedColorC, remapedColorW, rate);
|
||||||
float alpha = max(0, 1 - pow(gAge,4)) * .03;
|
float alpha = max(0, 1 - pow(gAge,4)) * 0.1;
|
||||||
|
|
||||||
// if(vTemperature < 0.5) {
|
// if(vTemperature < 0.5) {
|
||||||
// alpha *= vTemperature * 2;
|
// alpha *= vTemperature * 2;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
layout (points) in;
|
layout (points) in;
|
||||||
layout (triangle_strip) out;
|
layout (line_strip) out;
|
||||||
layout (max_vertices = 4) out;
|
layout (max_vertices = 16) out;
|
||||||
|
|
||||||
// OF handled uniforms and attributes.
|
// OF handled uniforms and attributes.
|
||||||
uniform mat4 projectionMatrix;
|
uniform mat4 projectionMatrix;
|
||||||
|
@ -39,28 +39,31 @@ void main()
|
||||||
gTemperature = vTemperature[0];
|
gTemperature = vTemperature[0];
|
||||||
gAge = vAge[0];
|
gAge = vAge[0];
|
||||||
|
|
||||||
|
if(gAge >= 1) return;
|
||||||
for (int i = 0; i < gl_in.length(); ++i)
|
for (int i = 0; i < gl_in.length(); ++i)
|
||||||
{
|
{
|
||||||
vec3 vOffset = (vPrevPosition[i].xyz - vPosition[i].xyz) * 4;
|
vec3 vOffset = (vPrevPosition[i].xyz - vPosition[i].xyz) * (gAge * 5);
|
||||||
vOffset += normalize(vOffset) * 10;
|
vOffset += normalize(vOffset) * 5;
|
||||||
// if(length(vOffset) < 4) {
|
// if(length(vOffset) < 4) {
|
||||||
// vOffset = normalize(vOffset) * 4;
|
// vOffset = normalize(vOffset) * 4;
|
||||||
// }
|
// }
|
||||||
vec4 shiftPos = vec4(vOffset, 1) + vPosition[i];
|
vec4 shiftPos = vec4(vOffset, 0) + vPosition[i];
|
||||||
|
|
||||||
gl_Position = projectionMatrix * (vPosition[i] + vec4(0.0, 1.0, 0.0, 0.0) * uSpriteSize);
|
gl_Position = projectionMatrix * (vPosition[i] + vec4(0.0, 0.0, 0.0, 0.0) * uSpriteSize);
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
|
|
||||||
if (u_time > 10) { // hack
|
if (u_time > 10) { // hack
|
||||||
gl_Position = projectionMatrix * (shiftPos + vec4(0.0, 1.0, 0.0, 0.0) * uSpriteSize);
|
gl_Position = projectionMatrix * (shiftPos + vec4(0.0, 0.0, 0.0, 0.0) * uSpriteSize);
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
|
|
||||||
gl_Position = projectionMatrix * (vPosition[i] + vec4(0.0, -1.0, 0.0, 0.0) * uSpriteSize);
|
if(gAge > 0 && gTarget.w > 0) {
|
||||||
EmitVertex();
|
for(int j = 0; j < 3; j++) {
|
||||||
|
gl_Position = projectionMatrix * (vPosition[i] + vec4(0.0, float(j+1), 0.0, 0.0) * uSpriteSize);
|
||||||
gl_Position = projectionMatrix * (shiftPos + vec4(0.0, -1.0, 0.0, 0.0) * uSpriteSize);
|
EmitVertex();
|
||||||
EmitVertex();
|
gl_Position = projectionMatrix * (shiftPos + vec4(0.0, float(j+1), 0.0, 0.0) * uSpriteSize);
|
||||||
|
EmitVertex();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ uniform ivec2 uDepthFrameSize;
|
||||||
uniform vec3 mouse;
|
uniform vec3 mouse;
|
||||||
uniform float radiusSquared;
|
uniform float radiusSquared;
|
||||||
uniform float elapsed;
|
uniform float elapsed;
|
||||||
|
uniform float u_time;
|
||||||
|
|
||||||
uniform vec3 uHottest0;
|
uniform vec3 uHottest0;
|
||||||
uniform vec3 uHottest1;
|
uniform vec3 uHottest1;
|
||||||
|
@ -163,7 +164,7 @@ void main()
|
||||||
thermo = misc.x;
|
thermo = misc.x;
|
||||||
}
|
}
|
||||||
else { // wandering
|
else { // wandering
|
||||||
age += 0.02;
|
age += 01.02;
|
||||||
thermo = misc.x;
|
thermo = misc.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +193,7 @@ void main()
|
||||||
|
|
||||||
if(age < 0.001) { // targetting
|
if(age < 0.001) { // targetting
|
||||||
target.w = 0;
|
target.w = 0;
|
||||||
if(random3(pos).x > 2*pow(length(texCoordVarying.st/fraction - uHottest0.st)/15,1)) {
|
if(random3(pos + vec3(u_time, 0, 0)).x > 2*pow(length(texCoordVarying.st/fraction - uHottest0.st)/25,0.5)) {
|
||||||
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;
|
||||||
|
@ -201,7 +202,7 @@ void main()
|
||||||
target.xyz = H + random3(pos) * 3;
|
target.xyz = H + random3(pos) * 3;
|
||||||
target.w = 1;
|
target.w = 1;
|
||||||
}
|
}
|
||||||
else if(random3(pos).x > 2*pow(length(texCoordVarying.st/fraction - uHottest1.st)/15,1)) {
|
else if(random3(pos + vec3(u_time, 0, 0)).x > 2*pow(length(texCoordVarying.st/fraction - uHottest1.st)/25,0.5)) {
|
||||||
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;
|
||||||
|
@ -220,7 +221,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 *= 200 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0));
|
force *= 100 + 200 * simplex3d_fractal(vec3(texCoordVarying, 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// damping
|
// damping
|
||||||
|
|
Loading…
Reference in a new issue