Skip to content

Commit 8d71793

Browse files
committed
Revert "wip"
This reverts commit c38ddd7.
1 parent c38ddd7 commit 8d71793

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const renderApp = (config) => {
3535
ResizeHandler.handle(canvas, ctx);
3636

3737
ctx.enable(ctx.BLEND);
38-
ctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE_MINUS_SRC_ALPHA);
38+
ctx.blendFunc(ctx.SRC_ALPHA, ctx.ONE);
3939

4040
const vertexShader = ShaderManager.compileVertex(ctx, ShaderSource.VERTEX_SHADER_SOURCE);
4141
const fragmentShader = ShaderManager.compileFragment(ctx, ShaderSource.FRAGMENT_SHADER_SOURCE);
@@ -91,6 +91,7 @@ const renderApp = (config) => {
9191
previousFrameTimestamp = now;
9292

9393
frames++;
94+
9495
if (now - lastFpsUpdate >= 1000) {
9596
fps = frames;
9697
frames = 0;

src/ShaderSource/ShaderSource.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ class ShaderSource {
3232
varying float ${this.TIME_VARYING};
3333
3434
void main() {
35-
float d = distance(gl_PointCoord, vec2(0.5));
36-
float alpha = step(d, 0.5);
37-
38-
gl_FragColor = vec4(
39-
mix(${this.BOTTOM_COLOR_UNIFORM}, ${this.TOP_COLOR_UNIFORM}, ${this.TIME_VARYING}),
40-
smoothstep(0.0, 0.2, ${this.TIME_VARYING}) * (1.0 - smoothstep(0.6, 1.0, ${this.TIME_VARYING}))
41-
);
35+
if (distance(gl_PointCoord, vec2(0.5)) > 0.5) {
36+
discard;
37+
};
4238
4339
gl_FragColor = vec4(
4440
mix(${this.BOTTOM_COLOR_UNIFORM}, ${this.TOP_COLOR_UNIFORM}, ${this.TIME_VARYING}),

0 commit comments

Comments
 (0)