Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
1313 committed Aug 17, 2024
1 parent b288ead commit 3bcb868
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
Binary file modified .DS_Store
Binary file not shown.
18 changes: 6 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>doom.fish.industries</title>
<style>
* {
box-sizing: border-box;
}
#root,
html,
body {
Expand All @@ -31,17 +34,8 @@
z-index: 0;
}
img {
background-blend-mode: multiply;
width: 100%;
max-width: 400px;
margin: auto;
position: fixed;
top: 0px;
left: 0;
right: 0;
bottom: 0;
opacity: 0.4;
filter: invert(90%);
aspect-ratio: 1 /1;
max-height: 80vmin;
}

.text {
Expand All @@ -53,7 +47,7 @@
</head>
<body>
<canvas id="root"></canvas>
<img src="/logo2.png" />
<img src="/unmasked.png" />
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Binary file added public/new test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/unmasked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions src/lazer.frag
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ float distToLine(vec2 st, vec2 a, vec2 b)
float getLine(vec2 st, vec2 start, vec2 end)
{
float jitterIntensity = 0.01;
float jitter = Hash(sin(iTime * 250.)) * jitterIntensity;
float jitter = Hash(sin(iTime * 5.)) * jitterIntensity;

float f = 0.;
float dist2Line = distToLine(st, start, end) + jitter;

f = (0.01 / (dist2Line));
f += (0.01 / (dist2Line));
f = (0.02 / (dist2Line));

f *= 0.1;

Expand Down Expand Up @@ -72,9 +71,9 @@ mat3 rotZ(float d)

vec2 pToS(vec3 p)
{
p = p * rotY(iTime * 0.2);
p = p * rotX(iTime * 0.2);
p = p * rotZ(iTime * 0.2);
p = p * rotY(sin(iTime * 0.3));
p = p * rotX(cos(iTime * 0.4));
p = p * rotZ(iTime * 0.4);

vec3 pCenter = vec3(-0., 0., 1.0);
p += pCenter;
Expand All @@ -88,7 +87,7 @@ void main()

//p.x -= mod(p.x, 1.0 / 32.);
//p.y -= mod(p.y, 1.0 / 32.);
float pixelSize = max(1., 24. - exp(iTime * 1.5) * 1.5);
float pixelSize = max(1., 10. - exp(iTime * 0.8) * 0.7);
vec2 screenSpace = vec2(gl_FragCoord.x, gl_FragCoord.y);
vec2 fullUV = screenSpace / iResolution.xy;
vec2 uv = floor(fullUV * (iResolution / pixelSize)) / iResolution * pixelSize;
Expand All @@ -104,7 +103,7 @@ void main()

vec4 color = vec4(0.);

float scale = 0.09;
float scale = cos(iTime) * 0.01 + 0.13;

f = 0.;

Expand Down Expand Up @@ -182,14 +181,13 @@ void main()

for (int i = 0; i < edges.length(); i += 2)
{
const float jitterIntensity = 0.005;
const float halfJitter = jitterIntensity * 0.25;
const float jitterIntensity = 0.0005;
const float halfJitter = jitterIntensity * 0.05;
vec2 randPointA = vec2(Hash(iTime + float(i + 34)), Hash(iTime + float(i + 3424))) * jitterIntensity - halfJitter;
vec2 randPointB = vec2(Hash(iTime + float(i * 2 + 34)), Hash(iTime + float(i * 24))) * jitterIntensity - halfJitter;

vec2 pointA = p_[edges[i]] + randPointA;
vec2 pointB = p_[edges[i + 1]] + randPointB;

f += getLine(st, pointA, pointB);
}

Expand Down

0 comments on commit 3bcb868

Please sign in to comment.