cleanup a bit

This commit is contained in:
micuat 2020-11-01 16:37:42 +01:00
parent 6944f03cc5
commit daa91a4ba1
4 changed files with 1 additions and 43 deletions

View file

@ -97,12 +97,6 @@ float simplex3d_fractal(vec3 m) {
+0.0666667*simplex3d(8.0*m);
}
float depthToSilhouette(float depth) {
if(depth <= 0.4) return 0;
// if(depth > 0.1) return 0;
else return 1;
}
void main() {
vec2 pixel = vec2(1.0);//./u_resolution;
vec2 offset[9];
@ -149,23 +143,6 @@ void main() {
float lap = 0;
vec4 cc = vec4(0);
for (int i=0; i < 9; i++){
// float tmp = texture(u_buffer1, st + offset[i]).r;
// lap += tmp * kernel[i] / 2.5;
// vec4 ccc = texture(u_buffer1, st + offset[i]);
// if(length(ccc.rgb) > length(cc.rgb)) cc = ccc;
// if(ccc.r < 1 && ccc.g < 1 && ccc.b < 1) {
// cc += ccc * kernel[i] / 4;
// }
}
// color = vec4(vec3(lap * 2.0), 1.0);
// color = vec4(cc.rgba);
// // color = vec4(cc.rgba/4);
// color.r = min(1, color.r);
// color.g = min(1, color.g);
// color.b = min(1, color.b);
// color.a = min(1, color.a);
color = texture(u_buffer1, st);
}

View file

@ -124,7 +124,7 @@ void main()
}
if(gPos.z > -200) {
alpha = 0;
discard;
}
vec4 color = vec4(remapedColor, alpha);

View file

@ -25,7 +25,6 @@ in vec4 vTarget[];
in float vTemperature[];
in float vAge[];
// out vec2 gTexCoord;
out vec3 gPos;
out vec4 gTarget;
out float gTemperature;
@ -34,7 +33,6 @@ out float gAge;
void main()
{
float uSpriteSize = 1;
// if (vValid[0] == 0) return;
texCoordVarying = vTexCoord[0];
gPos = vPos[0];
@ -48,18 +46,12 @@ void main()
vec3 vOffset;
if(uEnergy > 0) {
if(gAge < 0.005) return;
// if(length(gTarget.xyz) > 1000) return;
vOffset = (vPrevPosition[i].xyz - vPosition[i].xyz);
vOffset += normalize(vOffset) * 10;
}
else {
// vOffset = (vPrevPosition[i].xyz - vPosition[i].xyz);
// vOffset = normalize(vOffset) * 2;
vOffset = vec3(1,0,0);
}
// if(length(vOffset) < 4) {
// vOffset = normalize(vOffset) * 4;
// }
vec4 shiftPos = vec4(vOffset, 0) + vPosition[i];
gl_Position = projectionMatrix * (vPosition[i] + vec4(0.0, 0.0, 0.0, 0.0) * uSpriteSize);
@ -71,10 +63,6 @@ void main()
EndPrimitive();
// gl_Position = projectionMatrix * (vOrgPosition[i] + vec4(0.0, 0.0, 0.0, 0.0) * uSpriteSize);
// EmitVertex();
// gl_Position = projectionMatrix * (vec4(1,0,0,0) + vOrgPosition[i]);
// EmitVertex();
}
EndPrimitive();

View file

@ -23,19 +23,12 @@ out vec4 vOrgPosition;
void main()
{
// vTexCoord = vec2(gl_InstanceID % 512, gl_InstanceID / 512);
vTexCoord = texcoord;
vec4 misc = texture(particles2, vTexCoord);
vec4 vTarget = texture(particles3, vTexCoord);
vTemperature = misc.x;
vAge = misc.y;
vPos = texture(particles0, vTexCoord).xyz;
// if(uEnergy > 0) {
// vPos = texture(particles0, vTexCoord).xyz;
// }
// else {
// vPos = texture(particles5, vTexCoord).xyz;
// }
vPosition = modelViewMatrix * vec4(vPos, 1.0);
vPrevPosition = modelViewMatrix * vec4(texture(particles4, vTexCoord).xyz, 1.0);
vOrgPosition = modelViewMatrix * vec4(texture(particles5, vTexCoord).xyz, 1.0);