This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="importmap"> | |
{ | |
"imports": { | |
"lil-gui": "./node_modules/lil-gui/dist/lil-gui.esm.js", | |
"three": "./node_modules/three/src/Three.js", | |
"three/addons/": "./node_modules/three/examples/jsm/", | |
"three/nodes": "./node_modules/three/examples/jsm/nodes/Nodes.js" | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "data/shader/mat/state.frag" | |
uniform float uOpacity; //name "Opacity" default 1.0 min 0.0 max 2.0 | |
uniform float uExponent; //name "Exponent" default 1.0 min 0.0 max 4.0 | |
void RimOpacity( inout FragmentState s ) | |
{ | |
#ifdef Emissive | |
Emissive(s); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function imageComplete(img) { | |
return new Promise((resolve) => { | |
if (img.complete) { | |
resolve(); | |
} else { | |
img.onerror = img.onload = () => { resolve() }; | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "data/shader/mat/state.frag" | |
uniform float uScale; //name "Scale" default 1.0 min 0.0 max 5.0 | |
USE_TEXTURE2D(tTexture0); | |
void TriplanarEmissive( inout FragmentState s ) | |
{ | |
vec3 uvw = fract(s.vertexPosition / 100.0 * uScale); | |
vec3 blend = abs(s.normal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "data/shader/mat/state.frag" | |
#include "data/shader/mat/other/customExtras.sh" | |
uniform int uIterations; //name "Iterations" default 15 min 5 max 30 | |
uniform float uSpeed; //name "Speed" default 1.0 min 0.0 max 10.0 | |
uniform float uFactor; //name "Factor" default 8.0 min 4.0 max 10.0 | |
// Based on https://codepen.io/wildpeaks/pen/gOJmzdo | |
float neuro(float ratio, vec2 uv, float t) { | |
mat2 rotate = mat2(0.540302, 0.841470, -0.841470, 0.540302); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on http://research.microsoft.com/en-us/um/people/hoppe/hatching.pdf | |
// and https://github.com/spite/cross-hatching | |
#include "data/shader/mat/state.frag" | |
USE_TEXTURE2D(tHatch0); | |
USE_TEXTURE2D(tHatch1); | |
USE_TEXTURE2D(tHatch2); | |
USE_TEXTURE2D(tHatch3); | |
USE_TEXTURE2D(tHatch4); | |
USE_TEXTURE2D(tHatch5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gsap from "gsap"; | |
const defaultPosition = {x: 40, y: 20, z: 40}; | |
const defaultTarget = {x: 0, y: 2, z: 0}; | |
// ... | |
window.addEventListener("keyup", (e) => { | |
if (controls.enabled && (e.key.toLowerCase() === "escape")) { | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"imports": { | |
"#components/*": "./src/components/*", | |
"#functions/*": "./src/functions/*" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type {PluginOption} from "vite"; | |
import {format} from "prettier"; | |
/** | |
* Format HTML pages using Prettier. | |
*/ | |
export function prettierPlugin(): PluginOption { | |
return { | |
name: "prettier", | |
transformIndexHtml: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
import {fileURLToPath} from "node:url"; | |
/** | |
* @returns {import("vite").PluginOption} | |
*/ | |
function buildPlugin(pages) { | |
return { | |
name: "change-html-output", | |
enforce: "post", |
NewerOlder