From daa91a4ba19b46fad30919292f136c1f2ceb9c22 Mon Sep 17 00:00:00 2001 From: micuat Date: Sun, 1 Nov 2020 16:37:42 +0100 Subject: [PATCH] cleanup a bit --- zoneb/bin/data/shaders/bound.frag | 23 ---------------------- zoneb/bin/data/shaders/particles/draw.frag | 2 +- zoneb/bin/data/shaders/particles/draw.geom | 12 ----------- zoneb/bin/data/shaders/particles/draw.vert | 7 ------- 4 files changed, 1 insertion(+), 43 deletions(-) diff --git a/zoneb/bin/data/shaders/bound.frag b/zoneb/bin/data/shaders/bound.frag index 04fe363..a610300 100644 --- a/zoneb/bin/data/shaders/bound.frag +++ b/zoneb/bin/data/shaders/bound.frag @@ -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); } diff --git a/zoneb/bin/data/shaders/particles/draw.frag b/zoneb/bin/data/shaders/particles/draw.frag index ab96dee..b78e2db 100755 --- a/zoneb/bin/data/shaders/particles/draw.frag +++ b/zoneb/bin/data/shaders/particles/draw.frag @@ -124,7 +124,7 @@ void main() } if(gPos.z > -200) { - alpha = 0; + discard; } vec4 color = vec4(remapedColor, alpha); diff --git a/zoneb/bin/data/shaders/particles/draw.geom b/zoneb/bin/data/shaders/particles/draw.geom index c4688e8..a8b9129 100644 --- a/zoneb/bin/data/shaders/particles/draw.geom +++ b/zoneb/bin/data/shaders/particles/draw.geom @@ -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(); diff --git a/zoneb/bin/data/shaders/particles/draw.vert b/zoneb/bin/data/shaders/particles/draw.vert index fd20d1e..3e463cd 100755 --- a/zoneb/bin/data/shaders/particles/draw.vert +++ b/zoneb/bin/data/shaders/particles/draw.vert @@ -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);