Compare commits
20 commits
Author | SHA1 | Date | |
---|---|---|---|
8e61cf24f9 | |||
4f291f4f50 | |||
c2db0d5f37 | |||
02547b888f | |||
56508267a3 | |||
bdacfc0f5f | |||
6dda23829c | |||
ed93a41e71 | |||
86f1634b5f | |||
269f54882f | |||
0b6ce2137f | |||
9981ef0f42 | |||
2507711e79 | |||
905a5b6038 | |||
94c5165877 | |||
0a67ccb040 | |||
51f9f820d8 | |||
4863ab4262 | |||
3e0394563f | |||
74135870d0 |
2
.gitignore
vendored
|
@ -173,3 +173,5 @@ dist
|
|||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
*.blend?
|
11
README.md
|
@ -4,13 +4,16 @@ Foxes dream of electron beams.
|
|||
|
||||
**noe** + **eidelon** _(n. a thing, an image, a reflection)_
|
||||
|
||||
https://art.mekanoe.com
|
||||
https://3d.noe.sh
|
||||
|
||||
## Artworks
|
||||
|
||||
- [./001-platform-provenance](https://art.mekanoe.com/001-platform-provenance)
|
||||
- [./002-webgl-engine](https://art.mekanoe.com/002-webgl-engine)
|
||||
- [./003-scene](https://art.mekanoe.com/003-scene)
|
||||
- [./001-platform-provenance](https://3d.noe.sh/001-platform-provenance)
|
||||
- [./002-webgl-engine](https://3d.noe.sh/002-webgl-engine)
|
||||
- [./003-scene](https://3d.noe.sh/003-scene)
|
||||
- [./004-a-new-leaf](https://3d.noe.sh/004-a-new-leaf)
|
||||
- [./005-thoughtform-hidenoe](https://3d.noe.sh/005-thoughtform-hidenoe)
|
||||
- [./006-the-edge](https://3d.noe.sh/006-the-edge)
|
||||
|
||||
## Development
|
||||
|
||||
|
|
BIN
bun.lockb
|
@ -27,6 +27,8 @@ const results = await Bun.build({
|
|||
".wgsl": "text",
|
||||
".vert": "text",
|
||||
".frag": "text",
|
||||
".html": "text",
|
||||
".md": "text",
|
||||
},
|
||||
minify: process.env.MINIFY === "false" ? false : true,
|
||||
plugins: [glslPlugin],
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import chalk from "chalk";
|
||||
import { globSync } from "glob";
|
||||
import { relative, resolve, dirname } from "node:path";
|
||||
|
||||
const w = 1;
|
||||
|
||||
|
@ -49,8 +50,13 @@ type Triangle = {
|
|||
// ...vertToArray(t.c),
|
||||
// ];
|
||||
|
||||
const meshAbsolutePath = resolve("./src/renderer/mesh.ts");
|
||||
|
||||
const getMeshImportPath = (thisFile: string) =>
|
||||
relative(dirname(thisFile), meshAbsolutePath).replace(/\.ts$/g, "");
|
||||
|
||||
export const convertMeshes = async () => {
|
||||
const meshes = globSync("src/meshes/*.ply");
|
||||
const meshes = globSync("src/meshes/**/*.ply");
|
||||
|
||||
for (const file of meshes) {
|
||||
const ply = await Bun.file(file).text();
|
||||
|
@ -214,42 +220,32 @@ export const convertMeshes = async () => {
|
|||
: [];
|
||||
|
||||
const facesArray: number[] = faces.flatMap((f) => [f.a, f.b, f.c]);
|
||||
const facesMaxValue = facesArray.reduce(
|
||||
(acc, face) => (face > acc ? face : acc),
|
||||
0
|
||||
);
|
||||
const facesBitDepth =
|
||||
facesMaxValue <= 0xff ? 8 : facesMaxValue <= 0xffff ? 16 : 32;
|
||||
|
||||
const outFile = file.replace(".ply", ".ts");
|
||||
const outString = `
|
||||
import { Mesh } from "../renderer/mesh";
|
||||
const outString = `import { Mesh } from "${getMeshImportPath(outFile)}";
|
||||
|
||||
// prettier-ignore
|
||||
const positions = new Float32Array(${JSON.stringify(positions)});
|
||||
|
||||
// prettier-ignore
|
||||
const colors = ${
|
||||
export default new Mesh({
|
||||
colors: ${
|
||||
vertexConfig.colors ? `new Uint8Array(${JSON.stringify(colors)})` : "null"
|
||||
};
|
||||
|
||||
// prettier-ignore
|
||||
const uvs = ${
|
||||
vertexConfig.uvs ? `new Float32Array(${JSON.stringify(uvs)})` : "null"
|
||||
};
|
||||
|
||||
|
||||
// prettier-ignore
|
||||
const normals = ${
|
||||
},
|
||||
faces: new Uint${facesBitDepth}Array(${JSON.stringify(facesArray)}),
|
||||
name: ${JSON.stringify(file)},
|
||||
normals: ${
|
||||
vertexConfig.normals
|
||||
? `new Float32Array(${JSON.stringify(normals)})`
|
||||
: "null"
|
||||
};
|
||||
|
||||
// prettier-ignore
|
||||
const faces = new Uint32Array(${JSON.stringify(facesArray)});
|
||||
|
||||
export default new Mesh({
|
||||
colors,
|
||||
faces,
|
||||
name: ${JSON.stringify(file)},
|
||||
normals,
|
||||
positions,
|
||||
uvs,
|
||||
},
|
||||
positions: new Float32Array(${JSON.stringify(positions)}),
|
||||
uvs: ${
|
||||
vertexConfig.uvs ? `new Float32Array(${JSON.stringify(uvs)})` : "null"
|
||||
},
|
||||
vertexCount: ${vertexCount}
|
||||
});
|
||||
`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<meta charset="utf-8" />
|
||||
<title>com.mekanoe.art // ##name##</title>
|
||||
<style>
|
||||
|
@ -9,6 +9,7 @@
|
|||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: Atkinson Hyperlegible, sans-serif;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
|
@ -21,8 +22,8 @@
|
|||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<nav>
|
||||
##nav##
|
||||
</nav>
|
||||
<div id="loading" class="loading-active"><div id="loading-text">[noeidelon] [stage 1]<br />bootstrapping...<span id="stage1-error"><br />this is taking a while...</span><span id="stage1-error2"><br />[panic] <span style="color: red">heck wtf</span></span></div></div>
|
||||
<div id="editor"></div>
|
||||
<nav>##nav##</nav>
|
||||
</main>
|
||||
<script src="/##name##/main.js" type="module"></script>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<meta charset="utf-8" />
|
||||
<title>com.mekanoe.art // 003-scene</title>
|
||||
<style>
|
||||
|
@ -9,6 +9,7 @@
|
|||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: Atkinson Hyperlegible, sans-serif;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
|
@ -21,8 +22,8 @@
|
|||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<nav>
|
||||
<a class="nav-left" href="/002-webgl-engine">⇠ 002-webgl-engine</a>
|
||||
</nav>
|
||||
<div id="loading" class="loading-active"><div id="loading-text">[noeidelon] [stage 1]<br />bootstrapping...<span id="stage1-error"><br />this is taking a while...</span><span id="stage1-error2"><br />[panic] <span style="color: red">heck wtf</span></span></div></div>
|
||||
<div id="editor"></div>
|
||||
<nav><a class="nav-left" href="/002-webgl-engine">⇠ 002-webgl-engine</a><a class="nav-right" href="/004-a-new-leaf">004-a-new-leaf ⇢</a></nav>
|
||||
</main>
|
||||
<script src="/003-scene/main.js" type="module"></script>
|
||||
|
|
29
html/004-a-new-leaf/index.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8" />
|
||||
<title>com.mekanoe.art // 004-a-new-leaf</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: Atkinson Hyperlegible, sans-serif;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/work.css" />
|
||||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<div id="loading" class="loading-active"><div id="loading-text">[noeidelon] [stage 1]<br />bootstrapping...<span id="stage1-error"><br />this is taking a while...</span><span id="stage1-error2"><br />[panic] <span style="color: red">heck wtf</span></span></div></div>
|
||||
<div id="editor"></div>
|
||||
<nav><a class="nav-left" href="/003-scene">⇠ 003-scene</a><a class="nav-right" href="/005-thoughtform-hidenoe">005-thoughtform-hidenoe ⇢</a></nav>
|
||||
</main>
|
||||
<script src="/004-a-new-leaf/main.js" type="module"></script>
|
2
html/004-a-new-leaf/main.js
Normal file
29
html/005-thoughtform-hidenoe/index.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8" />
|
||||
<title>com.mekanoe.art // 005-thoughtform-hidenoe</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: Atkinson Hyperlegible, sans-serif;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/work.css" />
|
||||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<div id="loading" class="loading-active"><div id="loading-text">[noeidelon] [stage 1]<br />bootstrapping...<span id="stage1-error"><br />this is taking a while...</span><span id="stage1-error2"><br />[panic] <span style="color: red">heck wtf</span></span></div></div>
|
||||
<div id="editor"></div>
|
||||
<nav><a class="nav-left" href="/004-a-new-leaf">⇠ 004-a-new-leaf</a><a class="nav-right" href="/006-the-edge">006-the-edge ⇢</a></nav>
|
||||
</main>
|
||||
<script src="/005-thoughtform-hidenoe/main.js" type="module"></script>
|
6
html/005-thoughtform-hidenoe/main.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import{c as N} from"../chunk-d24458ad0a4be457.js";import{f as D,g as I,h as j,i as O,j as k,l as y,n as Q,o as z} from"../chunk-0ef35489d83e6289.js";var C=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;out vec4 fragColor;vec2 squareImaginary(vec2 number,float mod){return vec2(pow(number.x*mod,2.0)-pow(number.y*mod,2.0),2.0*number.x*number.y);}float iterateMandelbrot(vec2 coord){vec2 z=vec2(0,0);float maxIterations=100.0;for(float i=0.0;i<maxIterations;i++){float factor=2.6+(1.3*sin(u_time*0.0001));z=squareImaginary(z,factor+1.0)+(coord/factor);if(length(z)>2.0)return i/float(maxIterations);}return maxIterations;}void main(){vec2 uvMirror=abs(uv0*2.0-1.0);fragColor=vec4(0.0);float mandelbrot=iterateMandelbrot((uvMirror.xy+vec2(0.14,-0.525))*0.9);fragColor.r=mandelbrot;vec2 outerNoise=(mandelbrot)*(1.0-uvMirror*0.5);fragColor.gb+=(1.0-mandelbrot)*outerNoise;fragColor.r+=pow(1.0-length(uvMirror),8.0);fragColor.a=1.0;}`;var V=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;out vec4 fragColor;vec2 squareImaginary(vec2 number,float mod){return vec2(pow(number.x*mod,2.0)-pow(number.y*mod,2.0),2.0*number.x*number.y);}float iterateMandelbrot(vec2 coord){vec2 z=vec2(0,0);float maxIterations=69.0;for(float i=0.0;i<maxIterations;i++){float mod=u_time*0.0003;z=squareImaginary(z,1.0/mod)+coord;if(length(z)>100.0)return i/float(maxIterations);}return maxIterations;}void main(){vec2 uvMirror=abs(uv0*2.0-1.0);fragColor=vec4(0.0);float mandelbrot=iterateMandelbrot((uvMirror.yx-vec2(-1.075,1.0))*0.9);fragColor.r=mandelbrot;vec2 outerNoise=(mandelbrot)*(1.0-uvMirror*0.5);fragColor.gb+=(1.0-mandelbrot)*outerNoise;fragColor.a=1.0;}`;var R={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1",texture2:"u_texture_2"}},E={normal:C,alt3:V},Z=(_,x=C)=>new k(R).vertex(y).fragment(x).app(_);var J=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;in vec3 light_pos;out vec4 fragColor;const float margin=0.5;vec3 hsv2rgb(vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}void main(){vec2 cUV=uv0*2.0-1.0;float circleDistance=length(cUV);if(circleDistance>margin){discard;}float theta=atan(cUV.y,cUV.x);float spiral=sin(100.0*(sqrt(circleDistance*20.0)-10.0*theta-0.01*u_time*0.001));float edgeLightZone=pow(clamp(abs(dot(cUV.xyx,light_pos)),0.0,1.0)*2.0,4.0);float colorSpiral=sin(100.0*(sqrt(circleDistance*10.0)-0.001*theta-0.3*u_time*0.00005));vec3 hueRotation=hsv2rgb(vec3(colorSpiral,1.0,0.5));fragColor=vec4(hueRotation*spiral*edgeLightZone,1.0);fragColor.rgb+=min(spiral,0.0041666);}`;var $=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;in vec3 light_pos;out vec4 fragColor;const float margin=0.5;vec3 hsv2rgb(vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}void main(){vec2 cUV=uv0*2.0-1.0;float circleDistance=length(cUV);if(circleDistance>margin){discard;}float theta=atan(cUV.y,cUV.x);float spiral=sin(100.0*(sqrt(circleDistance*20.0)-10.0*theta-0.01*u_time*0.001));float edgeLightZone=pow(clamp(abs(dot(cUV.xyx,light_pos)),0.0,1.0)*2.0,4.0);float colorSpiral=sin(100.0*(sqrt(circleDistance*10.0)-0.001*theta-0.3*u_time*0.00005));vec3 hueRotation=hsv2rgb(vec3(colorSpiral,1.0,0.5));fragColor=vec4(colorSpiral,spiral,1.0,1.0);}`;var q=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;in vec3 light_pos;out vec4 fragColor;const float margin=0.9;vec3 hsv2rgb(vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}void main(){vec2 cUV=uv0*2.0-1.0;float circleDistance=length(cUV);if(circleDistance>margin){discard;}float theta=atan(cUV.y,cUV.x);float spiral=sin(100.0*(sqrt(circleDistance*13.0)-(u_time*0.0001)*theta-0.01*u_time*0.001));float colorSpiral=sin(100.0*(sqrt(circleDistance*10.0)-0.001*theta-0.3*u_time*0.00005));fragColor=vec4(0,spiral,0,1.0);}`;var v={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1",texture2:"u_texture_2"}},B={normal:J,debug:$,alt2:q},w=(_,x=J)=>new k(v).vertex(y).fragment(x).app(_);var i=new z({fov:45}),G=new D([0,0,2],I([0,0,0])),K=new D([1,-1,0],I([0,0,0])),b=new D(j(0),I([0,180,0]),j(1.8)),m=new D(j(0),I([0,180,180]),j(0.6));document.body.addEventListener("mousemove",(_)=>{const{clientX:x,clientY:L}=_,{clientWidth:M,clientHeight:P}=document.body,c=x/M,F=L/P,W=c*2-1,A=F*2-1;K.position[1]=W,K.position[0]=A});i.onUpdate((_,x)=>{});var U=B.normal,H=E.normal;if(location.search.includes("alt1"))U=B.debug;if(location.search.includes("alt2"))U=B.alt2;if(location.search.includes("alt3"))H=E.alt3;new Q(i,b,new O(i,N,Z(i,H),G).configure({}));new Q(i,m,new O(i,N,w(i,U),G,K).configure({}));i.start();
|
29
html/006-the-edge/index.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8" />
|
||||
<title>com.mekanoe.art // 006-the-edge</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: Atkinson Hyperlegible, sans-serif;
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/work.css" />
|
||||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<div id="loading" class="loading-active"><div id="loading-text">[noeidelon] [stage 1]<br />bootstrapping...<span id="stage1-error"><br />this is taking a while...</span><span id="stage1-error2"><br />[panic] <span style="color: red">heck wtf</span></span></div></div>
|
||||
<div id="editor"></div>
|
||||
<nav><a class="nav-left" href="/005-thoughtform-hidenoe">⇠ 005-thoughtform-hidenoe</a></nav>
|
||||
</main>
|
||||
<script src="/006-the-edge/main.js" type="module"></script>
|
2
html/006-the-edge/main.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import{c as E} from"../chunk-d24458ad0a4be457.js";import{f as j,g as k,h as z,i as F,j as y,l as B,n as H,o as I} from"../chunk-0ef35489d83e6289.js";var t=`#version 300 es
|
||||
precision highp float;uniform float u_time;in vec2 uv0;out vec4 fragColor;const float railWidth=0.041666;const float railWiggle=0.0015;vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));const float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0,0,0,0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}void main(){vec2 cUV=uv0*2.0-1.0;float sintime=sin(u_time*0.0001);float vY=cos(uv0.y*sintime);float vX=sin(uv0.x*sintime*10000.0);float vibes=railWiggle*snoise(vec3(vY,vX,u_time));float rail=1.0-step(abs(pow(abs(cUV.y)-railWidth+vibes,30.0)),1.0);vec4 railColor=vec4(rail);float noise=abs(sin(snoise(uv0.xxy*10000.*u_time)));float noise2=abs(sin(snoise(uv0.yxy*10000.*u_time)));float noise3=abs(sin(snoise(uv0.xyx*10000.*u_time)));railColor.rgb-=(vec3(noise,noise2,noise3)*0.3);float theta=atan(cUV.y,uv0.x);float spiral=sin(10.0*(sqrt(19.0+(15.0*sintime*0.05)))-1000.0*theta-0.01*u_time*0.0001);float theta2=atan(1.0-(cUV.y/1000.0),uv0.x-(railWidth/20.));float spiral2=sin(10.0*(sqrt(20.0+u_time*0.00001)-10000.0*theta2-0.01*u_time*0.0001));float theta3=atan(1.0-uv0.y/10.0,uv0.x);float spiral3=sin(100.0*(sqrt(100.0+uv0.y)-100000.0*theta3-0.01*sintime*0.0001));float sparkleNoise=snoise(vec3(spiral,spiral2,u_time*0.00001));fragColor.r=step(abs(spiral2*spiral*sparkleNoise),mix(0.0333,0.0666,abs(uv0.y+sin(u_time*0.00001))));fragColor.r*=pow(1.0-abs(cUV.y),3.0)*abs(spiral3);fragColor.r*=10.0;if(cUV.y>0.0){fragColor.r=0.0;}fragColor=clamp(vec4(fragColor+railColor),vec4(0),vec4(1));}`;var O={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1",texture2:"u_texture_2"}},D=(J,K=t)=>new y(O).vertex(B).fragment(K).app(J);var x=new I({fov:45}),P=new j([0,0,2],k([0,0,0])),Q=new j(z(0),k(z(0)),[1000,1,1]);new H(x,Q,new F(x,E,D(x),P).configure({}));x.start();
|
BIN
html/backdrop-0e5863d39a0305cf.png
Normal file
After Width: | Height: | Size: 6.5 MiB |
BIN
html/backdrop-normals-6ba4b06676f112b6.png
Normal file
After Width: | Height: | Size: 8.6 MiB |
5
html/chunk-0ef35489d83e6289.js
Normal file
5
html/chunk-13ea4b456137d650.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
class n{_;u;y;texture=null;width=0;height=0;constructor(_,u,y={}){this.app=_;this.url=u;this.config=y}setImage(_,u,y){return this.texture=_,this.width=u,this.height=y,this}async loadImage(){if(this.url==="manual"){if(this.texture===null)throw new Error("manual specified, but texture was not ready...");return}if(this.texture!==null)return;this.app.telemetry?.addTextures(-1),this.app.loading("Fetching textures...");const _=new Image;return new Promise((u,y)=>{_.onload=async()=>{this.texture=await createImageBitmap(_,{imageOrientation:"flipY"}),this.width=this.texture.width,this.height=this.texture.height,this.app.telemetry?.addTextures(2),u(void 0)},_.onerror=(f)=>{this.app.telemetry?.addTextures(1),y(new Error(`texture load of ${this.url} failed: ${f.toString()}`))},_.src=this.url})}}var q=`#version 300 es
|
||||
uniform mat4 u_view;uniform mat4 u_projection;uniform mat4 u_object_to_world;uniform mat4 u_object_to_world_inv;uniform vec3 u_light_0;in vec4 a_vertex;in vec2 a_uv0;in vec3 a_normal;in vec4 a_vertex_color;out vec2 uv0;out vec3 normal;out vec4 vertex_color;out vec3 light_pos;
|
||||
#define ROUNDING_FACTOR 230.0f
|
||||
void main(){mat4 worldInv=inverse(u_view);mat4 MVW=u_projection*u_view*u_object_to_world;vec4 realPosition=MVW*a_vertex;realPosition.xyz=round(vec3(realPosition.xyz*ROUNDING_FACTOR))/ROUNDING_FACTOR;gl_Position=realPosition;uv0=a_uv0;normal=normalize(mat3(worldInv)*a_normal);vertex_color=a_vertex_color;light_pos=normalize(mat3(u_object_to_world_inv)*u_light_0);}`;
|
||||
export{n as a,q as b};
|
2
html/chunk-d24458ad0a4be457.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import{d as o} from"./chunk-0ef35489d83e6289.js";var u=new o({colors:null,faces:new Uint8Array([0,1,2,0,3,1]),name:"src/meshes/plane.ply",normals:null,positions:new Float32Array([1,-1,0,-1,1,0,-1,-1,0,1,1,0]),uvs:new Float32Array([1,0,0,1,0,0,1,1]),vertexCount:4});
|
||||
export{u as c};
|
BIN
html/fox-normal-7ce4a77b1285eb7a.png
Normal file
After Width: | Height: | Size: 2.6 MiB |
BIN
html/fox-tex-03f042508a92e722.png
Normal file
After Width: | Height: | Size: 977 KiB |
|
@ -31,6 +31,9 @@
|
|||
</header>
|
||||
<section id="works">
|
||||
<ul>
|
||||
<li><a href="/006-the-edge">./006-the-edge</a></li>
|
||||
<li><a href="/005-thoughtform-hidenoe">./005-thoughtform-hidenoe</a></li>
|
||||
<li><a href="/004-a-new-leaf">./004-a-new-leaf</a></li>
|
||||
<li><a href="/003-scene">./003-scene</a></li>
|
||||
<li><a href="/002-webgl-engine">./002-webgl-engine</a></li>
|
||||
<li><a href="/001-platform-provenance">./001-platform-provenance</a></li>
|
||||
|
|
BIN
html/ramp-aa773f5148819e95.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
html/texture0-577d5216cdab32bc.png
Normal file
After Width: | Height: | Size: 398 KiB |
BIN
html/texture1-e472a46c91711e86.png
Normal file
After Width: | Height: | Size: 5.7 MiB |
BIN
html/white-532695823c58790a.png
Normal file
After Width: | Height: | Size: 654 B |
|
@ -11,6 +11,54 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: none;
|
||||
z-index: 110;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
font-family: 'Fira Code', 'Fira Mono', monospace;
|
||||
|
||||
&.loading-active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
& #loading-text {
|
||||
background-color: black;
|
||||
padding: 1em;
|
||||
border-radius: 8px;
|
||||
max-width: 80vw;
|
||||
word-wrap: break-word;
|
||||
|
||||
& #stage1-error {
|
||||
opacity: 0;
|
||||
animation: opacity_0_1 1ms 5s forwards 1;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
& #stage1-error2 {
|
||||
opacity: 0;
|
||||
animation: opacity_0_1 1ms 10s forwards 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes opacity_0_1 {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
|
|
15
index.d.ts
vendored
|
@ -20,3 +20,18 @@ declare module "*.frag" {
|
|||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "*.html" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "*.md" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "*.png" {
|
||||
const path: string;
|
||||
export default path;
|
||||
}
|
||||
|
|
18
package.json
|
@ -4,32 +4,32 @@
|
|||
"main": "./hack/build.ts",
|
||||
"scripts": {
|
||||
"build": "bun $BUNFLAGS .",
|
||||
"build:watch": "nodemon -e ts,js,frag,vert,glsl,ply",
|
||||
"build:watch": "MINIFY=false nodemon -e ts,js,frag,vert,glsl,ply,png",
|
||||
"serve": "serve ./html",
|
||||
"dev": "run-p serve build:watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bun-types": "latest",
|
||||
"npm-run-all2": "^6.1.1",
|
||||
"nodemon": "^3.0.1",
|
||||
"prettier": "^3.0.3"
|
||||
"npm-run-all2": "^6.1.2",
|
||||
"nodemon": "^3.1.0",
|
||||
"prettier": "^3.2.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^5.3.0",
|
||||
"esbuild-plugin-glsl": "^1.2.2",
|
||||
"gl-matrix": "^3.4.3",
|
||||
"glob": "^10.3.10",
|
||||
"serve": "^14.2.1",
|
||||
"typescript": "^5.2.2"
|
||||
"glob": "^10.3.12",
|
||||
"serve": "^14.2.3",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"nodemonConfig": {
|
||||
"ignore": [
|
||||
"html/",
|
||||
"README.md",
|
||||
"src/meshes/*.ts"
|
||||
"src/meshes/**/*.ts"
|
||||
],
|
||||
"delay": 1000,
|
||||
"exec": "bun run . --"
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
bun
|
||||
nodejs
|
||||
];
|
||||
}
|
|
@ -1,30 +1,55 @@
|
|||
import { MeshRenderer } from "../renderer/mesh-renderer";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import { Renderable } from "../renderer/renderable";
|
||||
import { Transform } from "../renderer/transform";
|
||||
import torus from "../meshes/torus";
|
||||
import { errorShader } from "../common-shaders/error";
|
||||
import plane from "../meshes/plane";
|
||||
import { uvRainbow } from "../common-shaders/uv-rainbow";
|
||||
import uvsphere from "../meshes/uvsphere";
|
||||
import { Transform, etoq, v3 } from "../renderer/transform";
|
||||
import { quat } from "gl-matrix";
|
||||
import trianglething from "../meshes/trianglething";
|
||||
import teapot from "../meshes/teapot";
|
||||
import { trianglething, texture0, texture1 } from "../meshes/trianglething";
|
||||
import { basic } from "../common-shaders/basic";
|
||||
import { Texture } from "../renderer/texture";
|
||||
import { basicVertexRounding } from "../common-shaders/basic-vertex-rounding";
|
||||
|
||||
const app = new WebGLApp({ fov: 45 });
|
||||
|
||||
const camera = new Transform([0, -2, -6]);
|
||||
const camera = new Transform([2, 3, 3], etoq([-15, 40, 0]));
|
||||
const light = new Transform([2, 2, 0]);
|
||||
|
||||
const transform = new Transform(v3(0), etoq([0, 0, 0]));
|
||||
const transform2 = new Transform([-3, 0, 1], etoq([0, 0, 0]));
|
||||
|
||||
const trithingTexture = new Texture(app, texture0);
|
||||
const trithingTextureNormals = new Texture(app, texture1);
|
||||
|
||||
app.onUpdate(() => {
|
||||
quat.rotateY(transform.rotation, transform.rotation, 0.001);
|
||||
quat.rotateY(transform2.rotation, transform2.rotation, 0.001);
|
||||
});
|
||||
|
||||
new Renderable(
|
||||
app,
|
||||
new Transform(),
|
||||
new MeshRenderer(app, trianglething, uvRainbow(app), camera).configure({})
|
||||
transform,
|
||||
new MeshRenderer(
|
||||
app,
|
||||
trianglething,
|
||||
basicVertexRounding(app)
|
||||
.addTexture("texture0", trithingTexture)
|
||||
.addTexture("texture1", trithingTextureNormals),
|
||||
camera,
|
||||
light
|
||||
).configure({})
|
||||
);
|
||||
|
||||
// new Renderable(
|
||||
// app,
|
||||
// new Transform(),
|
||||
// new MeshRenderer(app, torus, uvRainbow(app), camera).configure({})
|
||||
// );
|
||||
new Renderable(
|
||||
app,
|
||||
transform2,
|
||||
new MeshRenderer(
|
||||
app,
|
||||
trianglething,
|
||||
basic(app)
|
||||
.addTexture("texture0", trithingTexture)
|
||||
.addTexture("texture1", trithingTextureNormals),
|
||||
camera,
|
||||
light
|
||||
).configure({})
|
||||
);
|
||||
|
||||
app.start();
|
||||
|
|
75
src/004-a-new-leaf/main.ts
Normal file
|
@ -0,0 +1,75 @@
|
|||
import { MeshRenderer } from "../renderer/mesh-renderer";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import { Renderable } from "../renderer/renderable";
|
||||
import { Transform, etoq, v3 } from "../renderer/transform";
|
||||
import { Texture } from "../renderer/texture";
|
||||
import { sonya } from "../common-shaders/sonya";
|
||||
import { cubeBackdrop, defaultTransform } from "../meshes/cube-backdrop";
|
||||
import { rgbToFloat } from "../renderer/color-utils";
|
||||
import rampTexture from "./textures/ramp.png";
|
||||
import fox from "../meshes/fox/fox";
|
||||
import foxImg from "../meshes/fox/fox-tex.png";
|
||||
import foxNormal from "../meshes/fox/fox-normal.png";
|
||||
import backdropImg from "./textures/backdrop.png";
|
||||
import backdropNormalsImg from "./textures/backdrop-normals.png";
|
||||
import { createWhiteTexture } from "../renderer/helper-textures/white";
|
||||
|
||||
const useAlt = location.search.includes("alt1");
|
||||
|
||||
const app = new WebGLApp({ fov: 45 });
|
||||
|
||||
const camera = new Transform([0, 2, 4], etoq([-15, 0, 0]));
|
||||
const light = new Transform([10, !useAlt ? 10 : -2, 10]);
|
||||
|
||||
const transform = new Transform(v3(0), etoq([0, 180 + 45, 0]), v3(0.1));
|
||||
|
||||
const ramp = new Texture(app, rampTexture, { uvClamp: true });
|
||||
const backdropTex = !useAlt
|
||||
? new Texture(app, backdropImg)
|
||||
: createWhiteTexture(app);
|
||||
const backdropNormalsTex = new Texture(app, backdropNormalsImg);
|
||||
const foxTex = !useAlt ? new Texture(app, foxImg) : createWhiteTexture(app);
|
||||
const foxNormalTex = new Texture(app, foxNormal);
|
||||
|
||||
const ambientLight = rgbToFloat(35, 76, 37);
|
||||
|
||||
app.onUpdate((time, app) => {
|
||||
// const wiggle = 40 * (Math.sin(time) * 0.001);
|
||||
// camera.position = [wiggle, 2, 4 - wiggle];
|
||||
});
|
||||
|
||||
new Renderable(
|
||||
app,
|
||||
transform,
|
||||
new MeshRenderer(
|
||||
app,
|
||||
fox,
|
||||
sonya(app, ambientLight)
|
||||
.addTexture("texture0", foxTex)
|
||||
.addTexture("texture1", foxNormalTex)
|
||||
.addTexture("texture2", ramp),
|
||||
camera,
|
||||
light
|
||||
).configure({})
|
||||
// true
|
||||
);
|
||||
|
||||
new Renderable(
|
||||
app,
|
||||
defaultTransform,
|
||||
new MeshRenderer(
|
||||
app,
|
||||
cubeBackdrop,
|
||||
sonya(app, ambientLight)
|
||||
.addTexture("texture0", backdropTex)
|
||||
.addTexture("texture1", backdropNormalsTex)
|
||||
.addTexture("texture2", ramp),
|
||||
camera,
|
||||
light
|
||||
).configure({})
|
||||
// true
|
||||
);
|
||||
|
||||
// createGizmo(app, camera, light);
|
||||
|
||||
app.start();
|
BIN
src/004-a-new-leaf/textures/backdrop-normals.png
Normal file
After Width: | Height: | Size: 8.6 MiB |
BIN
src/004-a-new-leaf/textures/backdrop.png
Normal file
After Width: | Height: | Size: 6.5 MiB |
BIN
src/004-a-new-leaf/textures/ramp.png
Normal file
After Width: | Height: | Size: 509 B |
63
src/005-thoughtform-hidenoe/main.ts
Normal file
|
@ -0,0 +1,63 @@
|
|||
import { MeshRenderer } from "../renderer/mesh-renderer";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import { Renderable } from "../renderer/renderable";
|
||||
import { Transform, etoq, v3 } from "../renderer/transform";
|
||||
import plane from "../meshes/plane";
|
||||
import { outer, outerFrags } from "./shaders/outer";
|
||||
import { frags, noe } from "./shaders/noe";
|
||||
import { createGizmo } from "../renderer/gizmo";
|
||||
|
||||
const app = new WebGLApp({ fov: 45 });
|
||||
|
||||
const camera = new Transform([0, 0, 2], etoq([0, 0, 0]));
|
||||
|
||||
const light = new Transform([1, -1, 0], etoq([0, 0, 0]));
|
||||
|
||||
const transformPlane = new Transform(v3(0), etoq([0, 180, 0]), v3(1.8));
|
||||
const transformSphere = new Transform(v3(0), etoq([0, 180, 180]), v3(0.6));
|
||||
|
||||
document.body.addEventListener("mousemove", (event) => {
|
||||
const { clientX, clientY } = event;
|
||||
const { clientWidth, clientHeight } = document.body;
|
||||
|
||||
const screenX = clientX / clientWidth;
|
||||
const screenY = clientY / clientHeight;
|
||||
|
||||
const centeredX = screenX * 2 - 1;
|
||||
const centeredY = screenY * 2 - 1;
|
||||
|
||||
light.position[1] = centeredX;
|
||||
light.position[0] = centeredY;
|
||||
});
|
||||
|
||||
app.onUpdate((time, app) => {});
|
||||
|
||||
let noeShader = frags.normal;
|
||||
let hShader = outerFrags.normal;
|
||||
if (location.search.includes("alt1")) {
|
||||
noeShader = frags.debug;
|
||||
}
|
||||
|
||||
if (location.search.includes("alt2")) {
|
||||
noeShader = frags.alt2;
|
||||
}
|
||||
|
||||
if (location.search.includes("alt3")) {
|
||||
hShader = outerFrags.alt3;
|
||||
}
|
||||
|
||||
new Renderable(
|
||||
app,
|
||||
transformPlane,
|
||||
new MeshRenderer(app, plane, outer(app, hShader), camera).configure({})
|
||||
);
|
||||
|
||||
new Renderable(
|
||||
app,
|
||||
transformSphere,
|
||||
new MeshRenderer(app, plane, noe(app, noeShader), camera, light).configure({})
|
||||
);
|
||||
|
||||
// createGizmo(app, camera, light);
|
||||
|
||||
app.start();
|
43
src/005-thoughtform-hidenoe/shaders/noe-alt2.frag
Normal file
|
@ -0,0 +1,43 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
// uniform mat4 u_view;
|
||||
// uniform mat4 u_projection;
|
||||
// uniform mat4 u_object_to_world;
|
||||
// uniform mat4 u_object_to_world_inv;
|
||||
// uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
in vec2 uv0;
|
||||
in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
const float margin = 0.9;
|
||||
|
||||
vec3 hsv2rgb(vec3 c) {
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
|
||||
void main() {
|
||||
// 0..1 to -1..1
|
||||
vec2 cUV = uv0 * 2.0 - 1.0;
|
||||
float circleDistance = length(cUV);
|
||||
if (circleDistance > margin) {
|
||||
discard;
|
||||
}
|
||||
|
||||
float theta = atan(cUV.y, cUV.x) ;
|
||||
float spiral = sin(100.0 * (sqrt(circleDistance*13.0) - (u_time * 0.0001) * theta - 0.01 * u_time * 0.001));
|
||||
|
||||
// float edgeLightZone = pow(clamp(abs(dot(cUV.xyx, light_pos)), 0.0, 1.0) * 2.0, 4.0);
|
||||
|
||||
float colorSpiral = sin(100.0 * (sqrt(circleDistance * 10.0) - 0.001 * theta - 0.3 * u_time * 0.00005));
|
||||
// vec3 hueRotation = hsv2rgb(vec3(colorSpiral, 1.0, 0.5));
|
||||
|
||||
fragColor = vec4(0, spiral, 0, 1.0);
|
||||
}
|
43
src/005-thoughtform-hidenoe/shaders/noe-debug.frag
Normal file
|
@ -0,0 +1,43 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
// uniform mat4 u_view;
|
||||
// uniform mat4 u_projection;
|
||||
// uniform mat4 u_object_to_world;
|
||||
// uniform mat4 u_object_to_world_inv;
|
||||
// uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
in vec2 uv0;
|
||||
in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
const float margin = 0.5;
|
||||
|
||||
vec3 hsv2rgb(vec3 c) {
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
|
||||
void main() {
|
||||
// 0..1 to -1..1
|
||||
vec2 cUV = uv0 * 2.0 - 1.0;
|
||||
float circleDistance = length(cUV);
|
||||
if (circleDistance > margin) {
|
||||
discard;
|
||||
}
|
||||
|
||||
float theta = atan(cUV.y, cUV.x) ;
|
||||
float spiral = sin(100.0 * (sqrt(circleDistance*20.0) - 10.0 * theta - 0.01 * u_time * 0.001));
|
||||
|
||||
float edgeLightZone = pow(clamp(abs(dot(cUV.xyx, light_pos)), 0.0, 1.0) * 2.0, 4.0);
|
||||
|
||||
float colorSpiral = sin(100.0 * (sqrt(circleDistance * 10.0) - 0.001 * theta - 0.3 * u_time * 0.00005));
|
||||
vec3 hueRotation = hsv2rgb(vec3(colorSpiral, 1.0, 0.5));
|
||||
|
||||
fragColor = vec4(colorSpiral, spiral, 1.0, 1.0);
|
||||
}
|
44
src/005-thoughtform-hidenoe/shaders/noe.frag
Normal file
|
@ -0,0 +1,44 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
// uniform mat4 u_view;
|
||||
// uniform mat4 u_projection;
|
||||
// uniform mat4 u_object_to_world;
|
||||
// uniform mat4 u_object_to_world_inv;
|
||||
// uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
in vec2 uv0;
|
||||
in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
const float margin = 0.5;
|
||||
|
||||
vec3 hsv2rgb(vec3 c) {
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
|
||||
void main() {
|
||||
// 0..1 to -1..1
|
||||
vec2 cUV = uv0 * 2.0 - 1.0;
|
||||
float circleDistance = length(cUV);
|
||||
if (circleDistance > margin) {
|
||||
discard;
|
||||
}
|
||||
|
||||
float theta = atan(cUV.y, cUV.x) ;
|
||||
float spiral = sin(100.0 * (sqrt(circleDistance*20.0) - 10.0 * theta - 0.01 * u_time * 0.001));
|
||||
|
||||
float edgeLightZone = pow(clamp(abs(dot(cUV.xyx, light_pos)), 0.0, 1.0) * 2.0, 4.0);
|
||||
|
||||
float colorSpiral = sin(100.0 * (sqrt(circleDistance * 10.0) - 0.001 * theta - 0.3 * u_time * 0.00005));
|
||||
vec3 hueRotation = hsv2rgb(vec3(colorSpiral, 1.0, 0.5));
|
||||
|
||||
fragColor = vec4(hueRotation * spiral * edgeLightZone, 1.0);
|
||||
fragColor.rgb += min(spiral, 0.0041666);
|
||||
}
|
38
src/005-thoughtform-hidenoe/shaders/noe.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { Shader, ShaderConfig } from "../../renderer/shader";
|
||||
import { WebGLApp } from "../../renderer/webgl";
|
||||
import vert from "../../common-shaders/basic.vert";
|
||||
import frag from "./noe.frag";
|
||||
import fragDebug from "./noe-debug.frag";
|
||||
import fragAlt2 from "./noe-alt2.frag";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
export const frags = {
|
||||
normal: frag,
|
||||
debug: fragDebug,
|
||||
alt2: fragAlt2,
|
||||
};
|
||||
|
||||
export const noe = (app: WebGLApp, fragShader: string = frag) =>
|
||||
new Shader(basicShaderConfig).vertex(vert).fragment(fragShader).app(app);
|
45
src/005-thoughtform-hidenoe/shaders/outer-alt3.frag
Normal file
|
@ -0,0 +1,45 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
uniform float u_time;
|
||||
|
||||
in vec2 uv0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
vec2 squareImaginary(vec2 number, float mod){
|
||||
return vec2(
|
||||
pow(number.x * mod,2.0) - pow(number.y * mod, 2.0),
|
||||
2.0 * number.x * number.y
|
||||
);
|
||||
}
|
||||
|
||||
float iterateMandelbrot(vec2 coord){
|
||||
vec2 z = vec2(0,0);
|
||||
float maxIterations = 69.0;
|
||||
|
||||
for (float i = 0.0; i < maxIterations; i++) {
|
||||
// float factor = cos((1.3*6.0) * sin(u_time * 0.0005));
|
||||
float mod = u_time * 0.0003;
|
||||
// mod = 0.5;
|
||||
z = squareImaginary(z, 1.0/mod) + coord;
|
||||
if (length(z) > 100.0) return i / float(maxIterations);
|
||||
}
|
||||
|
||||
return maxIterations;
|
||||
}
|
||||
|
||||
void main() {
|
||||
// uv0 is 0..1, we want to denormalize this to -1..1
|
||||
vec2 uvMirror = abs(uv0 * 2.0 - 1.0);
|
||||
fragColor = vec4(0.0);
|
||||
float mandelbrot = iterateMandelbrot((uvMirror.yx - vec2(-1.075, 1.0)) * 0.9);
|
||||
fragColor.r = mandelbrot;
|
||||
|
||||
vec2 outerNoise = (mandelbrot) * (1.0 - uvMirror * 0.5);
|
||||
fragColor.gb += (1.0 - mandelbrot) * outerNoise;
|
||||
|
||||
// fragColor.r += pow(1.0 - length(uvMirror), 18.0);
|
||||
|
||||
fragColor.a = 1.0;
|
||||
}
|
43
src/005-thoughtform-hidenoe/shaders/outer.frag
Normal file
|
@ -0,0 +1,43 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
uniform float u_time;
|
||||
|
||||
in vec2 uv0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
vec2 squareImaginary(vec2 number, float mod){
|
||||
return vec2(
|
||||
pow(number.x * mod,2.0) - pow(number.y * mod, 2.0),
|
||||
2.0 * number.x * number.y
|
||||
);
|
||||
}
|
||||
|
||||
float iterateMandelbrot(vec2 coord){
|
||||
vec2 z = vec2(0,0);
|
||||
float maxIterations = 100.0;
|
||||
|
||||
for (float i = 0.0; i < maxIterations; i++) {
|
||||
float factor = 2.6 + (1.3 * sin(u_time * 0.0001));
|
||||
z = squareImaginary(z, factor + 1.0) + (coord / factor);
|
||||
if (length(z) > 2.0) return i / float(maxIterations);
|
||||
}
|
||||
|
||||
return maxIterations;
|
||||
}
|
||||
|
||||
void main() {
|
||||
// uv0 is 0..1, we want to denormalize this to -1..1
|
||||
vec2 uvMirror = abs(uv0 * 2.0 - 1.0);
|
||||
fragColor = vec4(0.0);
|
||||
float mandelbrot = iterateMandelbrot((uvMirror.xy + vec2(0.14, -0.525)) * 0.9);
|
||||
fragColor.r = mandelbrot;
|
||||
|
||||
vec2 outerNoise = (mandelbrot) * (1.0 - uvMirror * 0.5);
|
||||
fragColor.gb += (1.0 - mandelbrot) * outerNoise;
|
||||
|
||||
fragColor.r += pow(1.0 - length(uvMirror), 8.0);
|
||||
|
||||
fragColor.a = 1.0;
|
||||
}
|
36
src/005-thoughtform-hidenoe/shaders/outer.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { Shader, ShaderConfig } from "../../renderer/shader";
|
||||
import { WebGLApp } from "../../renderer/webgl";
|
||||
import vert from "../../common-shaders/basic.vert";
|
||||
import frag from "./outer.frag";
|
||||
import fragAlt3 from "./outer-alt3.frag";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
export const outerFrags = {
|
||||
normal: frag,
|
||||
alt3: fragAlt3,
|
||||
};
|
||||
|
||||
export const outer = (app: WebGLApp, fragShader: string = frag) =>
|
||||
new Shader(basicShaderConfig).vertex(vert).fragment(fragShader).app(app);
|
25
src/006-the-edge/main.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { outer } from "../005-thoughtform-hidenoe/shaders/outer";
|
||||
import plane from "../meshes/plane";
|
||||
import { MeshRenderer } from "../renderer/mesh-renderer";
|
||||
import { Renderable } from "../renderer/renderable";
|
||||
import { etoq, Transform, v3 } from "../renderer/transform";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import { rail } from "./shaders/rail";
|
||||
|
||||
const app = new WebGLApp({ fov: 45 });
|
||||
|
||||
const camera = new Transform([0, 0, 2], etoq([0, 0, 0]));
|
||||
|
||||
const transformRail = new Transform(v3(0), etoq(v3(0)), [1000, 1, 1]);
|
||||
// new Renderable(
|
||||
// app,
|
||||
// transformRail,
|
||||
// new MeshRenderer(app, plane, outer(app), camera).configure({})
|
||||
// );
|
||||
new Renderable(
|
||||
app,
|
||||
transformRail,
|
||||
new MeshRenderer(app, plane, rail(app), camera).configure({})
|
||||
);
|
||||
|
||||
app.start();
|
157
src/006-the-edge/shaders/rail.frag
Normal file
|
@ -0,0 +1,157 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
/*
|
||||
This one is weird... We ran into engine limitations that won't exist in future iterations
|
||||
Namely that we don't have a way to get screen space pixel location yet.
|
||||
*/
|
||||
|
||||
uniform float u_time;
|
||||
|
||||
in vec2 uv0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
const float railWidth = 0.041666;
|
||||
const float railWiggle = 0.0015;
|
||||
|
||||
vec3 mod289(vec3 x) {
|
||||
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||
}
|
||||
|
||||
vec4 mod289(vec4 x) {
|
||||
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||
}
|
||||
|
||||
vec4 permute(vec4 x) {
|
||||
return mod289(((x*34.0)+1.0)*x);
|
||||
}
|
||||
|
||||
vec4 taylorInvSqrt(vec4 r)
|
||||
{
|
||||
return 1.79284291400159 - 0.85373472095314 * r;
|
||||
}
|
||||
|
||||
float snoise(vec3 v) {
|
||||
const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;
|
||||
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
|
||||
|
||||
// First corner
|
||||
vec3 i = floor(v + dot(v, C.yyy) );
|
||||
vec3 x0 = v - i + dot(i, C.xxx) ;
|
||||
|
||||
// Other corners
|
||||
vec3 g = step(x0.yzx, x0.xyz);
|
||||
vec3 l = 1.0 - g;
|
||||
vec3 i1 = min( g.xyz, l.zxy );
|
||||
vec3 i2 = max( g.xyz, l.zxy );
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxx;
|
||||
// x1 = x0 - i1 + 1.0 * C.xxx;
|
||||
// x2 = x0 - i2 + 2.0 * C.xxx;
|
||||
// x3 = x0 - 1.0 + 3.0 * C.xxx;
|
||||
vec3 x1 = x0 - i1 + C.xxx;
|
||||
vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y
|
||||
vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y
|
||||
|
||||
// Permutations
|
||||
i = mod289(i);
|
||||
vec4 p = permute( permute( permute(
|
||||
i.z + vec4(0.0, i1.z, i2.z, 1.0 ))
|
||||
+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))
|
||||
+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));
|
||||
|
||||
// Gradients: 7x7 points over a square, mapped onto an octahedron.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
|
||||
const float n_ = 0.142857142857; // 1.0/7.0
|
||||
vec3 ns = n_ * D.wyz - D.xzx;
|
||||
|
||||
vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)
|
||||
|
||||
vec4 x_ = floor(j * ns.z);
|
||||
vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)
|
||||
|
||||
vec4 x = x_ *ns.x + ns.yyyy;
|
||||
vec4 y = y_ *ns.x + ns.yyyy;
|
||||
vec4 h = 1.0 - abs(x) - abs(y);
|
||||
|
||||
vec4 b0 = vec4( x.xy, y.xy );
|
||||
vec4 b1 = vec4( x.zw, y.zw );
|
||||
|
||||
//vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
|
||||
//vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
|
||||
vec4 s0 = floor(b0)*2.0 + 1.0;
|
||||
vec4 s1 = floor(b1)*2.0 + 1.0;
|
||||
vec4 sh = -step(h, vec4(0, 0, 0, 0));
|
||||
|
||||
vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
|
||||
vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
|
||||
|
||||
vec3 p0 = vec3(a0.xy,h.x);
|
||||
vec3 p1 = vec3(a0.zw,h.y);
|
||||
vec3 p2 = vec3(a1.xy,h.z);
|
||||
vec3 p3 = vec3(a1.zw,h.w);
|
||||
|
||||
//Normalise gradients
|
||||
vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
|
||||
// Mix final noise value
|
||||
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
|
||||
m = m * m;
|
||||
return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
|
||||
dot(p2,x2), dot(p3,x3) ) );
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 cUV = uv0 * 2.0 - 1.0;
|
||||
float sintime = sin(u_time * 0.0001);
|
||||
|
||||
// wiggle
|
||||
float vY = cos(uv0.y * sintime);
|
||||
float vX = sin(uv0.x * sintime * 10000.0);
|
||||
float vibes = railWiggle * snoise(vec3(vY, vX, u_time));
|
||||
|
||||
// smoothly calculate the wiggle
|
||||
float rail = 1.0 - step(abs(pow(abs(cUV.y) - railWidth + vibes, 30.0)), 1.0);
|
||||
|
||||
// snip out wrapping
|
||||
// if (abs(cUV.y) > railWidth * 2.0) {
|
||||
// discard;
|
||||
// }
|
||||
|
||||
vec4 railColor = vec4(rail);
|
||||
|
||||
// albedo (staticy colorful <333)
|
||||
float noise = abs(sin(snoise(uv0.xxy * 10000. * u_time)));
|
||||
float noise2 = abs(sin(snoise(uv0.yxy * 10000.* u_time)));
|
||||
float noise3 = abs(sin(snoise(uv0.xyx * 10000. * u_time)));
|
||||
railColor.rgb -= (vec3(noise, noise2, noise3) * 0.3);
|
||||
|
||||
// simplex noise based on 3 moire spirals
|
||||
float theta = atan(cUV.y, uv0.x);
|
||||
float spiral = sin(10.0 * (sqrt(19.0 + (15.0 * sintime * 0.05))) - 1000.0 * theta - 0.01 * u_time * 0.0001);
|
||||
|
||||
float theta2 = atan(1.0-(cUV.y / 1000.0), uv0.x - (railWidth / 20.));
|
||||
float spiral2 = sin(10.0 * (sqrt(20.0 + u_time * 0.00001) - 10000.0 * theta2 - 0.01 * u_time * 0.0001));
|
||||
|
||||
float theta3 = atan(1.0 - uv0.y/10.0, uv0.x);
|
||||
float spiral3 = sin(100.0 * (sqrt(100.0 + uv0.y) - 100000.0 * theta3 - 0.01 * sintime * 0.0001));
|
||||
|
||||
float sparkleNoise = snoise(vec3(spiral, spiral2, u_time * 0.00001));
|
||||
fragColor.r = step(abs(spiral2 * spiral * sparkleNoise), mix(0.0333, 0.0666, abs(uv0.y + sin(u_time * 0.00001))));
|
||||
fragColor.r *= pow(1.0 - abs(cUV.y), 3.0) * abs(spiral3);
|
||||
fragColor.r *= 10.0;
|
||||
|
||||
if (cUV.y > 0.0) {
|
||||
fragColor.r = 0.0;
|
||||
}
|
||||
|
||||
// fragColor.g = spiral3;
|
||||
|
||||
// keep within 0-1
|
||||
fragColor = clamp(vec4(fragColor + railColor), vec4(0), vec4(1));
|
||||
}
|
35
src/006-the-edge/shaders/rail.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { Shader, ShaderConfig } from "../../renderer/shader";
|
||||
import { WebGLApp } from "../../renderer/webgl";
|
||||
import vert from "../../common-shaders/basic.vert";
|
||||
import frag from "./rail.frag";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
// export const outerFrags = {
|
||||
// normal: frag,
|
||||
// alt3: fragAlt3,
|
||||
// };
|
||||
|
||||
export const rail = (app: WebGLApp, fragShader: string = frag) =>
|
||||
new Shader(basicShaderConfig).vertex(vert).fragment(fragShader).app(app);
|
30
src/common-shaders/basic-vertex-rounding.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { Shader, ShaderConfig } from "../renderer/shader";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import frag from "./basic.frag";
|
||||
import vert from "./basic-vertex-rounding.vert";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
export const basicVertexRounding = (app: WebGLApp) =>
|
||||
new Shader(basicShaderConfig).vertex(vert).fragment(frag).app(app);
|
35
src/common-shaders/basic-vertex-rounding.vert
Normal file
|
@ -0,0 +1,35 @@
|
|||
#version 300 es
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
uniform mat4 u_object_to_world;
|
||||
uniform mat4 u_object_to_world_inv;
|
||||
uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
// uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
in vec4 a_vertex;
|
||||
in vec2 a_uv0;
|
||||
in vec3 a_normal;
|
||||
in vec4 a_vertex_color;
|
||||
|
||||
out vec2 uv0;
|
||||
out vec3 normal;
|
||||
out vec4 vertex_color;
|
||||
out vec3 light_pos;
|
||||
|
||||
#define ROUNDING_FACTOR 230.0f
|
||||
|
||||
void main() {
|
||||
mat4 worldInv = inverse(u_view);
|
||||
mat4 MVW = u_projection * u_view * u_object_to_world;
|
||||
vec4 realPosition = MVW * a_vertex;
|
||||
realPosition.xyz = round(vec3(realPosition.xyz * ROUNDING_FACTOR)) / ROUNDING_FACTOR;
|
||||
gl_Position = realPosition;
|
||||
|
||||
uv0 = a_uv0;
|
||||
normal = normalize(mat3(worldInv) * a_normal);
|
||||
vertex_color = a_vertex_color;
|
||||
light_pos = normalize(mat3(u_object_to_world_inv) * u_light_0);
|
||||
|
||||
}
|
|
@ -1,6 +1,32 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
// uniform mat4 u_view;
|
||||
// uniform mat4 u_projection;
|
||||
// uniform mat4 u_object_to_world;
|
||||
// uniform mat4 u_object_to_world_inv;
|
||||
// uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
// uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
uniform sampler2D u_texture_0;
|
||||
uniform sampler2D u_texture_1;
|
||||
|
||||
in vec2 uv0;
|
||||
in vec3 normal;
|
||||
in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
|
||||
vec4 normalTex = texture(u_texture_1, uv0);
|
||||
vec3 normal = normalize(normal * normalTex.xyz);
|
||||
|
||||
float light = dot(normal, light_pos);
|
||||
|
||||
fragColor = vec4(1.0);
|
||||
fragColor.rgb = texture(u_texture_0, uv0).rgb;
|
||||
fragColor.rgb *= max(light, 0.1);
|
||||
fragColor.a = 1.0;
|
||||
}
|
|
@ -4,16 +4,26 @@ import frag from "./basic.frag";
|
|||
import vert from "./basic.vert";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
model: 0,
|
||||
view: 4,
|
||||
projection: 8,
|
||||
world: 12,
|
||||
light0: 13,
|
||||
light0Color: 17,
|
||||
uv0: 18,
|
||||
normals: 19,
|
||||
vertexColor: 20,
|
||||
time: 21,
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
export const basic = (app: WebGLApp) =>
|
||||
|
|
|
@ -1,17 +1,34 @@
|
|||
#version 300 es
|
||||
layout(location = 0) in mat4 model;
|
||||
layout(location = 4) in mat4 view;
|
||||
layout(location = 8) in mat4 projection;
|
||||
layout(location = 12) in vec3 worldPos;
|
||||
layout(location = 13) in mat4 light0;
|
||||
layout(location = 17) in vec4 light0Color;
|
||||
layout(location = 18) in vec2 uv0;
|
||||
layout(location = 19) in vec3 normals;
|
||||
layout(location = 20) in vec4 vertexColor;
|
||||
layout(location = 21) in float time;
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
uniform mat4 u_object_to_world;
|
||||
uniform mat4 u_object_to_world_inv;
|
||||
uniform vec3 u_light_0;
|
||||
// uniform vec4 u_light_0_color;
|
||||
// uniform float u_time;
|
||||
// uniform vec4 u_albedo;
|
||||
|
||||
// injection point
|
||||
in vec4 a_vertex;
|
||||
in vec2 a_uv0;
|
||||
in vec3 a_normal;
|
||||
in vec4 a_vertex_color;
|
||||
|
||||
out vec2 uv0;
|
||||
out vec3 normal;
|
||||
out vec4 vertex_color;
|
||||
out vec3 light_pos;
|
||||
|
||||
// injection point 1
|
||||
|
||||
void main() {
|
||||
gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;
|
||||
mat4 worldInv = inverse(u_view);
|
||||
mat4 MVW = u_projection * u_view * u_object_to_world;
|
||||
gl_Position = MVW * a_vertex;
|
||||
|
||||
uv0 = a_uv0;
|
||||
normal = normalize(mat3(worldInv) * a_normal);
|
||||
vertex_color = a_vertex_color;
|
||||
light_pos = normalize(mat3(u_object_to_world_inv) * u_light_0);
|
||||
|
||||
// injection point 2
|
||||
}
|
|
@ -1,5 +1,18 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
uniform float u_time;
|
||||
|
||||
// in vec2 uv0;
|
||||
// in vec3 normal;
|
||||
// in vec4 vertex_color;
|
||||
// in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
|
||||
|
||||
|
||||
fragColor = vec4(1.0, 0.0, 1.0, 1.0);
|
||||
}
|
|
@ -1,7 +1,26 @@
|
|||
import { Shader } from "../renderer/shader";
|
||||
import { Shader, ShaderConfig } from "../renderer/shader";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import frag from "./error.frag";
|
||||
import vert from "./error.vert";
|
||||
import vert from "./basic.vert";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
},
|
||||
};
|
||||
|
||||
export const errorShader = (app: WebGLApp) =>
|
||||
new Shader().vertex(vert).fragment(frag).app(app);
|
||||
new Shader(basicShaderConfig).vertex(vert).fragment(frag).app(app);
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
attribute vec4 aVertexPosition;
|
||||
|
||||
uniform mat4 uModelViewMatrix;
|
||||
uniform mat4 uProjectionMatrix;
|
||||
|
||||
void main() {
|
||||
gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;
|
||||
}
|
37
src/common-shaders/sonya.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { Shader, ShaderConfig } from "../renderer/shader";
|
||||
import { WebGLApp } from "../renderer/webgl";
|
||||
import frag from "./toon-shading.frag";
|
||||
import vert from "./basic-vertex-rounding.vert";
|
||||
import { vec4 } from "gl-matrix";
|
||||
|
||||
export const basicShaderConfig: ShaderConfig = {
|
||||
attributes: {
|
||||
vertex: "a_vertex",
|
||||
uv0: "a_uv0",
|
||||
normal: "a_normal",
|
||||
vertexColor: "a_vertex_color",
|
||||
},
|
||||
|
||||
uniforms: {
|
||||
view: "u_view",
|
||||
projection: "u_projection",
|
||||
objectToWorld: "u_object_to_world",
|
||||
objectToWorldInv: "u_object_to_world_inv",
|
||||
light0: "u_light_0",
|
||||
light0Color: "u_light_0_color",
|
||||
time: "u_time",
|
||||
albedo: "u_albedo",
|
||||
texture0: "u_texture_0",
|
||||
texture1: "u_texture_1",
|
||||
texture2: "u_texture_2",
|
||||
},
|
||||
};
|
||||
|
||||
export const sonya = (app: WebGLApp, ambientLight: vec4 = [0.1, 0.1, 0.1, 1]) =>
|
||||
new Shader(basicShaderConfig)
|
||||
.vertex(vert)
|
||||
.fragment(frag)
|
||||
.app(app)
|
||||
.prerenderHook(({ gl }: WebGLApp, shader: Shader) => {
|
||||
gl.uniform4fv(shader.mappings.uniforms.albedo, ambientLight);
|
||||
});
|
30
src/common-shaders/toon-shading.frag
Normal file
|
@ -0,0 +1,30 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
uniform vec4 u_light_0_color;
|
||||
uniform vec4 u_albedo; // ambient color
|
||||
|
||||
uniform sampler2D u_texture_0;
|
||||
uniform sampler2D u_texture_1;
|
||||
uniform sampler2D u_texture_2;
|
||||
|
||||
in vec2 uv0;
|
||||
in vec3 normal;
|
||||
in vec3 light_pos;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
// vec4 normalTex = texture(u_texture_1, uv0);
|
||||
// vec3 normal = normalize(normal * normalTex.rgb);
|
||||
vec3 normal = normalize(normal);
|
||||
|
||||
float light = clamp(dot(normal, light_pos), 0.0, 1.0);
|
||||
|
||||
vec3 ramp = texture(u_texture_2, vec2(light, 0.0)).rgb;
|
||||
|
||||
fragColor = vec4(1.0);
|
||||
fragColor.rgb = texture(u_texture_0, uv0).rgb;
|
||||
fragColor.rgb *= ramp;
|
||||
fragColor.a = 1.0;
|
||||
}
|
11
src/common-shaders/vertex-colors.frag
Normal file
|
@ -0,0 +1,11 @@
|
|||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
in vec4 vertex_color;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
|
||||
void main() {
|
||||
fragColor = vertex_color;
|
||||
}
|
BIN
src/meshes/cube-backdrop/cube-backdrop.blend
Normal file
29
src/meshes/cube-backdrop/cube-backdrop.ply
Normal file
|
@ -0,0 +1,29 @@
|
|||
ply
|
||||
format ascii 1.0
|
||||
comment Created in Blender version 3.6.4
|
||||
element vertex 8
|
||||
property float x
|
||||
property float y
|
||||
property float z
|
||||
property float nx
|
||||
property float ny
|
||||
property float nz
|
||||
property float s
|
||||
property float t
|
||||
element face 6
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
-0.10000001 -0.0025735903 -0.10000001 0.5773503 0.5773503 0.5773503 0.5 0.5
|
||||
-0.10000001 0.19742644 0.10000001 1 0 0 -5.9604645e-08 1
|
||||
-0.10000001 -0.0025735903 0.10000001 0.70710677 0.70710677 0 0 0.49999997
|
||||
0.10000001 -0.0025735903 -0.10000001 0 0.70710677 0.70710677 1 0.50000006
|
||||
-0.10000001 0.19742644 -0.10000001 0.70710677 0 0.70710677 0.49999997 1
|
||||
0.10000001 -0.0025735903 0.10000001 0 1 0 1 0
|
||||
0.10000001 0.19742644 -0.10000001 0 0 1 1 1
|
||||
-0.10000001 -0.0025735903 0.10000001 0.70710677 0.70710677 0 0.50000006 0
|
||||
3 0 1 2
|
||||
3 3 4 0
|
||||
3 0 5 3
|
||||
3 0 4 1
|
||||
3 3 6 4
|
||||
3 0 7 5
|
12
src/meshes/cube-backdrop/cube-backdrop.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Mesh } from "../../renderer/mesh";
|
||||
|
||||
// prettier-ignore
|
||||
export default new Mesh({
|
||||
colors: null,
|
||||
faces: new Uint8Array([0,1,2,3,4,0,0,5,3,0,4,1,3,6,4,0,7,5]),
|
||||
name: "src/meshes/cube-backdrop/cube-backdrop.ply",
|
||||
normals: new Float32Array([0.5773503,0.5773503,0.5773503,1,0,0,0.70710677,0.70710677,0,0,0.70710677,0.70710677,0.70710677,0,0.70710677,0,1,0,0,0,1,0.70710677,0.70710677,0]),
|
||||
positions: new Float32Array([-0.10000001,-0.0025735903,-0.10000001,-0.10000001,0.19742644,0.10000001,-0.10000001,-0.0025735903,0.10000001,0.10000001,-0.0025735903,-0.10000001,-0.10000001,0.19742644,-0.10000001,0.10000001,-0.0025735903,0.10000001,0.10000001,0.19742644,-0.10000001,-0.10000001,-0.0025735903,0.10000001]),
|
||||
uvs: new Float32Array([0.5,0.5,-5.9604645e-8,1,0,0.49999997,1,0.50000006,0.49999997,1,1,0,1,1,0.50000006,0]),
|
||||
vertexCount: 8
|
||||
});
|
6
src/meshes/cube-backdrop/index.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { Transform, etoq, v3 } from "../../renderer/transform";
|
||||
import cubeBackdrop from "./cube-backdrop";
|
||||
|
||||
export const defaultTransform = new Transform(v3(0), etoq([0, -45, 0]), v3(20));
|
||||
|
||||
export { cubeBackdrop };
|
BIN
src/meshes/cube-backdrop/uv-template.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
src/meshes/fox/fox-normal.png
Normal file
After Width: | Height: | Size: 2.6 MiB |
BIN
src/meshes/fox/fox-tex.png
Normal file
After Width: | Height: | Size: 977 KiB |
BIN
src/meshes/fox/fox-tex.xcf
Normal file
BIN
src/meshes/fox/fox-uv.png
Normal file
After Width: | Height: | Size: 326 KiB |
BIN
src/meshes/fox/fox.blend
Normal file
674
src/meshes/fox/fox.ply
Normal file
|
@ -0,0 +1,674 @@
|
|||
ply
|
||||
format ascii 1.0
|
||||
comment Created in Blender version 3.6.4
|
||||
element vertex 285
|
||||
property float x
|
||||
property float y
|
||||
property float z
|
||||
property float nx
|
||||
property float ny
|
||||
property float nz
|
||||
property float s
|
||||
property float t
|
||||
element face 374
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
-0.6999253 6.443001 -0.82603 0.3475203 -0.1423119 -0.92681 0.21851481 0.38709354
|
||||
0.07097474 5.343301 -0.52663046 0.5162422 0.12797521 -0.8468272 0.25122124 0.29925498
|
||||
-0.76262593 4.472701 -1.15393 0.15832935 0.05530619 -0.98583627 0.33613995 0.31277353
|
||||
-1.7783258 5.520501 -0.86433035 -0.34248725 0.027904412 -0.9391081 0.31780326 0.41546077
|
||||
-2.2427258 6.713101 -0.82603 -0.5169309 -0.31768712 -0.7948945 0.26634175 0.49754715
|
||||
-1.5250261 4.4763007 -0.9856301 -0.48697895 -0.1626665 -0.85813236 0.36926088 0.35428312
|
||||
0.29497454 9.249201 0.16336976 0.979832 0.13666466 -0.14578043 0.8862014 0.7660378
|
||||
0.06327439 8.8725 -0.28472978 0.9031805 0.21487509 -0.37160963 0.96414614 0.65773886
|
||||
-0.035225682 9.543601 0.14946976 0.66321534 0.26724067 -0.6990907 0.9142767 0.82184976
|
||||
-0.30342564 9.674201 -0.23032992 0.6848186 0.23503296 -0.68977004 0.96414614 0.8656495
|
||||
2.4808748 3.6319008 -0.11143037 0.50283414 0.37262148 -0.779943 0.24378048 0.15517116
|
||||
2.0297747 3.2159004 -0.4459305 0.23640795 0.47815725 -0.84585875 0.27324826 0.1538348
|
||||
1.5565743 4.603301 -0.21123049 0.3647613 0.40136182 -0.8401535 0.24071635 0.21034758
|
||||
2.1004748 3.2381003 3.2929707 0.3046436 0.23757984 0.92236 0.12782207 0.13377228
|
||||
1.8371744 4.748301 2.81227 0.31008115 0.576068 0.7563038 0.13686845 0.17050092
|
||||
0.20437472 4.420901 2.9141703 -0.22806334 0.32389933 0.91819185 0.097095504 0.18026535
|
||||
1.8253747 0.4645001 -1.7956301 0.17951295 -0.316014 -0.931617 0.3456612 0.015984222
|
||||
0.91437465 0.9539002 -2.1209302 -0.17395478 -0.060770363 -0.9828767 0.38372317 0.05219409
|
||||
2.4374743 1.0497 -1.8992304 0.3371145 -0.028111659 -0.94104385 0.3173124 0.03967564
|
||||
2.5767748 2.7875004 -0.6003304 0.5286752 0.36182427 -0.76784486 0.2669188 0.12665303
|
||||
1.7599748 1.8992002 -1.1086301 0.37282482 0.34924614 -0.8596678 0.3150151 0.10144508
|
||||
1.5595742 2.5219004 -1.29143 0.04436654 0.3120137 -0.9490411 0.312529 0.12937495
|
||||
0.24357454 3.5395007 -0.67183006 0.1748497 -0.08175629 -0.981195 0.32927862 0.22344446
|
||||
0.24817431 4.333201 -0.45933002 0.4760932 0.18387188 -0.8599573 0.2904697 0.2528519
|
||||
-0.3960259 7.7391005 -1.2657304 0.77194935 -0.10489054 -0.6269707 0.13747068 0.42125323
|
||||
0.05687409 8.074501 -0.67993015 0.8878576 0.018637033 -0.45974046 0.1110152 0.38961607
|
||||
-0.12432557 6.748201 -0.34603044 0.8233882 0.00536109 -0.5674533 0.17645767 0.34971166
|
||||
-0.06132584 2.9543004 -0.8707303 0.50706327 0.2949509 -0.8098708 0.37940347 0.20685007
|
||||
-0.20062563 3.4773006 -0.68853 0.5776023 0.024086185 -0.8159629 0.3529383 0.23464157
|
||||
0.43317416 2.5253003 -0.46623006 0.20082258 0.4428197 -0.8738313 0.35064337 0.17517665
|
||||
-0.4904259 2.1981003 -0.90393 -0.3673268 -0.008583662 -0.9300523 0.43924242 0.18647039
|
||||
-1.0552258 3.1734004 -1.06763 -0.23037066 -0.14419852 -0.9623597 0.41530237 0.2674248
|
||||
1.4597749 1.4790002 -2.0267305 0.10130113 0.55220604 -0.82753044 0.34998143 0.06725915
|
||||
-1.8893259 8.729101 -1.7110304 -0.30028316 0.6138469 -0.7300836 0.12322961 0.6801839
|
||||
-2.2624261 9.345001 -1.37473 -0.42857707 0.59847176 -0.67687017 0.1720783 0.6964544
|
||||
-0.97242594 9.702102 -0.89533013 0.2310956 0.77802414 -0.5841861 0.16144735 0.7933706
|
||||
-1.2870256 7.527001 -2.5206306 0.40507296 -0.59645694 -0.69293207 0.8861246 0.52512723
|
||||
-1.5926256 8.311801 -2.8306303 0.018303465 0.44150117 -0.8970739 0.84557533 0.5134298
|
||||
-0.3960259 7.7391005 -1.2657304 0.77194935 -0.10489054 -0.6269707 0.9878913 0.42880467
|
||||
2.5549746 1.4319001 2.9302707 0.6770759 -0.15234865 0.71997094 0.12832226 0.086800925
|
||||
2.773675 2.7475002 3.0280704 0.5551748 0.09818922 0.82591754 0.14096868 0.11748978
|
||||
-0.94812554 8.5809 -1.5055304 0.5862696 0.275684 -0.7617652 0.074313566 0.7435197
|
||||
0.05687409 8.074501 -0.67993015 0.8878576 0.018637033 -0.45974046 0.020883663 0.84153533
|
||||
-0.3960259 7.7391005 -1.2657304 0.77194935 -0.10489054 -0.6269707 1.081579e-08 0.77996564
|
||||
-0.40532535 9.700401 0.84696966 0.3452935 0.52275664 0.7794215 0.32931674 0.8416559
|
||||
-1.540426 8.934701 1.6871705 -0.037781123 0.40868607 0.9118927 0.35599756 0.7471563
|
||||
-0.62042546 7.995201 1.7714701 0.47639555 0.22756127 0.8492721 0.4352468 0.76457715
|
||||
-0.15842591 5.3485007 2.2917705 0.038687505 0.4890638 0.87138975 0.09890157 0.21372627
|
||||
3.3480747 1.1927001 -1.4741304 0.4779266 0.31795877 -0.8188335 0.28071728 0.038383927
|
||||
0.23047411 6.9421005 0.8096703 0.9412043 0.3062575 0.14262189 0.12732372 0.2965882
|
||||
0.17777406 7.816401 -0.13533022 0.985557 -0.050912835 -0.16150954 0.11473294 0.36185902
|
||||
-0.80692565 9.159501 -1.4650301 0.41709664 0.43660966 -0.79712135 0.110673696 0.76611084
|
||||
0.73637474 6.182101 0.90636986 0.65320575 0.7567542 -0.025403246 0.1568792 0.258202
|
||||
0.16357423 6.238301 1.5856699 0.5102622 0.5121896 0.6908649 0.11916661 0.24799357
|
||||
2.0266747 5.562201 1.4546701 0.5327677 0.8339708 0.14370571 0.1670033 0.20147358
|
||||
3.4768748 0.57150006 -1.4508302 0.50982845 -0.2752561 -0.81505156 0.27564877 0.017370421
|
||||
4.1452746 0.9685002 -0.7070302 0.9362124 0.034893714 -0.34969804 0.24627076 0.033188876
|
||||
2.576082 3.1560004 -0.31358007 0.49277383 0.474742 -0.729242 0.25064924 0.13463129
|
||||
0.7198746 2.4339004 3.54267 -0.10767815 0.15382154 0.98221403 0.09065693 0.12818988
|
||||
2.288975 1.3705001 3.4610705 0.53157943 -0.18795584 0.825891 0.11538713 0.09199737
|
||||
-0.40532535 9.700401 0.84696966 0.3452935 0.52275664 0.7794215 0.8276462 0.8879465
|
||||
0.14267427 10.748201 0.011170197 0.73606163 0.6634644 -0.13426952 0.8977165 0.9073449
|
||||
-0.35632557 10.885501 -0.026630403 -0.17794462 0.9747583 -0.13484038 0.8979689 0.9335955
|
||||
-1.0288259 10.067701 0.053869635 -0.38528097 0.9081675 0.1636775 0.24703515 0.8216678
|
||||
-1.2105256 9.758201 0.87647027 0.03706524 0.8542405 0.51855505 0.30523577 0.7905776
|
||||
0.09657441 8.901701 0.59447026 0.90783143 0.11600388 0.40297043 0.8020745 0.7431329
|
||||
3.0635746 4.299401 1.8075701 0.8010637 0.5264299 0.2849009 0.17493051 0.15400115
|
||||
2.5929751 4.772801 0.5979699 0.6885465 0.57700217 -0.43928608 0.20319703 0.1803566
|
||||
0.16167451 9.942601 0.37547 0.95855004 0.10577212 0.26456407 0.89068747 0.8602873
|
||||
-0.94812554 8.5809 -1.5055304 0.5862696 0.275684 -0.7617652 0.8669603 0.42128757
|
||||
0.47697452 6.306901 0.39987034 0.78829354 0.5408408 -0.2934015 0.1696568 0.2862294
|
||||
3.0665743 0.73340005 -1.42483 0.21502984 0.04666299 -0.97549206 0.29085746 0.022808408
|
||||
0.6858742 3.7022007 -0.62512976 0.102968186 0.09595936 -0.9900452 0.30401754 0.21331184
|
||||
0.044074252 1.8123003 -1.5475305 -0.42321405 0.5065525 -0.7511954 0.4063384 0.124203816
|
||||
-0.053825382 1.2451001 -1.5953302 -0.69715625 -0.08602459 -0.71173936 0.4319168 0.09517003
|
||||
3.2380748 2.4352005 -0.08572999 0.82457936 0.081235796 -0.5598835 0.24068871 0.10983848
|
||||
0.5252747 5.1989007 -0.29223025 0.4377959 0.26956058 -0.85771316 0.2422915 0.26877972
|
||||
0.8465745 5.738801 0.27866977 0.6155783 0.5745703 -0.5393813 0.19642983 0.2589539
|
||||
-0.7709256 5.724101 2.2065706 0.07019434 0.24138543 0.9678872 0.084621415 0.22762483
|
||||
-0.619426 6.356501 1.9183702 0.3541473 0.25355586 0.9001605 0.08997824 0.2432744
|
||||
-1.9789258 7.178801 -1.18583 -0.29064578 -0.724498 -0.62500215 0.21659407 0.49825695
|
||||
-0.91182566 7.3815007 -1.4608301 0.375913 -0.73612595 -0.56285685 0.16409814 0.4431432
|
||||
0.09657441 8.901701 0.59447026 0.90783143 0.11600388 0.40297043 0.06007273 0.3584054
|
||||
0.06327439 8.8725 -0.28472978 0.9031805 0.21487509 -0.37160963 0.077401064 0.3881148
|
||||
3.0936747 0.6671002 2.4830706 0.5472127 -0.29103354 0.7847661 0.13976377 0.06055675
|
||||
4.0453753 0.52309996 1.4920702 0.87695193 -0.2072897 0.4335738 0.1772671 0.045047924
|
||||
3.6563747 2.4587002 2.1933703 0.8803676 0.14394727 0.45192042 0.1689892 0.10318307
|
||||
0.5219742 1.8811003 -1.0851305 0.15257555 0.7520019 -0.64125955 0.36747235 0.13334484
|
||||
1.1984742 1.6896003 -1.65813 0.073696144 0.91218823 -0.40308988 0.35129 0.09048066
|
||||
2.625175 1.7991003 -0.6557297 0.48116767 0.69189876 -0.5382877 0.27406374 0.088201545
|
||||
0.67027444 0.5334 -1.9347303 -0.38885155 -0.2292497 -0.8923223 0.40481266 0.033736143
|
||||
1.2843744 3.0958004 -0.5304299 -0.08802483 0.3184032 -0.94385976 0.3024185 0.17043002
|
||||
0.77727437 1.2146001 3.4750705 -0.16566989 -0.31949857 0.9329921 0.080950305 0.101946086
|
||||
3.4174747 1.7396003 -0.85813 0.4088575 0.88988423 -0.20234066 0.26399732 0.060749806
|
||||
2.3443742 1.5199003 -1.5742303 0.23401263 0.7841241 -0.5747935 0.3123137 0.06264582
|
||||
0.06327439 8.8725 -0.28472978 0.9031805 0.21487509 -0.37160963 0.08229262 0.8732247
|
||||
-1.8893259 8.729101 -1.7110304 -0.30028316 0.6138469 -0.7300836 0.78262734 0.48695683
|
||||
-0.62042546 7.995201 1.7714701 0.47639555 0.22756127 0.8492721 0.054573745 0.28939876
|
||||
-1.219426 6.696401 2.0643702 -0.13893181 0.08481444 0.98666334 0.4784059 0.67288846
|
||||
-0.619426 6.356501 1.9183702 0.3541473 0.25355586 0.9001605 0.52534187 0.6902852
|
||||
-2.161226 7.667401 -2.4847305 -0.6594078 -0.34964943 -0.6655273 0.843693 0.54919225
|
||||
-0.91182566 7.3815007 -1.4608301 0.375913 -0.73612595 -0.56285685 0.967211 0.5381632
|
||||
-1.9789258 7.178801 -1.18583 -0.29064578 -0.724498 -0.62500215 0.8863765 0.6507956
|
||||
3.1734743 1.5024002 0.15137026 0.7611686 0.58185023 -0.28648314 0.23814057 0.07682296
|
||||
-0.7888257 10.067701 -0.3484299 -0.04397583 0.70420456 -0.7086339 0.52430856 0.78790325
|
||||
0.14267427 10.748201 0.011170197 0.73606163 0.6634644 -0.13426952 0.5076637 0.9781552
|
||||
-0.30342564 9.674201 -0.23032992 0.6848186 0.23503296 -0.68977004 0.42495766 0.8044593
|
||||
-1.0288259 10.067701 0.053869635 -0.38528097 0.9081675 0.1636775 0.88358545 0.94791806
|
||||
0.09657441 8.901701 0.59447026 0.90783143 0.11600388 0.40297043 0.39027283 0.865766
|
||||
3.387675 3.7165008 1.58967 0.9180944 0.3928391 0.052727237 0.18311635 0.13782379
|
||||
-0.30342564 9.674201 -0.23032992 0.6848186 0.23503296 -0.68977004 0.15227878 0.86758876
|
||||
-2.2445261 4.9454007 -0.66073006 -0.75246775 0.008946161 -0.6585683 0.37036988 0.41615537
|
||||
3.6162753 2.8629005 0.8747697 0.93610126 0.23180684 -0.26453748 0.20584682 0.11498356
|
||||
-0.7888257 10.067701 -0.3484299 -0.04397583 0.70420456 -0.7086339 0.935007 0.9301176
|
||||
-0.7888257 10.067701 -0.3484299 -0.04397583 0.70420456 -0.7086339 0.19761893 0.83779246
|
||||
4.364375 1.0550001 0.5702698 0.92324126 0.38289523 0.03188642 0.20950294 0.045586396
|
||||
-0.61192554 1.0255002 2.04657 -0.8208653 0.15153797 0.55065095 0.0322884 0.11481223
|
||||
-1.0520257 0.52869993 2.4247699 -0.6847748 0.31241915 0.6583902 0.02451134 0.09802288
|
||||
-0.0897255 0.5721001 2.6455705 -0.44955286 -0.170653 0.87680095 0.048454616 0.09665558
|
||||
-2.517626 0.78980017 0.25796968 -0.69434595 0.69967836 -0.16832665 0.6460075 0.21836895
|
||||
-1.337726 0.8835 0.28996965 -0.64949834 0.59640735 -0.47164628 0.5963892 0.2274105
|
||||
-1.4268259 0.95919997 -0.43353048 -0.72120667 0.6666094 -0.18839571 0.5771463 0.1884031
|
||||
-0.44272542 1.0345002 -0.70443004 -0.44213012 -0.017088598 -0.8967881 0.5055221 0.114784405
|
||||
-1.0315259 1.0731 -0.7273301 -0.16689667 0.37004504 -0.9138995 0.5447714 0.15467297
|
||||
-1.0638257 2.0252004 -0.7415303 -0.32365012 -0.16409263 -0.93183917 0.48357084 0.21026236
|
||||
-3.471126 10.565201 0.1122696 -0.81858766 0.5451293 -0.18096499 0.75558704 0.9432239
|
||||
-3.4521263 9.519001 0.46967015 -0.992983 0.08945896 0.07734239 0.8020744 0.9034289
|
||||
-2.878626 9.963901 0.81987005 -0.21252948 0.5347677 0.81783545 0.7897775 0.96688294
|
||||
-2.741226 7.508901 1.3471704 -0.7021046 -0.14130145 0.6979133 0.36300594 0.6462114
|
||||
-3.4521263 9.519001 0.46967015 -0.992983 0.08945896 0.07734239 0.27383736 0.69182056
|
||||
-3.433826 9.038601 0.28866962 -0.9546164 0.028929858 -0.2964296 0.27248618 0.6792056
|
||||
-2.882526 9.084501 -0.10313035 -0.7311533 0.36524838 -0.5762018 0.2478923 0.6867268
|
||||
-3.3896263 8.113201 -0.3605301 -0.9617006 -0.03754102 -0.27151904 0.25436208 0.6271816
|
||||
-3.3058262 8.5403 0.07176972 -0.9879483 0.08645398 -0.1283894 0.26854706 0.6570603
|
||||
-2.7694259 7.7350006 -1.0115304 -0.78725094 -0.2752617 -0.5517852 0.2133645 0.5806204
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.637635 0.17406993
|
||||
-1.868326 0.75070006 -0.9546304 -0.6237263 0.711984 -0.32255915 0.60493344 0.1558058
|
||||
3.880675 1.3958001 1.1265702 0.9198568 0.38913035 -0.049406413 0.19796096 0.06852602
|
||||
-2.327826 8.2278 1.5766702 -0.44723478 0.13983466 0.883418 0.35857934 0.69122976
|
||||
-2.5213258 6.882601 1.3467698 -0.6689012 -0.23592637 0.7049185 0.3951752 0.6194137
|
||||
-1.4618257 2.4264002 -0.6133301 -0.8903412 -0.15419926 -0.42838684 0.48257515 0.25476277
|
||||
-1.2621258 1.7734003 0.17966996 -0.92482555 0.016368585 -0.3800392 0.5577472 0.2591085
|
||||
-1.4422258 3.0290003 0.4318703 -0.8165544 -0.1464694 -0.55837774 0.5101766 0.3366432
|
||||
-1.9845258 3.6388009 0.69077003 -0.87178856 -0.35990623 -0.3323434 0.50301826 0.39985734
|
||||
-1.890426 1.0817002 0.44496998 -0.517776 0.4540006 -0.7251148 0.6224612 0.2508355
|
||||
-2.0575259 0.9955001 0.9599702 -0.8433312 0.09983585 0.52803904 0.65923995 0.27131322
|
||||
-2.964326 9.822501 -0.10223008 -0.47634494 -0.05045076 -0.87780994 0.7339221 0.92058545
|
||||
-2.882526 9.084501 -0.10313035 -0.7311533 0.36524838 -0.5762018 0.667627 0.84930974
|
||||
-3.092126 9.502201 0.2502701 -0.6984636 -0.017294424 -0.71543664 0.75460386 0.8875665
|
||||
-0.087125406 3.1274004 2.8989704 -0.64312565 0.17802551 0.7447794 0.07549074 0.15373975
|
||||
-0.8196259 2.3198001 1.7973703 -0.66986597 -0.026210472 0.7420193 0.036297202 0.14856292
|
||||
-0.8748258 2.0967002 2.7634706 -0.90760005 0.06683492 0.41448176 0.053295545 0.13493255
|
||||
0.02887421 0.7540002 -1.4195303 -0.71550065 -0.2610496 -0.6480061 0.45089763 0.06624607
|
||||
-1.665426 1.8197002 1.62437 -0.48163462 -0.16273934 0.86112946 0.65852106 0.35673973
|
||||
-2.1923258 3.5194008 1.3925699 -0.9447443 -0.18422589 0.271144 0.5478699 0.43424743
|
||||
-1.186226 0.55610013 1.5514703 -0.84864473 -0.16340141 0.5030924 0.734133 0.3012958
|
||||
-0.8196259 2.3198001 1.7973703 -0.66986597 -0.026210472 0.7420193 0.69251174 0.422131
|
||||
-0.029425815 2.1513002 3.4381702 -0.44133595 0.045067813 0.8962095 0.07396352 0.1281145
|
||||
-2.5888262 6.208601 0.9756699 -0.84305483 -0.09319865 0.52969086 0.4061021 0.5678618
|
||||
-3.112326 7.3445005 0.3178696 -0.96471584 -0.253683 0.070486 0.31435022 0.5997315
|
||||
-2.667426 4.758001 0.018969728 -0.90281165 -0.30579108 -0.30236223 0.4114268 0.44731957
|
||||
-2.7694259 7.7350006 -1.0115304 -0.78725094 -0.2752617 -0.5517852 0.75763285 0.6744133
|
||||
-2.392026 8.487902 -1.3364304 -0.747842 0.21194589 -0.6291353 0.734765 0.56230044
|
||||
-0.8792256 4.817401 2.3403704 -0.38904643 0.09032617 0.9167791 0.5902533 0.5873184
|
||||
-2.6100261 4.707801 1.3596704 -0.8832008 -0.12243323 0.45273212 0.48538992 0.4962032
|
||||
-0.8792256 4.817401 2.3403704 -0.38904643 0.09032617 0.9167791 0.07417127 0.20548928
|
||||
-2.392026 8.487902 -1.3364304 -0.747842 0.21194589 -0.6291353 0.16459617 0.6398786
|
||||
-1.8001261 4.085301 1.9035699 -0.4839415 -0.097555116 0.86964566 0.5627961 0.49731115
|
||||
-1.186226 0.55610013 1.5514703 -0.84864473 -0.16340141 0.5030924 0.010203981 0.1122183
|
||||
-1.569626 0.3742001 -1.4788301 -0.05462312 0.1690641 -0.9840902 0.61384606 0.11812159
|
||||
-1.9930261 9.862201 -0.003130341 0.075866185 0.9794647 -0.18679745 0.7293909 0.98951745
|
||||
-3.0411263 10.770401 0.043869786 0.02688641 0.9635681 -0.26610863 0.753717 0.961225
|
||||
-3.433826 9.038601 0.28866962 -0.9546164 0.028929858 -0.2964296 0.8020744 0.78846765
|
||||
4.2867746 0.52519995 0.41017002 0.94705594 -0.2590572 -0.18966934 0.20760685 0.029241929
|
||||
-2.878626 9.963901 0.81987005 -0.21252948 0.5347677 0.81783545 0.27992412 0.7168905
|
||||
-1.9710261 3.9114006 0.01537018 -0.6675564 -0.59708816 -0.444808 0.45012152 0.3856737
|
||||
-1.9930261 9.862201 -0.003130341 0.075866185 0.9794647 -0.18679745 0.2468168 0.7547342
|
||||
-2.2901258 9.714901 -0.21963045 -0.23479536 0.67432845 -0.7001088 0.23586477 0.728986
|
||||
-2.2901258 9.714901 -0.21963045 -0.23479536 0.67432845 -0.7001088 0.52842814 0.74081594
|
||||
-2.964326 9.822501 -0.10223008 -0.47634494 -0.05045076 -0.87780994 0.58254737 0.8386313
|
||||
-3.471126 10.565201 0.1122696 -0.81858766 0.5451293 -0.18096499 0.5380133 0.9808106
|
||||
-2.2901258 9.714901 -0.21963045 -0.23479536 0.67432845 -0.7001088 0.69757915 0.9635888
|
||||
-3.3058262 8.5403 0.07176972 -0.9879483 0.08645398 -0.1283894 0.70988774 0.65773886
|
||||
-2.882526 9.084501 -0.10313035 -0.7311533 0.36524838 -0.5762018 0.6677008 0.75300074
|
||||
-0.7709256 5.724101 2.2065706 0.07019434 0.24138543 0.9678872 0.5507923 0.6433447
|
||||
0.58418125 0.22400019 -1.7113466 -0.40643814 -0.8098558 -0.42301488 0.9718312 0.020504208
|
||||
0.7487328 0.22400019 -1.869269 -0.19065972 -0.720445 -0.66678923 0.97220457 0.021100836
|
||||
1.2752382 0.22400019 -1.8116388 0.075374685 -0.7676886 -0.6363747 0.9716987 0.022655101
|
||||
-1.4210848 0.22400019 -1.3924581 0.41129172 -0.60820895 -0.6789117 0.9721315 0.014245303
|
||||
-1.2286401 0.22400019 -1.2118917 0.3633369 -0.6630077 -0.65452826 0.9714647 0.014712902
|
||||
-1.7548681 0.22400019 -1.3470285 -0.52704555 -0.58184344 -0.6194199 0.97220457 0.013208317
|
||||
-2.2161448 0.22400019 -0.43305972 -0.017521787 -0.99930537 0.032890607 0.96973413 0.01123883
|
||||
-0.5065232 0.22400019 -0.5854172 -0.021521537 -0.94214505 -0.3345139 0.96911705 0.01649964
|
||||
3.6921923 0.22400019 -0.5356896 0.6121442 -0.6924734 -0.38178536 0.96632093 0.029152708
|
||||
-1.9521799 0.22400019 -1.126045 -0.70010203 -0.5537167 -0.45083794 0.9716613 0.012472974
|
||||
-2.2274122 0.22400019 -0.4297089 -0.7312984 -0.6671969 -0.14160144 0.80359983 1.0238159
|
||||
-1.9521799 0.22400019 -1.126045 -0.70010203 -0.5537167 -0.45083794 0.80359983 0.95338476
|
||||
-2.2161448 0.22400019 -0.43305972 -0.017521787 -0.99930537 0.032890607 0.8044696 1.023133
|
||||
2.2313638 0.22400019 2.680494 0.3288468 -0.8804425 0.34158558 0.95752156 0.022717984
|
||||
-0.6810555 0.22400019 2.4642336 -0.1467376 -0.75445783 0.63973546 0.96000504 0.01405433
|
||||
2.4538667 0.22400019 2.5940027 0.24385142 -0.7973807 0.55201495 0.95764303 0.02344461
|
||||
0.41850665 0.22400019 2.7519977 -0.23899291 -0.84482497 0.4786994 0.95844465 0.017195703
|
||||
-2.6425998 0.22400019 0.70022744 -0.80877304 -0.50211614 0.3062115 0.9665674 0.0092362035
|
||||
-2.7626433 0.22400019 0.07626649 -0.847515 -0.42922866 -0.3122198 0.96852803 0.009265589
|
||||
4.1131854 0.22400019 0.46040884 0.5623081 -0.8260273 -0.03858204 0.9630468 0.029798763
|
||||
1.955617 0.22400019 2.7750673 0.04242061 -0.8742375 0.4836417 0.9574091 0.02182542
|
||||
2.1960154 0.22400019 2.7574801 0.407 -0.7800877 0.47519907 0.95731115 0.022562819
|
||||
0.7445824 0.22400019 2.9373279 -0.12836032 -0.80886763 0.57380897 0.9576798 0.018064456
|
||||
2.7569857 0.22400019 -1.5163606 0.16910498 -0.7943238 -0.5834837 0.9698729 0.026945414
|
||||
2.100773 0.22400019 -1.6653436 0.12811182 -0.79456544 -0.59350926 0.9707365 0.02505687
|
||||
3.4797022 0.22400019 -1.0087174 0.40930107 -0.86440027 -0.29203552 0.9678838 0.028808849
|
||||
3.5642383 0.22400019 -0.8515244 0.48217154 -0.858188 -0.17613666 0.96735567 0.028965177
|
||||
-0.37594378 0.22400019 -0.7854573 -0.57233065 -0.7097642 -0.41069746 0.9696391 0.017020183
|
||||
-1.1313287 0.22400019 -1.2045778 0.22967121 -0.49633533 -0.83719915 0.9713813 0.015002267
|
||||
-1.2935071 0.22400019 1.0919343 -0.27430204 -0.8970687 0.34644783 0.96453613 0.013066204
|
||||
-2.5766528 0.22400019 0.8374413 -0.62714297 -0.48046845 0.6130593 0.96611136 0.009349244
|
||||
4.0127363 0.22400019 0.9127198 0.5038301 -0.8556301 0.1185428 0.9617433 0.029211031
|
||||
3.5815594 0.22400019 -0.7074967 0.42636088 -0.8999785 -0.09085657 0.96690965 0.028926747
|
||||
3.4810352 0.22400019 1.8996607 0.39348367 -0.810439 0.4340037 0.9590955 0.02698438
|
||||
-1.11559 0.22400019 1.3025575 -0.38334632 -0.9040218 0.18918258 0.963788 0.013471412
|
||||
3.8143253 0.22400019 1.5762239 0.4810456 -0.8009131 0.35655776 0.95986325 0.028194623
|
||||
-1.0991356 0.22400019 2.0397234 -0.68955994 -0.7188539 0.0880689 0.96155035 0.013057904
|
||||
-2.209373 0.22400019 -0.42154086 -0.0558253 -0.9859457 0.15746342 0.9696951 0.011252033
|
||||
-2.1618967 0.22400019 -0.40970844 -0.0028608302 -0.9999959 -0.000106975036 0.9696294 0.011387991
|
||||
-2.1749234 0.22400019 -0.40605244 -0.011426341 -0.9991058 -0.04070532 0.96961904 0.011344941
|
||||
-2.1937947 0.22400019 -0.40073627 -0.011439374 -0.9991109 -0.04057865 0.9696118 0.01128404
|
||||
-2.2783449 0.22400019 -0.37692034 -0.58131546 -0.51583326 -0.6292762 0.969593 0.011013629
|
||||
-1.0468484 0.22400019 2.382645 -0.58025545 -0.63782334 0.5064435 0.9604814 0.013000401
|
||||
3.4810352 0.22400019 1.8996607 0.39348367 -0.810439 0.4340037 0.15420465 0.04102335
|
||||
3.8143253 0.22400019 1.5762239 0.4810456 -0.8009131 0.35655776 0.16792865 0.037144165
|
||||
2.2313638 0.22400019 2.680494 0.3288468 -0.8804425 0.34158558 0.110636964 0.05624038
|
||||
2.4538667 0.22400019 2.5940027 0.24385142 -0.7973807 0.55201495 0.117879316 0.05280347
|
||||
2.1960154 0.22400019 2.7574801 0.407 -0.7800877 0.47519907 0.1069449 0.059347447
|
||||
1.2752382 0.22400019 -1.8116388 0.075374685 -0.7676886 -0.6363747 0.37604672 0.008110086
|
||||
0.7487328 0.22400019 -1.869269 -0.19065972 -0.720445 -0.66678923 0.4070614 0.013023422
|
||||
3.5642383 0.22400019 -0.8515244 0.48217154 -0.858188 -0.17613666 0.25538462 0.0031148791
|
||||
3.4797022 0.22400019 -1.0087174 0.40930107 -0.86440027 -0.29203552 0.2648711 8.450675e-09
|
||||
4.1131854 0.22400019 0.46040884 0.5623081 -0.8260273 -0.03858204 0.20259783 0.019268692
|
||||
3.6921923 0.22400019 -0.5356896 0.6121442 -0.6924734 -0.38178536 0.23897217 0.0057812533
|
||||
2.7569857 0.22400019 -1.5163606 0.16910498 -0.7943238 -0.5834837 0.3031835 0.0016587148
|
||||
2.100773 0.22400019 -1.6653436 0.12811182 -0.79456544 -0.59350926 0.3331248 0.0026185757
|
||||
1.955617 0.22400019 2.7750673 0.04242061 -0.8742375 0.4836417 0.09809749 0.06282124
|
||||
0.7445824 0.22400019 2.9373279 -0.12836032 -0.80886763 0.57380897 0.068156235 0.07761529
|
||||
-0.37594378 0.22400019 -0.7854573 -0.57233065 -0.7097642 -0.41069746 0.52157223 0.044851843
|
||||
-0.5065232 0.22400019 -0.5854172 -0.021521537 -0.94214505 -0.3345139 0.5435285 0.046751596
|
||||
-2.2783449 0.22400019 -0.37692034 -0.58131546 -0.51583326 -0.6292762 0.63853747 0.17621852
|
||||
-2.7626433 0.22400019 0.07626649 -0.847515 -0.42922866 -0.3122198 0.66334546 0.19258852
|
||||
-1.7548681 0.22400019 -1.3470285 -0.52704555 -0.58184344 -0.6194199 0.62489164 0.1247898
|
||||
-1.9521799 0.22400019 -1.126045 -0.70010203 -0.5537167 -0.45083794 0.6287393 0.14086775
|
||||
-2.6425998 0.22400019 0.70022744 -0.80877304 -0.50211614 0.3062115 0.68118423 0.21481499
|
||||
-1.11559 0.22400019 1.3025575 -0.38334632 -0.9040218 0.18918258 -3.3102134e-09 0.10996528
|
||||
-1.0991356 0.22400019 2.0397234 -0.68955994 -0.7188539 0.0880689 0.013690739 0.09781893
|
||||
0.58418125 0.22400019 -1.7113466 -0.40643814 -0.8098558 -0.42301488 0.42186216 0.014245739
|
||||
-1.1313287 0.22400019 -1.2045778 0.22967121 -0.49633533 -0.83719915 0.6017828 0.094806425
|
||||
-0.6810555 0.22400019 2.4642336 -0.1467376 -0.75445783 0.63973546 0.030619193 0.091465615
|
||||
0.41850665 0.22400019 2.7519977 -0.23899291 -0.84482497 0.4786994 0.057839744 0.08235605
|
||||
-1.2286401 0.22400019 -1.2118917 0.3633369 -0.6630077 -0.65452826 0.59865737 0.10087764
|
||||
-2.5766528 0.22400019 0.8374413 -0.62714297 -0.48046845 0.6130593 0.67908764 0.21657859
|
||||
-1.2935071 0.22400019 1.0919343 -0.27430204 -0.8970687 0.34644783 0.7325371 0.2680749
|
||||
-1.4210848 0.22400019 -1.3924581 0.41129172 -0.60820895 -0.6789117 0.614245 0.10814548
|
||||
-1.9521799 0.22400019 -1.126045 -0.70010203 -0.5537167 -0.45083794 0.43263742 0.92657316
|
||||
-2.2274122 0.22400019 -0.4297089 -0.7312984 -0.6671969 -0.14160144 0.43597075 0.8869815
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.43614823 0.88644433
|
||||
4.0127363 0.22400019 0.9127198 0.5038301 -0.8556301 0.1185428 0.18772343 0.02667462
|
||||
3.5815594 0.22400019 -0.7074967 0.42636088 -0.8999785 -0.09085657 0.24657853 0.0037103465
|
||||
-1.0468484 0.22400019 2.382645 -0.58025545 -0.63782334 0.5064435 0.021488441 0.09233946
|
||||
-1.11559 0.22400019 1.3025575 -0.38334632 -0.9040218 0.18918258 0.7439689 0.2791134
|
||||
-2.2274122 0.22400019 -0.4297089 -0.7312984 -0.6671969 -0.14160144 0.67494655 0.99038863
|
||||
-2.2161448 0.22400019 -0.43305972 -0.017521787 -0.99930537 0.032890607 0.67444944 0.9913764
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.67444944 0.98951757
|
||||
-2.1618967 0.22400019 -0.40970844 -0.0028608302 -0.9999959 -0.000106975036 0.80714715 0.95338464
|
||||
-2.1749234 0.22400019 -0.40605244 -0.011426341 -0.9991058 -0.04070532 0.8076674 0.95454615
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.80714715 0.9599234
|
||||
-2.2161448 0.22400019 -0.43305972 -0.017521787 -0.99930537 0.032890607 0.67331666 0.9900621
|
||||
-2.209373 0.22400019 -0.42154086 -0.0558253 -0.9859457 0.15746342 0.6744493 0.98951745
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.67444944 0.99153584
|
||||
-2.209373 0.22400019 -0.42154086 -0.0558253 -0.9859457 0.15746342 0.80814487 0.9553456
|
||||
-2.1618967 0.22400019 -0.40970844 -0.0028608302 -0.9999959 -0.000106975036 0.8076674 0.95992327
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.8076674 0.9533845
|
||||
-2.1937947 0.22400019 -0.40073627 -0.011439374 -0.9991109 -0.04057865 0.8044694 0.9616473
|
||||
-2.2783449 0.22400019 -0.37692034 -0.58131546 -0.51583326 -0.6292762 0.8044694 0.95338464
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.807147 0.9587995
|
||||
-2.1749234 0.22400019 -0.40605244 -0.011426341 -0.9991058 -0.04070532 0.67240256 0.98951757
|
||||
-2.1937947 0.22400019 -0.40073627 -0.011439374 -0.9991109 -0.04057865 0.6733167 0.9911193
|
||||
-2.230626 0.22640002 -0.41983035 -0.74839973 -0.49738073 -0.4387599 0.67240256 0.9949199
|
||||
3 0 1 2
|
||||
3 0 3 4
|
||||
3 2 3 0
|
||||
3 5 3 2
|
||||
3 6 7 8
|
||||
3 8 7 9
|
||||
3 10 11 12
|
||||
3 13 14 15
|
||||
3 16 17 18
|
||||
3 19 20 21
|
||||
3 22 1 23
|
||||
3 24 25 26
|
||||
3 27 28 29
|
||||
3 30 31 27
|
||||
3 32 18 17
|
||||
3 33 34 35
|
||||
3 36 37 38
|
||||
3 39 40 13
|
||||
3 41 42 43
|
||||
3 44 45 46
|
||||
3 47 15 14
|
||||
3 48 18 32
|
||||
3 49 26 50
|
||||
3 33 35 51
|
||||
3 52 53 54
|
||||
3 54 47 14
|
||||
3 55 48 56
|
||||
3 11 10 57
|
||||
3 13 58 59
|
||||
3 40 14 13
|
||||
3 53 47 54
|
||||
3 60 61 62
|
||||
3 44 63 64
|
||||
3 6 60 65
|
||||
3 65 7 6
|
||||
3 66 67 54
|
||||
3 60 68 61
|
||||
3 38 37 69
|
||||
3 26 49 70
|
||||
3 67 10 12
|
||||
3 55 71 48
|
||||
3 72 22 23
|
||||
3 9 68 8
|
||||
3 68 60 6
|
||||
3 73 17 74
|
||||
3 75 10 67
|
||||
3 76 26 77
|
||||
3 1 26 76
|
||||
3 78 47 79
|
||||
3 0 80 81
|
||||
3 82 50 83
|
||||
3 84 85 86
|
||||
3 39 13 59
|
||||
3 87 27 29
|
||||
3 87 20 88
|
||||
3 29 21 87
|
||||
3 20 89 88
|
||||
3 90 17 16
|
||||
3 29 72 91
|
||||
3 40 84 86
|
||||
3 58 92 59
|
||||
3 21 11 19
|
||||
3 73 87 88
|
||||
3 27 31 2
|
||||
3 31 5 2
|
||||
3 52 49 53
|
||||
3 61 68 9
|
||||
3 93 48 94
|
||||
3 88 93 94
|
||||
3 51 35 95
|
||||
3 37 96 69
|
||||
3 33 51 41
|
||||
3 77 52 54
|
||||
3 67 12 77
|
||||
3 26 1 0
|
||||
3 76 77 12
|
||||
3 97 49 82
|
||||
3 46 98 99
|
||||
3 79 53 97
|
||||
3 23 76 72
|
||||
3 25 50 26
|
||||
3 0 24 26
|
||||
3 100 37 36
|
||||
3 52 70 49
|
||||
3 36 101 102
|
||||
3 64 45 44
|
||||
3 86 66 40
|
||||
3 11 21 91
|
||||
3 12 72 76
|
||||
3 82 49 50
|
||||
3 72 11 91
|
||||
3 75 103 89
|
||||
3 19 89 20
|
||||
3 32 88 94
|
||||
3 87 21 20
|
||||
3 79 47 53
|
||||
3 2 1 22
|
||||
3 22 72 29
|
||||
3 22 29 28
|
||||
3 27 2 28
|
||||
3 51 95 42
|
||||
3 50 25 83
|
||||
3 26 70 77
|
||||
3 0 81 24
|
||||
3 91 21 29
|
||||
3 23 1 76
|
||||
3 53 49 97
|
||||
3 77 54 67
|
||||
3 104 105 106
|
||||
3 52 77 70
|
||||
3 101 36 38
|
||||
3 4 80 0
|
||||
3 66 54 14
|
||||
3 62 107 60
|
||||
3 44 46 108
|
||||
3 41 51 42
|
||||
3 86 109 66
|
||||
3 57 10 75
|
||||
3 71 16 18
|
||||
3 55 16 71
|
||||
3 35 110 95
|
||||
3 32 17 73
|
||||
3 111 3 5
|
||||
3 40 39 84
|
||||
3 112 75 67
|
||||
3 72 12 11
|
||||
3 75 89 19
|
||||
3 75 19 57
|
||||
3 88 89 93
|
||||
3 74 27 73
|
||||
3 94 48 32
|
||||
3 19 11 57
|
||||
3 71 18 48
|
||||
3 40 66 14
|
||||
3 73 88 32
|
||||
3 113 62 61
|
||||
3 22 28 2
|
||||
3 35 114 110
|
||||
3 73 27 87
|
||||
3 115 93 89
|
||||
3 115 89 103
|
||||
3 116 117 118
|
||||
3 119 120 121
|
||||
3 122 30 74
|
||||
3 123 124 122
|
||||
3 125 126 127
|
||||
3 128 129 130
|
||||
3 131 132 133
|
||||
3 4 132 134
|
||||
3 135 121 136
|
||||
3 137 112 86
|
||||
3 138 128 139
|
||||
3 140 141 142
|
||||
3 143 144 145
|
||||
3 146 147 148
|
||||
3 122 124 30
|
||||
3 123 136 121
|
||||
3 56 48 93
|
||||
3 58 13 15
|
||||
3 121 141 140
|
||||
3 123 121 124
|
||||
3 30 27 74
|
||||
3 149 150 151
|
||||
3 152 122 74
|
||||
3 145 153 154
|
||||
3 120 141 121
|
||||
3 100 36 102
|
||||
3 155 156 153
|
||||
3 157 151 118
|
||||
3 152 74 17
|
||||
3 121 135 119
|
||||
3 144 119 145
|
||||
3 119 144 120
|
||||
3 158 159 160
|
||||
3 4 159 132
|
||||
3 100 161 162
|
||||
3 163 98 164
|
||||
3 138 98 45
|
||||
3 15 165 149
|
||||
3 166 34 33
|
||||
3 154 153 167
|
||||
3 153 145 155
|
||||
3 93 115 56
|
||||
3 154 167 164
|
||||
3 116 168 117
|
||||
3 150 168 116
|
||||
3 92 157 118
|
||||
3 136 123 169
|
||||
3 109 112 67
|
||||
3 3 111 160
|
||||
3 170 171 127
|
||||
3 132 131 34
|
||||
3 165 150 149
|
||||
3 148 147 172
|
||||
3 115 85 173
|
||||
3 158 139 159
|
||||
3 159 4 160
|
||||
3 149 151 157
|
||||
3 126 125 148
|
||||
3 45 174 129
|
||||
3 128 133 159
|
||||
3 156 163 167
|
||||
3 92 58 157
|
||||
3 175 5 142
|
||||
3 140 31 124
|
||||
3 144 141 120
|
||||
3 86 85 137
|
||||
3 8 68 6
|
||||
3 45 98 46
|
||||
3 34 176 35
|
||||
3 64 176 174
|
||||
3 176 34 177
|
||||
3 64 174 45
|
||||
3 64 63 176
|
||||
3 132 34 166
|
||||
3 162 96 100
|
||||
3 58 149 157
|
||||
3 125 127 171
|
||||
3 178 179 180
|
||||
3 181 125 171
|
||||
3 147 182 172
|
||||
3 126 148 172
|
||||
3 129 128 138
|
||||
3 130 133 128
|
||||
3 179 178 183
|
||||
3 177 34 131
|
||||
3 132 166 134
|
||||
3 159 139 128
|
||||
3 159 133 132
|
||||
3 160 111 175
|
||||
3 154 143 145
|
||||
3 137 85 115
|
||||
3 138 45 129
|
||||
3 35 176 114
|
||||
3 100 102 161
|
||||
3 100 96 37
|
||||
3 139 98 138
|
||||
3 164 98 158
|
||||
3 99 98 184
|
||||
3 98 163 184
|
||||
3 165 47 78
|
||||
3 160 4 3
|
||||
3 17 90 152
|
||||
3 167 153 156
|
||||
3 75 112 103
|
||||
3 142 144 143
|
||||
3 113 107 62
|
||||
3 151 150 116
|
||||
3 124 31 30
|
||||
3 142 5 140
|
||||
3 5 31 140
|
||||
3 125 146 148
|
||||
3 176 63 114
|
||||
3 139 158 98
|
||||
3 5 175 111
|
||||
3 164 158 160
|
||||
3 143 164 160
|
||||
3 15 149 58
|
||||
3 118 151 116
|
||||
3 112 137 103
|
||||
3 163 164 167
|
||||
3 175 142 143
|
||||
3 164 143 154
|
||||
3 175 143 160
|
||||
3 142 141 144
|
||||
3 121 140 124
|
||||
3 103 137 115
|
||||
3 80 4 134
|
||||
3 67 66 109
|
||||
3 109 86 112
|
||||
3 47 165 15
|
||||
3 181 171 170
|
||||
3 185 186 187
|
||||
3 188 189 190
|
||||
3 191 192 193
|
||||
3 191 194 192
|
||||
3 195 196 197
|
||||
3 198 199 200
|
||||
3 201 199 198
|
||||
3 202 203 204
|
||||
3 205 201 206
|
||||
3 207 201 205
|
||||
3 208 185 209
|
||||
3 210 185 208
|
||||
3 211 185 210
|
||||
3 212 185 211
|
||||
3 194 189 213
|
||||
3 194 190 189
|
||||
3 214 215 216
|
||||
3 192 212 217
|
||||
3 218 219 220
|
||||
3 221 219 218
|
||||
3 213 192 194
|
||||
3 198 206 201
|
||||
3 187 209 185
|
||||
3 217 193 192
|
||||
3 193 222 191
|
||||
3 193 223 222
|
||||
3 193 224 223
|
||||
3 193 225 224
|
||||
3 193 226 225
|
||||
3 193 203 226
|
||||
3 193 204 203
|
||||
3 218 227 221
|
||||
3 218 199 227
|
||||
3 218 200 199
|
||||
3 204 215 202
|
||||
3 204 216 215
|
||||
3 216 219 214
|
||||
3 216 220 219
|
||||
3 211 217 212
|
||||
3 228 229 85
|
||||
3 228 85 84
|
||||
3 230 231 84
|
||||
3 230 84 39
|
||||
3 232 230 39
|
||||
3 232 39 59
|
||||
3 233 234 90
|
||||
3 233 90 16
|
||||
3 235 236 55
|
||||
3 235 55 56
|
||||
3 237 238 173
|
||||
3 239 240 16
|
||||
3 239 16 55
|
||||
3 241 232 59
|
||||
3 241 59 92
|
||||
3 242 241 92
|
||||
3 231 228 84
|
||||
3 240 233 16
|
||||
3 243 244 122
|
||||
3 243 122 152
|
||||
3 245 246 119
|
||||
3 245 119 135
|
||||
3 247 248 136
|
||||
3 247 136 169
|
||||
3 246 249 119
|
||||
3 250 251 168
|
||||
3 234 252 152
|
||||
3 234 152 90
|
||||
3 244 253 122
|
||||
3 254 255 118
|
||||
3 253 256 123
|
||||
3 253 123 122
|
||||
3 257 258 145
|
||||
3 256 259 169
|
||||
3 256 169 123
|
||||
3 260 261 262
|
||||
3 248 135 136
|
||||
3 263 237 173
|
||||
3 263 173 85
|
||||
3 238 264 115
|
||||
3 238 115 173
|
||||
3 265 254 118
|
||||
3 265 118 117
|
||||
3 264 235 56
|
||||
3 264 56 115
|
||||
3 255 242 92
|
||||
3 255 92 118
|
||||
3 258 266 155
|
||||
3 258 155 145
|
||||
3 252 243 152
|
||||
3 259 247 169
|
||||
3 249 257 145
|
||||
3 249 145 119
|
||||
3 251 265 117
|
||||
3 251 117 168
|
||||
3 267 268 269
|
||||
3 270 271 272
|
||||
3 273 274 275
|
||||
3 276 277 278
|
||||
3 236 239 55
|
||||
3 229 263 85
|
||||
3 279 280 281
|
||||
3 282 283 284
|
12
src/meshes/fox/fox.ts
Normal file
97
src/meshes/gizmo.ply
Normal file
|
@ -0,0 +1,97 @@
|
|||
ply
|
||||
format ascii 1.0
|
||||
comment Created in Blender version 3.6.4
|
||||
element vertex 42
|
||||
property float x
|
||||
property float y
|
||||
property float z
|
||||
property float nx
|
||||
property float ny
|
||||
property float nz
|
||||
property uchar red
|
||||
property uchar green
|
||||
property uchar blue
|
||||
property uchar alpha
|
||||
property float s
|
||||
property float t
|
||||
element face 36
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
0 0.05 -0.05 -0.057735033 0.5773503 -0.5773503 0 254 0 255 0.625 0
|
||||
1 -0.05 -0.05 0.057735033 -0.5773503 -0.5773503 0 254 0 255 0.375 0.25
|
||||
0 -0.05 -0.05 -0.057735033 -0.5773503 -0.5773503 0 254 0 255 0.375 0
|
||||
1 0.05 -0.05 0.057735033 0.5773503 -0.5773503 0 254 0 255 0.625 0.25
|
||||
1 -0.05 0.05 0.057735033 -0.5773503 0.5773503 0 254 0 255 0.375 0.5
|
||||
1 0.05 0.05 0.057735033 0.5773503 0.5773503 0 254 0 255 0.625 0.5
|
||||
0 -0.05 0.05 -0.057735033 -0.5773503 0.5773503 0 254 0 255 0.375 0.75
|
||||
0 0.05 0.05 -0.057735033 0.5773503 0.5773503 0 254 0 255 0.625 0.75
|
||||
0 -0.05 -0.05 -0.057735033 -0.5773503 -0.5773503 0 254 0 255 0.375 1
|
||||
0 -0.05 -0.05 -0.057735033 -0.5773503 -0.5773503 0 254 0 255 0.125 0.75
|
||||
1 -0.05 -0.05 0.057735033 -0.5773503 -0.5773503 0 254 0 255 0.125 0.5
|
||||
1 0.05 -0.05 0.057735033 0.5773503 -0.5773503 0 254 0 255 0.875 0.5
|
||||
0 0.05 -0.05 -0.057735033 0.5773503 -0.5773503 0 254 0 255 0.625 1
|
||||
0 0.05 -0.05 -0.057735033 0.5773503 -0.5773503 0 254 0 255 0.875 0.75
|
||||
-0.05 0.05 0 -0.5773503 0.5773503 -0.057735033 254 0 0 255 0.625 0
|
||||
0.05 -0.05 0 0.5773503 -0.5773503 -0.057735033 254 0 0 255 0.375 0.25
|
||||
-0.05 -0.05 0 -0.5773503 -0.5773503 -0.057735033 254 0 0 255 0.375 0
|
||||
0.05 0.05 0 0.5773503 0.5773503 -0.057735033 254 0 0 255 0.625 0.25
|
||||
0.05 -0.05 1 0.5773503 -0.5773503 0.057735033 254 0 0 255 0.375 0.5
|
||||
0.05 0.05 1 0.5773503 0.5773503 0.057735033 254 0 0 255 0.625 0.5
|
||||
-0.05 -0.05 1 -0.5773503 -0.5773503 0.057735033 254 0 0 255 0.375 0.75
|
||||
-0.05 0.05 1 -0.5773503 0.5773503 0.057735033 254 0 0 255 0.625 0.75
|
||||
-0.05 -0.05 0 -0.5773503 -0.5773503 -0.057735033 254 0 0 255 0.375 1
|
||||
-0.05 -0.05 0 -0.5773503 -0.5773503 -0.057735033 254 0 0 255 0.125 0.75
|
||||
0.05 -0.05 0 0.5773503 -0.5773503 -0.057735033 254 0 0 255 0.125 0.5
|
||||
0.05 0.05 0 0.5773503 0.5773503 -0.057735033 254 0 0 255 0.875 0.5
|
||||
-0.05 0.05 0 -0.5773503 0.5773503 -0.057735033 254 0 0 255 0.625 1
|
||||
-0.05 0.05 0 -0.5773503 0.5773503 -0.057735033 254 0 0 255 0.875 0.75
|
||||
-0.05 1 -0.05 -0.5773503 0.057735033 -0.5773503 0 0 254 255 0.625 0
|
||||
0.05 0 -0.05 0.5773503 -0.057735033 -0.5773503 0 0 254 255 0.375 0.25
|
||||
-0.05 0 -0.05 -0.5773503 -0.057735033 -0.5773503 0 0 254 255 0.375 0
|
||||
0.05 1 -0.05 0.5773503 0.057735033 -0.5773503 0 0 254 255 0.625 0.25
|
||||
0.05 0 0.05 0.5773503 -0.057735033 0.5773503 0 0 254 255 0.375 0.5
|
||||
0.05 1 0.05 0.5773503 0.057735033 0.5773503 0 0 254 255 0.625 0.5
|
||||
-0.05 0 0.05 -0.5773503 -0.057735033 0.5773503 0 0 254 255 0.375 0.75
|
||||
-0.05 1 0.05 -0.5773503 0.057735033 0.5773503 0 0 254 255 0.625 0.75
|
||||
-0.05 0 -0.05 -0.5773503 -0.057735033 -0.5773503 0 0 254 255 0.375 1
|
||||
-0.05 0 -0.05 -0.5773503 -0.057735033 -0.5773503 0 0 254 255 0.125 0.75
|
||||
0.05 0 -0.05 0.5773503 -0.057735033 -0.5773503 0 0 254 255 0.125 0.5
|
||||
0.05 1 -0.05 0.5773503 0.057735033 -0.5773503 0 0 254 255 0.875 0.5
|
||||
-0.05 1 -0.05 -0.5773503 0.057735033 -0.5773503 0 0 254 255 0.625 1
|
||||
-0.05 1 -0.05 -0.5773503 0.057735033 -0.5773503 0 0 254 255 0.875 0.75
|
||||
3 0 1 2
|
||||
3 3 4 1
|
||||
3 5 6 4
|
||||
3 7 8 6
|
||||
3 4 9 10
|
||||
3 11 7 5
|
||||
3 0 3 1
|
||||
3 3 5 4
|
||||
3 5 7 6
|
||||
3 7 12 8
|
||||
3 4 6 9
|
||||
3 11 13 7
|
||||
3 14 15 16
|
||||
3 17 18 15
|
||||
3 19 20 18
|
||||
3 21 22 20
|
||||
3 18 23 24
|
||||
3 25 21 19
|
||||
3 14 17 15
|
||||
3 17 19 18
|
||||
3 19 21 20
|
||||
3 21 26 22
|
||||
3 18 20 23
|
||||
3 25 27 21
|
||||
3 28 29 30
|
||||
3 31 32 29
|
||||
3 33 34 32
|
||||
3 35 36 34
|
||||
3 32 37 38
|
||||
3 39 35 33
|
||||
3 28 31 29
|
||||
3 31 33 32
|
||||
3 33 35 34
|
||||
3 35 40 36
|
||||
3 32 34 37
|
||||
3 39 41 35
|
12
src/meshes/gizmo.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Mesh } from "../renderer/mesh";
|
||||
|
||||
// prettier-ignore
|
||||
export default new Mesh({
|
||||
colors: new Uint8Array([0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,0,254,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,254,0,0,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255,0,0,254,255]),
|
||||
faces: new Uint8Array([0,1,2,3,4,1,5,6,4,7,8,6,4,9,10,11,7,5,0,3,1,3,5,4,5,7,6,7,12,8,4,6,9,11,13,7,14,15,16,17,18,15,19,20,18,21,22,20,18,23,24,25,21,19,14,17,15,17,19,18,19,21,20,21,26,22,18,20,23,25,27,21,28,29,30,31,32,29,33,34,32,35,36,34,32,37,38,39,35,33,28,31,29,31,33,32,33,35,34,35,40,36,32,34,37,39,41,35]),
|
||||
name: "src/meshes/gizmo.ply",
|
||||
normals: new Float32Array([-0.057735033,0.5773503,-0.5773503,0.057735033,-0.5773503,-0.5773503,-0.057735033,-0.5773503,-0.5773503,0.057735033,0.5773503,-0.5773503,0.057735033,-0.5773503,0.5773503,0.057735033,0.5773503,0.5773503,-0.057735033,-0.5773503,0.5773503,-0.057735033,0.5773503,0.5773503,-0.057735033,-0.5773503,-0.5773503,-0.057735033,-0.5773503,-0.5773503,0.057735033,-0.5773503,-0.5773503,0.057735033,0.5773503,-0.5773503,-0.057735033,0.5773503,-0.5773503,-0.057735033,0.5773503,-0.5773503,-0.5773503,0.5773503,-0.057735033,0.5773503,-0.5773503,-0.057735033,-0.5773503,-0.5773503,-0.057735033,0.5773503,0.5773503,-0.057735033,0.5773503,-0.5773503,0.057735033,0.5773503,0.5773503,0.057735033,-0.5773503,-0.5773503,0.057735033,-0.5773503,0.5773503,0.057735033,-0.5773503,-0.5773503,-0.057735033,-0.5773503,-0.5773503,-0.057735033,0.5773503,-0.5773503,-0.057735033,0.5773503,0.5773503,-0.057735033,-0.5773503,0.5773503,-0.057735033,-0.5773503,0.5773503,-0.057735033,-0.5773503,0.057735033,-0.5773503,0.5773503,-0.057735033,-0.5773503,-0.5773503,-0.057735033,-0.5773503,0.5773503,0.057735033,-0.5773503,0.5773503,-0.057735033,0.5773503,0.5773503,0.057735033,0.5773503,-0.5773503,-0.057735033,0.5773503,-0.5773503,0.057735033,0.5773503,-0.5773503,-0.057735033,-0.5773503,-0.5773503,-0.057735033,-0.5773503,0.5773503,-0.057735033,-0.5773503,0.5773503,0.057735033,-0.5773503,-0.5773503,0.057735033,-0.5773503,-0.5773503,0.057735033,-0.5773503]),
|
||||
positions: new Float32Array([0,0.05,-0.05,1,-0.05,-0.05,0,-0.05,-0.05,1,0.05,-0.05,1,-0.05,0.05,1,0.05,0.05,0,-0.05,0.05,0,0.05,0.05,0,-0.05,-0.05,0,-0.05,-0.05,1,-0.05,-0.05,1,0.05,-0.05,0,0.05,-0.05,0,0.05,-0.05,-0.05,0.05,0,0.05,-0.05,0,-0.05,-0.05,0,0.05,0.05,0,0.05,-0.05,1,0.05,0.05,1,-0.05,-0.05,1,-0.05,0.05,1,-0.05,-0.05,0,-0.05,-0.05,0,0.05,-0.05,0,0.05,0.05,0,-0.05,0.05,0,-0.05,0.05,0,-0.05,1,-0.05,0.05,0,-0.05,-0.05,0,-0.05,0.05,1,-0.05,0.05,0,0.05,0.05,1,0.05,-0.05,0,0.05,-0.05,1,0.05,-0.05,0,-0.05,-0.05,0,-0.05,0.05,0,-0.05,0.05,1,-0.05,-0.05,1,-0.05,-0.05,1,-0.05]),
|
||||
uvs: new Float32Array([0.625,0,0.375,0.25,0.375,0,0.625,0.25,0.375,0.5,0.625,0.5,0.375,0.75,0.625,0.75,0.375,1,0.125,0.75,0.125,0.5,0.875,0.5,0.625,1,0.875,0.75,0.625,0,0.375,0.25,0.375,0,0.625,0.25,0.375,0.5,0.625,0.5,0.375,0.75,0.625,0.75,0.375,1,0.125,0.75,0.125,0.5,0.875,0.5,0.625,1,0.875,0.75,0.625,0,0.375,0.25,0.375,0,0.625,0.25,0.375,0.5,0.625,0.5,0.375,0.75,0.625,0.75,0.375,1,0.125,0.75,0.125,0.5,0.875,0.5,0.625,1,0.875,0.75]),
|
||||
vertexCount: 42
|
||||
});
|
0
src/meshes/note-UP_is_y--FWD_is_x.txt
Normal file
|
@ -1,28 +1,12 @@
|
|||
|
||||
import { Mesh } from "../renderer/mesh";
|
||||
|
||||
// prettier-ignore
|
||||
const positions = new Float32Array([1,-1,0,-1,1,0,-1,-1,0,1,1,0]);
|
||||
|
||||
// prettier-ignore
|
||||
const colors = null;
|
||||
|
||||
// prettier-ignore
|
||||
const uvs = new Float32Array([1,0,0,1,0,0,1,1]);
|
||||
|
||||
|
||||
// prettier-ignore
|
||||
const normals = null;
|
||||
|
||||
// prettier-ignore
|
||||
const faces = new Uint32Array([0,1,2,0,3,1]);
|
||||
|
||||
export default new Mesh({
|
||||
colors,
|
||||
faces,
|
||||
colors: null,
|
||||
faces: new Uint8Array([0,1,2,0,3,1]),
|
||||
name: "src/meshes/plane.ply",
|
||||
normals,
|
||||
positions,
|
||||
uvs,
|
||||
normals: null,
|
||||
positions: new Float32Array([1,-1,0,-1,1,0,-1,-1,0,1,1,0]),
|
||||
uvs: new Float32Array([1,0,0,1,0,0,1,1]),
|
||||
vertexCount: 4
|
||||
});
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
ply
|
||||
format ascii 1.0
|
||||
comment Created in Blender version 3.6.4
|
||||
element vertex 31
|
||||
property float x
|
||||
property float y
|
||||
property float z
|
||||
property float nx
|
||||
property float ny
|
||||
property float nz
|
||||
property uchar red
|
||||
property uchar green
|
||||
property uchar blue
|
||||
property uchar alpha
|
||||
property float s
|
||||
property float t
|
||||
element face 26
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013659838 0.8180941
|
||||
-0.368004 2.9959495 0.50652 -0.5257306 -0.44721383 0.723607 0 1 255 255 0.15755458 0.7272099
|
||||
-0.595448 2.9959495 -0.19346951 -0.8506533 -0.44721213 -0.2763879 0 1 255 255 0.1575546 0.9089782
|
||||
0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013659043 0.6363257
|
||||
0.368004 2.9959495 0.50652 0.5257306 -0.4472139 0.723607 0 1 255 255 0.15755458 0.54544157
|
||||
0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.0001365666 0.09102075
|
||||
-0.595448 2.9959495 -0.19346951 -0.8506533 -0.44721213 -0.2763879 0 1 255 255 0.15755455 0.00013656964
|
||||
0 2.9959495 -0.6260975 0 -0.44721153 -0.89442825 0 1 255 255 0.15755457 0.18190491
|
||||
0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013657454 0.2727891
|
||||
0.595448 2.9959495 -0.19346951 0.8506533 -0.4472122 -0.27638793 0 1 255 255 0.15755457 0.36367324
|
||||
0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013658249 0.45455742
|
||||
0 3.6220505 0.6260975 0 0.44721153 0.89442825 0 1 255 255 0.31497157 0.6363257
|
||||
-0.595448 3.6220505 0.19346951 -0.8506533 0.44721216 0.27638793 0 1 255 255 0.31497157 0.8180941
|
||||
-0.368004 3.6220505 -0.50652 -0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497154 0.09102073
|
||||
0.368004 3.6220505 -0.50652 0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497154 0.27278906
|
||||
0.595448 3.6220505 0.19346951 0.85065323 0.4472122 0.2763879 0 1 255 255 0.31497154 0.45455742
|
||||
-0.368004 3.6220505 -0.50652 -0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497157 0.9998634
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.72720987
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238958 0.9089782
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.1819049
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.36367324
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.54544157
|
||||
1 0 0 0.8999471 -0.43599886 2.4163015e-07 0 1 255 255 0.8119813 0.33945516
|
||||
0 2.5 0 -5.150958e-08 1 0 0 1 255 255 0.642322 0.16979587
|
||||
-4.3711392e-08 0 1 -3.0203772e-08 -0.4359989 0.8999472 0 1 255 255 0.8119813 0.00013659486
|
||||
-1 0 -8.7422784e-08 -0.8999471 -0.4359989 -2.4291313e-07 0 1 255 255 0.47266275 0.00013660162
|
||||
-4.3711392e-08 0 1 -3.0203772e-08 -0.4359989 0.8999472 0 1 255 255 0.81198126 0.6790469
|
||||
1.19248815e-08 0 -1 0 -0.43599886 -0.8999471 0 1 255 255 0.47266275 0.33972836
|
||||
1 0 0 0.8999471 -0.43599886 2.4163015e-07 0 1 255 255 0.47266272 0.6790469
|
||||
1.19248815e-08 0 -1 0 -0.43599886 -0.8999471 0 1 255 255 0.47266275 0.33945513
|
||||
-1 0 -8.7422784e-08 -0.8999471 -0.4359989 -2.4291313e-07 0 1 255 255 0.81198126 0.3397284
|
||||
3 0 1 2
|
||||
3 1 3 4
|
||||
3 5 6 7
|
||||
3 8 7 9
|
||||
3 10 9 4
|
||||
3 1 4 11
|
||||
3 2 1 12
|
||||
3 7 6 13
|
||||
3 9 7 14
|
||||
3 4 9 15
|
||||
3 1 11 12
|
||||
3 2 12 16
|
||||
3 7 13 14
|
||||
3 9 14 15
|
||||
3 4 15 11
|
||||
3 12 11 17
|
||||
3 16 12 18
|
||||
3 14 13 19
|
||||
3 15 14 20
|
||||
3 11 15 21
|
||||
3 22 23 24
|
||||
3 24 23 25
|
||||
3 26 27 28
|
||||
3 25 23 29
|
||||
3 29 23 22
|
||||
3 26 30 27
|
|
@ -1,28 +0,0 @@
|
|||
|
||||
import { Mesh } from "../renderer/mesh";
|
||||
|
||||
// prettier-ignore
|
||||
const positions = new Float32Array([0,2.609,0,-0.368004,2.9959495,0.50652,-0.595448,2.9959495,-0.19346951,0,2.609,0,0.368004,2.9959495,0.50652,0,2.609,0,-0.595448,2.9959495,-0.19346951,0,2.9959495,-0.6260975,0,2.609,0,0.595448,2.9959495,-0.19346951,0,2.609,0,0,3.6220505,0.6260975,-0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0.368004,3.6220505,-0.50652,0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,1,0,0,0,2.5,0,-4.3711392e-8,0,1,-1,0,-8.7422784e-8,-4.3711392e-8,0,1,1.19248815e-8,0,-1,1,0,0,1.19248815e-8,0,-1,-1,0,-8.7422784e-8]);
|
||||
|
||||
// prettier-ignore
|
||||
const colors = new Uint8Array([0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255]);
|
||||
|
||||
// prettier-ignore
|
||||
const uvs = new Float32Array([0.00013659838,0.8180941,0.15755458,0.7272099,0.1575546,0.9089782,0.00013659043,0.6363257,0.15755458,0.54544157,0.0001365666,0.09102075,0.15755455,0.00013656964,0.15755457,0.18190491,0.00013657454,0.2727891,0.15755457,0.36367324,0.00013658249,0.45455742,0.31497157,0.6363257,0.31497157,0.8180941,0.31497154,0.09102073,0.31497154,0.27278906,0.31497154,0.45455742,0.31497157,0.9998634,0.47238955,0.72720987,0.47238958,0.9089782,0.47238955,0.1819049,0.47238955,0.36367324,0.47238955,0.54544157,0.8119813,0.33945516,0.642322,0.16979587,0.8119813,0.00013659486,0.47266275,0.00013660162,0.81198126,0.6790469,0.47266275,0.33972836,0.47266272,0.6790469,0.47266275,0.33945513,0.81198126,0.3397284]);
|
||||
|
||||
|
||||
// prettier-ignore
|
||||
const normals = new Float32Array([0,-1,8.3803394e-7,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0,-1,8.3803394e-7,0.5257306,-0.4472139,0.723607,0,-1,8.3803394e-7,-0.8506533,-0.44721213,-0.2763879,0,-0.44721153,-0.89442825,0,-1,8.3803394e-7,0.8506533,-0.4472122,-0.27638793,0,-1,8.3803394e-7,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.5257306,0.4472139,-0.72360694,0.85065323,0.4472122,0.2763879,-0.5257306,0.4472139,-0.72360694,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0.8999471,-0.43599886,2.4163015e-7,-5.150958e-8,1,0,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,-3.0203772e-8,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,2.4163015e-7,0,-0.43599886,-0.8999471,-0.8999471,-0.4359989,-2.4291313e-7]);
|
||||
|
||||
// prettier-ignore
|
||||
const faces = new Uint32Array([0,1,2,1,3,4,5,6,7,8,7,9,10,9,4,1,4,11,2,1,12,7,6,13,9,7,14,4,9,15,1,11,12,2,12,16,7,13,14,9,14,15,4,15,11,12,11,17,16,12,18,14,13,19,15,14,20,11,15,21,22,23,24,24,23,25,26,27,28,25,23,29,29,23,22,26,30,27]);
|
||||
|
||||
export default new Mesh({
|
||||
colors,
|
||||
faces,
|
||||
name: "src/meshes/trianglething.ply",
|
||||
normals,
|
||||
positions,
|
||||
uvs,
|
||||
vertexCount: 31
|
||||
});
|
5
src/meshes/trianglething/index.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import trianglething from "./trianglething";
|
||||
import texture0 from "./textures/texture0.png";
|
||||
import texture1 from "./textures/texture1.png";
|
||||
|
||||
export { trianglething, texture0, texture1 };
|
BIN
src/meshes/trianglething/textures/texture0.png
Normal file
After Width: | Height: | Size: 398 KiB |
BIN
src/meshes/trianglething/textures/texture1.png
Normal file
After Width: | Height: | Size: 5.7 MiB |
BIN
src/meshes/trianglething/textures/uv-normals.xcf
Normal file
BIN
src/meshes/trianglething/textures/uv.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
src/meshes/trianglething/textures/uv.xcf
Normal file
BIN
src/meshes/trianglething/trianglething.blend
Normal file
67
src/meshes/trianglething/trianglething.ply
Normal file
|
@ -0,0 +1,67 @@
|
|||
ply
|
||||
format ascii 1.0
|
||||
comment Created in Blender version 3.6.4
|
||||
element vertex 26
|
||||
property float x
|
||||
property float y
|
||||
property float z
|
||||
property float nx
|
||||
property float ny
|
||||
property float nz
|
||||
property float s
|
||||
property float t
|
||||
element face 26
|
||||
property list uchar uint vertex_indices
|
||||
end_header
|
||||
0 2.6090002 0 0 -1 8.3803394e-07 0.7660872 0.5526656
|
||||
-0.36800402 2.9959497 0.50652003 -0.5257306 -0.44721383 0.723607 0.6449925 0.52286637
|
||||
-0.5954481 2.9959497 -0.19346952 -0.8506533 -0.44721213 -0.2763879 0.8418907 0.33128682
|
||||
0.36800402 2.9959497 0.50652003 0.5257306 -0.4472139 0.723607 0.60803074 0.79587877
|
||||
0 2.9959497 -0.62609756 0 -0.44721153 -0.89442825 0.96344936 0.40123126
|
||||
0.5954481 2.9959497 -0.19346952 0.8506533 -0.4472122 -0.27638793 0.8416727 0.64077806
|
||||
0 3.6220508 0.62609756 0 0.44721153 0.89442825 0.50600564 0.49428308
|
||||
-0.5954481 3.6220508 0.19346952 -0.8506533 0.44721216 0.27638793 0.704352 0.31297976
|
||||
-0.36800402 3.6220508 -0.50652003 -0.5257306 0.4472139 -0.72360694 0.79145527 0.046412975
|
||||
0.5954481 2.9959497 -0.19346952 0.8506533 -0.4472122 -0.27638793 0.35179207 0.26814616
|
||||
0 2.9959497 -0.62609756 0 -0.44721153 -0.89442825 0.47356877 0.028599411
|
||||
0.36800402 3.6220508 -0.50652003 0.5257306 0.4472139 -0.72360694 0.5382167 0.15491244
|
||||
0.36800402 2.9959497 0.50652003 0.5257306 -0.4472139 0.723607 0.118150145 0.42324704
|
||||
0.5954481 3.6220508 0.19346952 0.85065323 0.4472122 0.2763879 0.40614995 0.39580685
|
||||
0 4.0090003 0 0 1 -8.165459e-07 0.5992601 0.26365823
|
||||
1.0000001 0 0 0.8999471 -0.43599886 2.4163015e-07 0.4984935 0.5027367
|
||||
0 2.5000002 0 -5.150958e-08 1 0 0.24900003 0.7522302
|
||||
-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 -0.00049349666 0.50273675
|
||||
-1.0000001 0 -8.742279e-08 -0.8999471 -0.4359989 -2.4291313e-07 -0.00049346685 1.0017238
|
||||
-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 0.7633698 0.99398905
|
||||
1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.99752307 0.7598357
|
||||
1.0000001 0 0 0.8999471 -0.43599886 2.4163015e-07 0.9975231 0.99398893
|
||||
1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.49849355 1.0017238
|
||||
-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 0.99646366 0.7612665
|
||||
-1.0000001 0 -8.742279e-08 -0.8999471 -0.4359989 -2.4291313e-07 0.99646366 0.9954198
|
||||
1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.7623104 0.9954198
|
||||
3 0 1 2
|
||||
3 1 0 3
|
||||
3 0 2 4
|
||||
3 0 4 5
|
||||
3 0 5 3
|
||||
3 1 3 6
|
||||
3 2 1 7
|
||||
3 4 2 8
|
||||
3 9 10 11
|
||||
3 12 9 13
|
||||
3 1 6 7
|
||||
3 2 7 8
|
||||
3 10 8 11
|
||||
3 9 11 13
|
||||
3 12 13 6
|
||||
3 7 6 14
|
||||
3 8 7 14
|
||||
3 11 8 14
|
||||
3 13 11 14
|
||||
3 6 13 14
|
||||
3 15 16 17
|
||||
3 17 16 18
|
||||
3 19 20 21
|
||||
3 18 16 22
|
||||
3 22 16 15
|
||||
3 23 24 25
|
12
src/meshes/trianglething/trianglething.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Mesh } from "../../renderer/mesh";
|
||||
|
||||
// prettier-ignore
|
||||
export default new Mesh({
|
||||
colors: null,
|
||||
faces: new Uint8Array([0,1,2,1,0,3,0,2,4,0,4,5,0,5,3,1,3,6,2,1,7,4,2,8,9,10,11,12,9,13,1,6,7,2,7,8,10,8,11,9,11,13,12,13,6,7,6,14,8,7,14,11,8,14,13,11,14,6,13,14,15,16,17,17,16,18,19,20,21,18,16,22,22,16,15,23,24,25]),
|
||||
name: "src/meshes/trianglething/trianglething.ply",
|
||||
normals: new Float32Array([0,-1,8.3803394e-7,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0.5257306,-0.4472139,0.723607,0,-0.44721153,-0.89442825,0.8506533,-0.4472122,-0.27638793,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.8506533,-0.4472122,-0.27638793,0,-0.44721153,-0.89442825,0.5257306,0.4472139,-0.72360694,0.5257306,-0.4472139,0.723607,0.85065323,0.4472122,0.2763879,0,1,-8.165459e-7,0.8999471,-0.43599886,2.4163015e-7,-5.150958e-8,1,0,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,-3.0203772e-8,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,2.4163015e-7,0,-0.43599886,-0.8999471,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,0,-0.43599886,-0.8999471]),
|
||||
positions: new Float32Array([0,2.6090002,0,-0.36800402,2.9959497,0.50652003,-0.5954481,2.9959497,-0.19346952,0.36800402,2.9959497,0.50652003,0,2.9959497,-0.62609756,0.5954481,2.9959497,-0.19346952,0,3.6220508,0.62609756,-0.5954481,3.6220508,0.19346952,-0.36800402,3.6220508,-0.50652003,0.5954481,2.9959497,-0.19346952,0,2.9959497,-0.62609756,0.36800402,3.6220508,-0.50652003,0.36800402,2.9959497,0.50652003,0.5954481,3.6220508,0.19346952,0,4.0090003,0,1.0000001,0,0,0,2.5000002,0,-4.3711395e-8,0,1.0000001,-1.0000001,0,-8.742279e-8,-4.3711395e-8,0,1.0000001,1.1924882e-8,0,-1.0000001,1.0000001,0,0,1.1924882e-8,0,-1.0000001,-4.3711395e-8,0,1.0000001,-1.0000001,0,-8.742279e-8,1.1924882e-8,0,-1.0000001]),
|
||||
uvs: new Float32Array([0.7660872,0.5526656,0.6449925,0.52286637,0.8418907,0.33128682,0.60803074,0.79587877,0.96344936,0.40123126,0.8416727,0.64077806,0.50600564,0.49428308,0.704352,0.31297976,0.79145527,0.046412975,0.35179207,0.26814616,0.47356877,0.028599411,0.5382167,0.15491244,0.118150145,0.42324704,0.40614995,0.39580685,0.5992601,0.26365823,0.4984935,0.5027367,0.24900003,0.7522302,-0.00049349666,0.50273675,-0.00049346685,1.0017238,0.7633698,0.99398905,0.99752307,0.7598357,0.9975231,0.99398893,0.49849355,1.0017238,0.99646366,0.7612665,0.99646366,0.9954198,0.7623104,0.9954198]),
|
||||
vertexCount: 26
|
||||
});
|
1474
src/meshes/uvsphere-inverted.ply
Normal file
12
src/meshes/uvsphere-inverted.ts
Normal file
15299
src/meshes/uvsphere.ply
|
@ -11,6 +11,54 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: none;
|
||||
z-index: 110;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
font-family: 'Fira Code', 'Fira Mono', monospace;
|
||||
|
||||
&.loading-active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
& #loading-text {
|
||||
background-color: black;
|
||||
padding: 1em;
|
||||
border-radius: 8px;
|
||||
max-width: 80vw;
|
||||
word-wrap: break-word;
|
||||
|
||||
& #stage1-error {
|
||||
opacity: 0;
|
||||
animation: opacity_0_1 1ms 5s forwards 1;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
& #stage1-error2 {
|
||||
opacity: 0;
|
||||
animation: opacity_0_1 1ms 10s forwards 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes opacity_0_1 {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
|
|
8
src/renderer/color-utils.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { vec4 } from "gl-matrix";
|
||||
|
||||
export const rgbToFloat = (
|
||||
r: number,
|
||||
g: number,
|
||||
b: number,
|
||||
a: number = 255
|
||||
): vec4 => [r / 255, g / 255, b / 255, a / 255];
|
15
src/renderer/editor.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Behavior } from "./behavior";
|
||||
import { Transform } from "./transform";
|
||||
|
||||
type PaneConfig = {
|
||||
name: string;
|
||||
type: "transform" | "float" | "vec3" | "color";
|
||||
onChange: Function;
|
||||
};
|
||||
|
||||
export class Editor extends Behavior {
|
||||
private panes: PaneConfig[] = [];
|
||||
addTransform(name: string, onChange: (newTransform: Transform) => void) {
|
||||
this.panes.push({ name, type: "transform", onChange });
|
||||
}
|
||||
}
|
34
src/renderer/gizmo.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { WebGLApp } from "./webgl";
|
||||
import { Transform, v3 } from "./transform";
|
||||
import { Renderable } from "./renderable";
|
||||
import { MeshRenderer } from "./mesh-renderer";
|
||||
import { Mesh } from "./mesh";
|
||||
import { Shader } from "./shader";
|
||||
import { basicShaderConfig } from "../common-shaders/basic";
|
||||
import basicVert from "../common-shaders/basic.vert";
|
||||
import vertexColorsFrag from "../common-shaders/vertex-colors.frag";
|
||||
import gizmo from "../meshes/gizmo";
|
||||
|
||||
const gizmoShader = (app: WebGLApp) =>
|
||||
new Shader(basicShaderConfig)
|
||||
.vertex(basicVert)
|
||||
.fragment(vertexColorsFrag)
|
||||
.app(app);
|
||||
|
||||
export const createGizmo = (
|
||||
app: WebGLApp,
|
||||
camera: Transform,
|
||||
transform?: Transform
|
||||
) => {
|
||||
const localTransform = new Transform(
|
||||
transform?.position,
|
||||
transform?.rotation
|
||||
// v3(0.5)
|
||||
);
|
||||
|
||||
const mr = new MeshRenderer(app, gizmo, gizmoShader(app), camera).configure(
|
||||
{}
|
||||
);
|
||||
|
||||
new Renderable(app, localTransform, mr);
|
||||
};
|
BIN
src/renderer/helper-textures/black.png
Normal file
After Width: | Height: | Size: 526 B |
5
src/renderer/helper-textures/black.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Texture } from "../texture";
|
||||
import { WebGLApp } from "../webgl";
|
||||
import black from "./black.png";
|
||||
|
||||
export const createBlackTexture = (app: WebGLApp) => new Texture(app, black);
|
BIN
src/renderer/helper-textures/bump.png
Normal file
After Width: | Height: | Size: 694 B |
5
src/renderer/helper-textures/bump.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { Texture } from "../texture";
|
||||
import { WebGLApp } from "../webgl";
|
||||
import bump from "./bump.png";
|
||||
|
||||
export const createBumpTexture = (app: WebGLApp) => new Texture(app, bump);
|
BIN
src/renderer/helper-textures/pink.png
Normal file
After Width: | Height: | Size: 654 B |