Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b7fbfbeeb | ||
|
|
192cf571b1 | ||
|
|
519a9b88f4 | ||
|
|
f124cfacfb | ||
|
|
4e14404726 | ||
|
|
db77846f1b |
@@ -1,12 +1,12 @@
|
||||
pkgname=forge-steel
|
||||
pkgver=1.2.0
|
||||
pkgver=1.2.2
|
||||
pkgrel=1
|
||||
pkgdesc="Fusion Of Real Time Generative Effects"
|
||||
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
|
||||
depends=('glfw>=1:3', 'v4l-utils>=1.32', 'alsa-lib>=1.2', 'libglvnd>=1.7')
|
||||
url="https://git.klemek.fr/klemek/forge-steel"
|
||||
source=("${pkgname}-steel-${pkgver}.tar.gz::https://git.klemek.fr/klemek/forge-steel/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('b04e9159eb3eb809029bf02423e4bf844ecdb3b11cbcb49d8eed8f2505d32a1f')
|
||||
sha256sums=('e1c7c7bb9a614609b3d7e8647511c23cbe7a7a3d715b0c236b627c4e2dcbf4dd')
|
||||
srcdir=build
|
||||
backup=("usr/share/${pkgname}")
|
||||
|
||||
|
||||
@@ -263,6 +263,28 @@ Working with pages and items, you can use the following predefined sources and e
|
||||
|
||||
See the [printable version](./docs/forge_default_mapping.pdf).
|
||||
|
||||
### Available hotkeys
|
||||
|
||||
| Hotkey | Function |
|
||||
| ------ | -------- |
|
||||
| <kbd>Shift</kbd> + <kbd>F</kbd> | Switch between shader-decoded or hardware decoded YUYV |
|
||||
| <kbd>M</kbd> | Projection mapping 1 |
|
||||
| <kbd>Shift</kbd> + <kbd>M</kbd> | Projection mapping 2 |
|
||||
| <kbd>Ctrl</kbd> + <kbd>M</kbd> | Projection mapping 3 |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd> | Projection mapping 4 |
|
||||
|
||||
### Projection Mappings
|
||||
|
||||
In any of the projection mapping mode, use the nanoKONTROL2 last 4 columns to control 4 on-screen points:
|
||||
|
||||
| Midi Control | Function |
|
||||
| ------ | -------- |
|
||||
| Fader N | point N - X position |
|
||||
| Knob N | point N - Y position |
|
||||
| Last column top button | activate projection mapping |
|
||||
| Last column middle button | invert projection mapping |
|
||||
| Last column bottom button | show projection borders |
|
||||
|
||||
## Making your own FORGE project
|
||||
|
||||
You want to embrace the "user" in "user-defined"? It's time to make your own project.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
AC_INIT([forge], [steel-1.2.0], [klemek.dev@proton.me])
|
||||
AC_INIT([forge], [steel-1.2.2], [klemek.dev@proton.me])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PROG_CC
|
||||
|
||||
|
||||
@@ -235,11 +235,14 @@ GROUP_1_6_Y=19
|
||||
GROUP_1_6_Z=
|
||||
|
||||
# Same for group 2
|
||||
GROUP_2_ACTIVE_COUNT=4
|
||||
GROUP_2_ACTIVE_COUNT=7
|
||||
GROUP_2_ACTIVE_1=36
|
||||
GROUP_2_ACTIVE_2=68
|
||||
GROUP_2_ACTIVE_3=52
|
||||
GROUP_2_ACTIVE_4=11077
|
||||
GROUP_2_ACTIVE_4=1077
|
||||
GROUP_2_ACTIVE_5=11077
|
||||
GROUP_2_ACTIVE_6=101077
|
||||
GROUP_2_ACTIVE_7=111077
|
||||
GROUP_2_COUNT=7
|
||||
GROUP_2_1_X=37
|
||||
GROUP_2_1_Y=53
|
||||
@@ -273,12 +276,12 @@ GROUP_3_2_Y=16
|
||||
GROUP_3_2_Z=11089
|
||||
|
||||
# Auto-Random Ignore (ARI) prefixes
|
||||
ARI_COUNT=17
|
||||
ARI_COUNT=62
|
||||
ARI_1=GROUP_3_1_Y
|
||||
ARI_2=GROUP_3_2_Z
|
||||
ARI_3=GROUP_2_1_X_4
|
||||
ARI_4=GROUP_2_1_Y_4
|
||||
ARI_5=GROUP_2_1_Z_4
|
||||
ARI_3=GROUP_2_5_4
|
||||
ARI_4=GROUP_2_5_4
|
||||
ARI_5=GROUP_2_5_4
|
||||
ARI_6=GROUP_2_2_X_4
|
||||
ARI_7=GROUP_2_2_Y_4
|
||||
ARI_8=GROUP_2_2_Z_4
|
||||
@@ -291,6 +294,51 @@ ARI_14=GROUP_2_6_Z_4
|
||||
ARI_15=GROUP_2_7_X_4
|
||||
ARI_16=GROUP_2_7_Y_4
|
||||
ARI_17=GROUP_2_7_Z_4
|
||||
ARI_18=GROUP_2_5_5
|
||||
ARI_19=GROUP_2_5_5
|
||||
ARI_20=GROUP_2_5_5
|
||||
ARI_21=GROUP_2_2_X_5
|
||||
ARI_22=GROUP_2_2_Y_5
|
||||
ARI_23=GROUP_2_2_Z_5
|
||||
ARI_24=GROUP_2_4_X_5
|
||||
ARI_25=GROUP_2_4_Y_5
|
||||
ARI_26=GROUP_2_4_Z_5
|
||||
ARI_27=GROUP_2_6_X_5
|
||||
ARI_28=GROUP_2_6_Y_5
|
||||
ARI_29=GROUP_2_6_Z_5
|
||||
ARI_30=GROUP_2_7_X_5
|
||||
ARI_31=GROUP_2_7_Y_5
|
||||
ARI_32=GROUP_2_7_Z_5
|
||||
ARI_33=GROUP_2_5_6
|
||||
ARI_34=GROUP_2_5_6
|
||||
ARI_35=GROUP_2_5_6
|
||||
ARI_36=GROUP_2_2_X_6
|
||||
ARI_37=GROUP_2_2_Y_6
|
||||
ARI_38=GROUP_2_2_Z_6
|
||||
ARI_39=GROUP_2_4_X_6
|
||||
ARI_40=GROUP_2_4_Y_6
|
||||
ARI_41=GROUP_2_4_Z_6
|
||||
ARI_42=GROUP_2_6_X_6
|
||||
ARI_43=GROUP_2_6_Y_6
|
||||
ARI_44=GROUP_2_6_Z_6
|
||||
ARI_45=GROUP_2_7_X_6
|
||||
ARI_46=GROUP_2_7_Y_6
|
||||
ARI_47=GROUP_2_7_Z_6
|
||||
ARI_48=GROUP_2_5_7
|
||||
ARI_49=GROUP_2_5_7
|
||||
ARI_50=GROUP_2_5_7
|
||||
ARI_51=GROUP_2_2_X_7
|
||||
ARI_52=GROUP_2_2_Y_7
|
||||
ARI_53=GROUP_2_2_Z_7
|
||||
ARI_54=GROUP_2_4_X_7
|
||||
ARI_55=GROUP_2_4_Y_7
|
||||
ARI_56=GROUP_2_4_Z_7
|
||||
ARI_57=GROUP_2_6_X_7
|
||||
ARI_58=GROUP_2_6_Y_7
|
||||
ARI_59=GROUP_2_6_Z_7
|
||||
ARI_60=GROUP_2_7_X_7
|
||||
ARI_61=GROUP_2_7_Y_7
|
||||
ARI_62=GROUP_2_7_Z_7
|
||||
|
||||
# =====
|
||||
# OTHER
|
||||
|
||||
+87
-17
@@ -10,34 +10,104 @@ out vec4 fragColor;
|
||||
|
||||
uniform sampler2D iTex0;
|
||||
uniform vec3 iGroup2_4[7];
|
||||
uniform vec3 iGroup2_5[7];
|
||||
uniform vec3 iGroup2_6[7];
|
||||
uniform vec3 iGroup2_7[7];
|
||||
|
||||
void main() {
|
||||
bool visible = iGroup2_4[0].x > 0;
|
||||
bool invert = iGroup2_4[0].y > 0;
|
||||
float rect = iGroup2_4[0].z;
|
||||
bool visible = (iGroup2_4[4].x + iGroup2_5[4].x + iGroup2_6[4].x + iGroup2_7[4].x) > 0;
|
||||
bool invert = (iGroup2_4[4].y + iGroup2_5[4].y + iGroup2_6[4].y + iGroup2_7[4].y) > 0;
|
||||
float rect = clamp(iGroup2_4[4].z + iGroup2_5[4].z + iGroup2_6[4].z + iGroup2_7[4].z, 0, 1);
|
||||
bool modified = false;
|
||||
|
||||
vec2 uv2 = vUV;
|
||||
vec2 uv = mix(vec2(0), vUV, base_mask(vUV));
|
||||
|
||||
if (visible) {
|
||||
vec2 p1 = vec2(iGroup2_4[6].xy);
|
||||
vec2 p2 = vec2(iGroup2_4[1].xy);
|
||||
vec2 p3 = vec2(iGroup2_4[3].xy);
|
||||
vec2 p4 = vec2(iGroup2_4[5].xy);
|
||||
if (iGroup2_4[4].x > 0) {
|
||||
vec2 p11 = vec2(iGroup2_4[6].xy);
|
||||
vec2 p12 = vec2(iGroup2_4[1].xy);
|
||||
vec2 p13 = vec2(iGroup2_4[3].xy);
|
||||
vec2 p14 = vec2(iGroup2_4[5].xy);
|
||||
|
||||
p2.x = 1 - p2.x;
|
||||
p3.y = 1 - p3.y;
|
||||
p4.x = 1 - p4.x;
|
||||
p4.y = 1 - p4.y;
|
||||
p12.x = 1 - p12.x;
|
||||
p13.y = 1 - p13.y;
|
||||
p14.x = 1 - p14.x;
|
||||
p14.y = 1 - p14.y;
|
||||
|
||||
uv2 = project_4p(vUV, p1, p2, p3, p4);
|
||||
vec2 uv1 = project_4p(vUV, p11, p12, p13, p14);
|
||||
uv1 = mix(vec2(0), uv1, base_mask(uv1));
|
||||
uv = uv1;
|
||||
modified = true;
|
||||
}
|
||||
|
||||
vec4 color = texture(iTex0, invert ? vUV : uv2);
|
||||
if (iGroup2_5[4].x > 0) {
|
||||
vec2 p21 = vec2(iGroup2_5[6].xy);
|
||||
vec2 p22 = vec2(iGroup2_5[1].xy);
|
||||
vec2 p23 = vec2(iGroup2_5[3].xy);
|
||||
vec2 p24 = vec2(iGroup2_5[5].xy);
|
||||
|
||||
p22.x = 1 - p22.x;
|
||||
p23.y = 1 - p23.y;
|
||||
p24.x = 1 - p24.x;
|
||||
p24.y = 1 - p24.y;
|
||||
|
||||
vec2 uv2 = project_4p(vUV, p21, p22, p23, p24);
|
||||
uv2 = mix(vec2(0), uv2, base_mask(uv2));
|
||||
if (modified) {
|
||||
uv = mix(uv, uv2, step(0.0001, length(uv2)));
|
||||
} else {
|
||||
uv = uv2;
|
||||
}
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (iGroup2_6[4].x > 0) {
|
||||
vec2 p31 = vec2(iGroup2_6[6].xy);
|
||||
vec2 p32 = vec2(iGroup2_6[1].xy);
|
||||
vec2 p33 = vec2(iGroup2_6[3].xy);
|
||||
vec2 p34 = vec2(iGroup2_6[5].xy);
|
||||
|
||||
p32.x = 1 - p32.x;
|
||||
p33.y = 1 - p33.y;
|
||||
p34.x = 1 - p34.x;
|
||||
p34.y = 1 - p34.y;
|
||||
|
||||
vec2 uv3 = project_4p(vUV, p31, p32, p33, p34);
|
||||
uv3 = mix(vec2(0), uv3, base_mask(uv3));
|
||||
if (modified) {
|
||||
uv = mix(uv, uv3, step(0.0001, length(uv3)));
|
||||
} else {
|
||||
uv = uv3;
|
||||
}
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (iGroup2_7[4].x > 0) {
|
||||
vec2 p41 = vec2(iGroup2_7[6].xy);
|
||||
vec2 p42 = vec2(iGroup2_7[1].xy);
|
||||
vec2 p43 = vec2(iGroup2_7[3].xy);
|
||||
vec2 p44 = vec2(iGroup2_7[5].xy);
|
||||
|
||||
p42.x = 1 - p42.x;
|
||||
p43.y = 1 - p43.y;
|
||||
p44.x = 1 - p44.x;
|
||||
p44.y = 1 - p44.y;
|
||||
|
||||
vec2 uv4 = project_4p(vUV, p41, p42, p43, p44);
|
||||
uv4 = mix(vec2(0), uv4, base_mask(uv4));
|
||||
if (modified) {
|
||||
uv = mix(uv, uv4, step(0.0001, length(uv4)));
|
||||
} else {
|
||||
uv = uv4;
|
||||
}
|
||||
modified = true;
|
||||
}
|
||||
|
||||
vec4 color = texture(iTex0, invert ? vUV : uv);
|
||||
|
||||
if (visible) {
|
||||
float mask = step(0, uv2.x) * step(-1, -uv2.x) * step(0, uv2.y) * step(-1, -uv2.y);
|
||||
float mask = step(0.0001, length(uv));
|
||||
color *= mix(mask, 1 - mask, invert ? 1 : 0);
|
||||
color = mix(color, color + mask * vec4(1), rect * (step(uv2.x, 0.01) + step(uv2.y, 0.01) + step(1 - uv2.y, 0.01) + step(1 - uv2.x, 0.01)));
|
||||
color = mix(color, color + mask * vec4(1), rect * (step(uv.x, 0.01) + step(uv.y, 0.01) + step(1 - uv.y, 0.01) + step(1 - uv.x, 0.01)));
|
||||
}
|
||||
|
||||
fragColor = color;
|
||||
|
||||
@@ -23,4 +23,8 @@ vec2 project_4p(vec2 uv, vec2 p1, vec2 p2, vec2 p3, vec2 p4) {
|
||||
return tmp.xy / tmp.z;
|
||||
}
|
||||
|
||||
float base_mask(vec2 uv) {
|
||||
return step(0, uv.x) * step(-1, -uv.x) * step(0, uv.y) * step(-1, -uv.y);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+20
-1
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
#include "args.h"
|
||||
#include "config.h"
|
||||
#include "string.h"
|
||||
@@ -42,6 +44,10 @@ static void print_help(int status_code) {
|
||||
"[-mr / -nmr] "
|
||||
"[-tm] "
|
||||
"[-tf] "
|
||||
"[--x11] "
|
||||
"[--wayland] "
|
||||
"[--cocoa] "
|
||||
"[--win32] "
|
||||
"\n\n"
|
||||
"Fusion Of Real-time Generative Effects.\n\n"
|
||||
"options:\n"
|
||||
@@ -81,7 +87,11 @@ static void print_help(int status_code) {
|
||||
" -mr, --midi-reconnect auto-reconnect midi (default)\n"
|
||||
" -nmr, --no-midi-reconnect do not auto-reconnect midi\n"
|
||||
" -tm, --trace-midi print midi code and values\n"
|
||||
" -tf, --trace-fps print fps status of subsystems\n");
|
||||
" -tf, --trace-fps print fps status of subsystems\n"
|
||||
" --x11 force X11 GLFW backend\n"
|
||||
" --wayland force Wayland GLFW backend\n"
|
||||
" --cocoa force Cocoa GLFW backend\n"
|
||||
" --win32 force Win32 GLFW backend\n");
|
||||
exit(status_code);
|
||||
}
|
||||
|
||||
@@ -152,6 +162,7 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->midi_reconnect = true;
|
||||
params->trace_midi = false;
|
||||
params->trace_fps = false;
|
||||
params->glfw_backend = GLFW_BACKEND_ANY;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
arg = argv[i];
|
||||
@@ -220,6 +231,14 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->trace_midi = true;
|
||||
} else if (is_arg(arg, "-tf") || is_arg(arg, "--trace-fps")) {
|
||||
params->trace_fps = true;
|
||||
} else if (is_arg(arg, "--x11")) {
|
||||
params->glfw_backend = GLFW_BACKEND_X11;
|
||||
} else if (is_arg(arg, "--wayland")) {
|
||||
params->glfw_backend = GLFW_BACKEND_WAYLAND;
|
||||
} else if (is_arg(arg, "--cocoa")) {
|
||||
params->glfw_backend = GLFW_BACKEND_COCOA;
|
||||
} else if (is_arg(arg, "--win32")) {
|
||||
params->glfw_backend = GLFW_BACKEND_WIN32;
|
||||
} else {
|
||||
#ifdef VIDEO_IN
|
||||
if (is_arg(arg, "-vi") || is_arg(arg, "--video-in")) {
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
#ifndef CONSTANTS_H
|
||||
#define CONSTANTS_H
|
||||
|
||||
static const unsigned int GLFW_BACKEND_ANY = 0;
|
||||
static const unsigned int GLFW_BACKEND_X11 = 1;
|
||||
static const unsigned int GLFW_BACKEND_WAYLAND = 2;
|
||||
static const unsigned int GLFW_BACKEND_COCOA = 3;
|
||||
static const unsigned int GLFW_BACKEND_WIN32 = 4;
|
||||
|
||||
static const char *vertex_shader_text =
|
||||
"#version 460\n"
|
||||
"const mat4 mvp = "
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ static bool init(const Parameters *params) {
|
||||
|
||||
start_state_background_write();
|
||||
|
||||
window_startup(error_callback);
|
||||
window_startup(error_callback, params->glfw_backend);
|
||||
|
||||
context.tex_resolution[0] = params->internal_size;
|
||||
context.tex_resolution[1] = params->internal_size;
|
||||
|
||||
@@ -58,6 +58,7 @@ typedef struct Parameters {
|
||||
bool midi_reconnect;
|
||||
bool trace_midi;
|
||||
bool trace_fps;
|
||||
unsigned int glfw_backend;
|
||||
} Parameters;
|
||||
|
||||
// file.c
|
||||
|
||||
+31
-3
@@ -5,9 +5,12 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
#include "window.h"
|
||||
|
||||
static void init_glfw(void (*error_callback)(int, const char *)) {
|
||||
static void init_glfw(void (*error_callback)(int, const char *),
|
||||
const unsigned int backend) {
|
||||
log_info("[GLFW] Initializing...");
|
||||
|
||||
// set errors handler
|
||||
@@ -16,6 +19,28 @@ static void init_glfw(void (*error_callback)(int, const char *)) {
|
||||
// print current GLFW version
|
||||
log_info("[GLFW] %s", glfwGetVersionString());
|
||||
|
||||
switch (backend) {
|
||||
case GLFW_BACKEND_X11:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
|
||||
log_info("[GLFW] platform: X11");
|
||||
break;
|
||||
case GLFW_BACKEND_WAYLAND:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
|
||||
log_info("[GLFW] platform: Wayland");
|
||||
break;
|
||||
case GLFW_BACKEND_COCOA:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_COCOA);
|
||||
log_info("[GLFW] platform: Cocoa");
|
||||
break;
|
||||
case GLFW_BACKEND_WIN32:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_BACKEND_WIN32);
|
||||
log_info("[GLFW] platform: Win32");
|
||||
break;
|
||||
default:
|
||||
log_info("[GLFW] platform: Any");
|
||||
break;
|
||||
}
|
||||
|
||||
// init GLFW
|
||||
if (!glfwInit()) {
|
||||
log_error("[GLFW] Initialization failed");
|
||||
@@ -86,8 +111,9 @@ create_window(GLFWmonitor *monitor, const char *title, Window *shared_context,
|
||||
|
||||
static void use_window(GLFWwindow *window) { glfwMakeContextCurrent(window); }
|
||||
|
||||
void window_startup(void (*error_callback)(int, const char *)) {
|
||||
init_glfw(error_callback);
|
||||
void window_startup(void (*error_callback)(int, const char *),
|
||||
const unsigned int backend) {
|
||||
init_glfw(error_callback, backend);
|
||||
}
|
||||
|
||||
void window_terminate() {
|
||||
@@ -107,6 +133,8 @@ Window *window_init(const char *title, unsigned char monitor_index,
|
||||
|
||||
use_window(window);
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
void window_startup(void (*error_callback)(int, const char *));
|
||||
void window_startup(void (*error_callback)(int, const char *), const unsigned int backend);
|
||||
|
||||
void window_terminate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user