Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial shader module #1196

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f0ddb2d
Add initial shader module
TristanCacqueray Sep 28, 2024
1b8998a
Fix shader reload
TristanCacqueray Oct 18, 2024
46b4aff
Merge remote-tracking branch 'origin/main' into shader
felixroos Oct 18, 2024
13168bb
codeformat
felixroos Oct 18, 2024
735d531
Move shader module into it's own package
TristanCacqueray Oct 19, 2024
5c983ce
Extract the uniform helper to its own module
TristanCacqueray Oct 19, 2024
bf3a095
codeformat
felixroos Oct 19, 2024
b0149f8
Refactor the uniform function and add documentation
TristanCacqueray Oct 19, 2024
d3e624f
Merge branch 'shader' of https://github.com/TristanCacqueray/strudel …
felixroos Oct 19, 2024
fcd550b
codeformat
felixroos Oct 19, 2024
8d1180f
fix: test runtime for uniform function
felixroos Oct 19, 2024
67c0eba
snapshot
felixroos Oct 19, 2024
9b4675f
Update the shader todos
TristanCacqueray Oct 19, 2024
b85a5a9
Use pat.withValue and add uniformTrigger
TristanCacqueray Oct 20, 2024
cad11e1
Update uniform value and add tests
TristanCacqueray Oct 20, 2024
e6fbef9
Merge branch 'main' into shader
felixroos Oct 20, 2024
9e0b840
Fix default uniformTrigger indexs
TristanCacqueray Oct 20, 2024
1baa6da
Update uniform method to take an option object
TristanCacqueray Oct 20, 2024
f8a2414
Add uniform pattern function doc
TristanCacqueray Oct 21, 2024
36d4d89
Fix lint error
TristanCacqueray Oct 21, 2024
65cc317
Automatically set onTrigger when the hap value is not a number
TristanCacqueray Oct 21, 2024
77bbb96
Remove uniform pattern function and expose the shader instance
TristanCacqueray Oct 27, 2024
0d67176
Improve the API when using a frame modifier
TristanCacqueray Oct 27, 2024
fc335c9
Remove PicoGL dependency
TristanCacqueray Dec 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/codemirror-repl/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const editor = new StrudelMirror({
import('@strudel/core'),
import('@strudel/draw'),
import('@strudel/mini'),
import('@strudel/shader'),
import('@strudel/tonal'),
import('@strudel/webaudio'),
);
Expand Down
1 change: 1 addition & 0 deletions packages/repl/prebake.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export async function prebake() {
import('@strudel/webaudio'),
import('@strudel/codemirror'),
import('@strudel/hydra'),
import('@strudel/shader'),
import('@strudel/soundfonts'),
import('@strudel/midi'),
// import('@strudel/xen'),
Expand Down
16 changes: 16 additions & 0 deletions packages/shader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# @strudel/shader

Helpers for drawing shader.

## Todos

Here are the things that needs to be implemented:

- [ ] Shader compilation error reporting, e.g. to show the line number
- [ ] Shader import from url, like shadertoy or git
- [ ] Display shader author attribution, e.g. to respect CC-BY
- [ ] Handle WebGL context lost by restoring the objects.
- [ ] Multiple instances and custom canvas positions
- [ ] Multiple programs, to be swapped like a pattern
- [ ] Texture inputs
- [ ] Buffer inputs, e.g. to generate a texture
1 change: 1 addition & 0 deletions packages/shader/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './shader.mjs';
40 changes: 40 additions & 0 deletions packages/shader/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@strudel/shader",
"version": "1.0.0",
"description": "Helpers for drawing shader",
"main": "index.mjs",
"type": "module",
"publishConfig": {
"main": "dist/index.mjs"
},
"scripts": {
"build": "vite build",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
},
"keywords": [
"titdalcycles",
"strudel",
"pattern",
"livecoding",
"algorave",
"shader"
],
"author": "Felix Roos <[email protected]>",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/tidalcycles/strudel/issues"
},
"homepage": "https://github.com/tidalcycles/strudel#readme",
"dependencies": {
"@strudel/core": "workspace:*",
"picogl": "^0.17.9"
},
"devDependencies": {
"vite": "^5.0.10",
"vitest": "^2.1.3"
}
}
Loading