Skip to content

Commit

Permalink
cave
Browse files Browse the repository at this point in the history
  • Loading branch information
1313 committed Aug 9, 2024
1 parent e54df14 commit b288ead
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 15 deletions.
Binary file modified .DS_Store
Binary file not shown.
29 changes: 23 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,42 @@
<style>
#root,
html,
body {
margin: 0;
width: 100%;
image-rendering: pixelated;
height: 100%;
text-align: center;
}
body {
background-color: #000;
background: url("/image.webp");
background-image: url("/image.webp");
background-size: cover;
background-position:
center center,
0px 0px;
background-repeat: no-repeat;
margin: 0;
width: 100%;
image-rendering: pixelated;
height: 100%;
text-align: center;
}
#root {
position: absolute;
top: 0;
left: 0;
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%);
}

.text {
margin-top: 15vh;
position: relative;
Expand All @@ -37,6 +53,7 @@
</head>
<body>
<canvas id="root"></canvas>
<img src="/logo2.png" />
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Binary file added public/logo.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/logo2.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/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions src/lazer.frag
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ mat3 rotZ(float d)

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

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

//p.x -= mod(p.x, 1.0 / 32.);
//p.y -= mod(p.y, 1.0 / 32.);
float pixelSize = max(1., 16. - exp(iTime * 0.2) * 2.);
float pixelSize = max(1., 24. - exp(iTime * 1.5) * 1.5);
vec2 screenSpace = vec2(gl_FragCoord.x, gl_FragCoord.y);
vec2 fullUV = screenSpace / iResolution.xy;
vec2 uv = floor(fullUV * (iResolution / pixelSize)) / iResolution * pixelSize;
float aspect = iResolution.x / iResolution.y;

uv.x *= aspect;
vec2 st = uv;
st -= vec2(0.5 * aspect, 0.60);
st -= vec2(0.50 * aspect, 0.5);

float f;

float iTime = iTime * 1.0;

vec4 color = vec4(0.);

float scale = 0.10;
float scale = 0.09;

f = 0.;

Expand Down Expand Up @@ -195,11 +195,11 @@ void main()

//Color
//vec3 color = vec3(.05, 1., .1);
color += vec4(0.93, 0., 0.0, 1.) * f;
color += vec4(0.3, 0., 0.0, 1.) * f;

float gamma = 0.4;
float gamma = 0.25;

color = vec4(pow(color.x, gamma), pow(color.y, gamma), pow(color.z, gamma), pow(color.x, gamma) * 1.4);
color = vec4(pow(color.x, gamma), pow(color.y, gamma), pow(color.z, gamma), pow(color.x, gamma) * 1.8);

fragColor = color;
}

0 comments on commit b288ead

Please sign in to comment.