diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2064f14..ad4e83b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: - main - # - develop + - develop paths-ignore: - '**/README.md' - '**/CHANGELOG.md' diff --git a/CHANGELOG.md b/CHANGELOG.md index d59920f..f0445cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Add `vf/entity-debug` and `vf/systems-debug` - Add `vj/ContactManifold` - Improve error for VybeC compilation +- Add `mixer.fs` ## v0.7.444 diff --git a/resources/com/pfeodrippe/vybe/shaders/mixer.fs b/resources/com/pfeodrippe/vybe/shaders/mixer.fs index 81d83b4..740185f 100644 --- a/resources/com/pfeodrippe/vybe/shaders/mixer.fs +++ b/resources/com/pfeodrippe/vybe/shaders/mixer.fs @@ -7,20 +7,81 @@ in vec4 fragColor; uniform sampler2D texture0; uniform sampler2D texture1; uniform vec4 colDiffuse; -uniform float edge_fill; +uniform float u_fill; +uniform float u_time; // Output fragment color out vec4 finalColor; +bool fill_whole(vec2 st) { + float c = 1.0; + bool trigger = + st.x * st.y < sin(u_fill * 0.87 * c) * cos(u_fill * 0.23 * c) + sin(u_fill * 0.37 * c) * cos(u_fill * 0.53 * c) + //st.x > sin(u_fill * 0.24) * 1.0 && st.x < sin(u_fill * 0.87 * c) && + //st.y > sin(u_fill * 0.41 * c) * 0.4 && st.y < sin(u_fill * 0.46 * c) + ; + + return trigger; +} + +bool fill_blob(vec2 st) { + if (u_fill < -0.5) return false; + + float c = 0.5; + bool trigger = false; + + float t = sin(u_time * 0.8) * 0.1; + float r = u_fill * 0.5 + t; + + + // Circle. + if ((st.x - c) * (st.x - c) + (st.y - c) * (st.y - c) < r/5.0) { + trigger = true; + } + + // Square. + // if (st.x - 0.5 < 0.25 * u_fill && st.y - 0.5 < 0.25 * u_fill && + // st.x - 0.5 > -0.25 * u_fill && st.y - 0.5 > -0.25 * u_fill) { + // trigger = true; + // } + + /* + if ((sin(st.x + cos(u_time*0.532) * 0.05) - c) * (sin(st.x + cos(u_time*0.3) * 0.04) - c) + + (sin(st.y + sin(u_time * 0.2) * 0.145) - c) * (sin(st.y + sin(u_time * 0.153) * 0.1) - c) + < r/1.0 * st.x * st.y * cos(st.x * u_time * 0.1) * sin(st.y * u_time * 0.2)) { + trigger = true; + } + */ + + /* + if ((sin(st.x + cos(u_time*0.532) * 0.05) - c) * (sin(st.x + cos(u_time*0.3) * 0.04) - c) + + (sin(st.y + sin(u_time * 0.2) * 0.145) - c) * (sin(st.y + sin(u_time * 0.153) * 0.1) - c) + < r/8.0) { + trigger = true; + } + */ + + // dots + /* + if ((st.x - c) * (st.x - c) + (st.y - c) * (st.y - c) < r/5.0) { + if (sin(st.y*99999.0) > 0.0001 && cos(st.x*100000.0) > 0.0001) { + trigger = true; + } else { + trigger = false; + } + } + */ + + return trigger; +} + void main (void) { vec2 st = fragTexCoord; - // Higher radius is like an out of focus effect. - float radius = 1.1; - float c = 1.0;bool trigger = - st.x * st.y < sin(edge_fill * 0.87 * c) * cos(edge_fill * 0.23 * c) + sin(edge_fill * 0.37 * c) * cos(edge_fill * 0.53 * c) - //st.x > sin(edge_fill * 0.24) * 1.0 && st.x < sin(edge_fill * 0.87 * c) && - //st.y > sin(edge_fill * 0.41 * c) * 0.4 && st.y < sin(edge_fill * 0.46 * c) + float c = 1.0; + bool trigger = + //fill_whole(st) + fill_blob(st) ; if (trigger) { diff --git a/resources/shaders/edge_2d.fs b/resources/shaders/edge_2d.fs index 087766b..965f9f4 100644 --- a/resources/shaders/edge_2d.fs +++ b/resources/shaders/edge_2d.fs @@ -45,7 +45,8 @@ void main (void) { finalColor = texelColor*colDiffuse*fragColor; } else { finalColor = vec4(color,1.0); - }*/ + } + */ finalColor = vec4(color, 1.0); } else { diff --git a/todo.md b/todo.md index cd0f89d..3253d1e 100644 --- a/todo.md +++ b/todo.md @@ -240,17 +240,20 @@ - [x] portion of the window - [x] only when cube clicked - [x] LPF when enabled - - [ ] 2 worlds - - [ ] different objects + - [x] 2 worlds + - [x] different objects - [x] disable/enable object - [x] render to another RT - [x] shader to mix the RTs - - [ ] transition from a blob - - [ ] multiple worlds, render twice? - - [ ] 2-player where you pass one object to the other? - - [ ] one in english, another in french? - - [ ] 3d? + - [ ] transition from a blob + - [ ] square + - [ ] circle + - [ ] animate blob +- [ ] multiple worlds, render twice? + - [ ] 2-player where you pass one object to the other? + - [ ] 3d? - [ ] mechanic + - [ ] one in english, another in french? - [ ] ambisonics - [ ] 2 sources - [ ] system