-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
425 additions
and
289 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sono from "./sono/sono.min.js"; | ||
// console.log(sono); | ||
|
||
const sound0 = sono.create("music.mp3"); | ||
const sound = sono.create({ | ||
id: "music", | ||
url: ["music.mp3"], | ||
loop: true, | ||
}); | ||
|
||
sound.play(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
export default { | ||
numParticles: "512", | ||
colorBg: [77.5, 77.5, 77.5], | ||
colorHighlight: [25, 103, 135], | ||
colorShadow: [0, 255, 120], | ||
colorBg: [192, 188, 183], | ||
colorHighlight: [247.5, 247.5, 247.5], | ||
colorShadow: [78, 72, 68], | ||
autoSave: false, | ||
showThumbnail: false, | ||
margin: 100, | ||
thumbnailSize: 256, | ||
background: [22, 22, 22], | ||
particleScale: 1.4, | ||
showWebcam: false, | ||
audio: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import { Draw, Geom, ShaderLibs } from "alfrid"; | ||
import { Draw, Geom } from "alfrid"; | ||
|
||
import vs from "shaders/pass.vert"; | ||
import fs from "shaders/compose.frag"; | ||
|
||
export default class DrawCompose extends Draw { | ||
constructor() { | ||
super() | ||
.setMesh(Geom.bigTriangle()) | ||
.useProgram(ShaderLibs.bigTriangleVert, fs); | ||
super().setMesh(Geom.bigTriangle()).useProgram(vs, fs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Draw, Geom } from "alfrid"; | ||
|
||
import vs from "shaders/floor.vert"; | ||
import fs from "shaders/floor.frag"; | ||
|
||
export default class DrawFloor extends Draw { | ||
constructor() { | ||
const s = 15; | ||
super().setMesh(Geom.plane(s, s, 1, "xz")).useProgram(vs, fs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { GL, Draw, Mesh } from "alfrid"; | ||
|
||
import { random } from "./utils"; | ||
|
||
import vs from "shaders/staticFace.vert"; | ||
import fs from "shaders/staticFace.frag"; | ||
|
||
export default class DrawStaticFace extends Draw { | ||
constructor() { | ||
super(); | ||
|
||
const positions = []; | ||
const uvs = []; | ||
const indices = []; | ||
|
||
let num = 250000; | ||
|
||
const { sin, cos, PI, pow } = Math; | ||
const getUV = () => { | ||
const r = pow(random(0.5), random(1, 1.3)); | ||
const a = random(PI * 2); | ||
return [r * cos(a) + 0.5, r * sin(a) + 0.5]; | ||
}; | ||
|
||
while (num--) { | ||
let scale = random(0.5, 1.5); | ||
if (random() < 0.01) { | ||
scale *= random(1, 2); | ||
} | ||
positions.push([scale, random(), random()]); | ||
uvs.push(getUV()); | ||
indices.push(num); | ||
} | ||
|
||
const mesh = new Mesh(GL.POINTS) | ||
.bufferVertex(positions) | ||
.bufferTexCoord(uvs) | ||
.bufferIndex(indices); | ||
|
||
this.setMesh(mesh).useProgram(vs, fs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Draw, Geom, ShaderLibs } from "alfrid"; | ||
import { random } from "./utils"; | ||
import fs from "shaders/vignette.frag"; | ||
|
||
export default class DrawBg extends Draw { | ||
constructor() { | ||
super() | ||
.setMesh(Geom.bigTriangle()) | ||
.useProgram(ShaderLibs.bigTriangleVert, fs) | ||
.uniform("uSeed", random(10)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.