24 Commits
Author SHA1 Message Date
klemek ea54446dc6 forge (steel) v1.2.6
Clang Build CI / run-no-video (push) Failing after 10m4s
Clang Build CI / build-release (push) Failing after 11m6s
Clang Build CI / run-video (push) Failing after 9m20s
Clang Lint CI / lint-no-video (push) Failing after 8m45s
Clang Lint CI / lint-video (push) Failing after 8m28s
2026-11-13 08:44:55 +01:00
klemek d75e377c0e forge (steel) v1.2.6 2026-11-13 08:44:22 +01:00
klemek 7d6aded6f0 fix: glsl-glyphs submodule path 2026-11-13 08:43:10 +01:00
klemek 22aa4c7e95 style: format code
Clang Build CI / build-release (push) Canceled after 0s
Clang Build CI / run-no-video (push) Canceled after 0s
Clang Build CI / run-video (push) Canceled after 0s
Clang Lint CI / lint-no-video (push) Failing after 10m29s
Clang Lint CI / lint-video (push) Failing after 10m49s
2026-11-13 08:41:26 +01:00
klemek ad48361a47 fix: default project glsl missing in bundled release 2026-11-13 08:39:04 +01:00
klemek d1ca7885e5 fix: arch release sudo issues 2026-11-13 08:38:21 +01:00
klemek c695075ca1 forge (steel) v1.2.5
Clang Lint CI / lint-no-video (push) Failing after 9m26s
Clang Lint CI / lint-video (push) Failing after 9m7s
Clang Build CI / build-release (push) Failing after 9m2s
Clang Build CI / run-no-video (push) Failing after 8m51s
Clang Build CI / run-video (push) Failing after 9m38s
2026-11-13 08:06:58 +01:00
klemek f784ca4d0b fix(make): invalid release target 2026-11-13 08:06:14 +01:00
klemek 867c7fdcb1 fix: blink only selected active src/fx
Clang Build CI / run-no-video (push) Canceled after 6m37s
Clang Build CI / build-release (push) Canceled after 7m14s
Clang Lint CI / lint-no-video (push) Failing after 10m55s
Clang Build CI / run-video (push) Canceled after 11m1s
Clang Lint CI / lint-video (push) Failing after 8m45s
2026-11-13 08:01:54 +01:00
klemek 862a620f92 chore: update glsl-glyphs 2026-11-11 18:02:56 +01:00
klemek ba13569696 fix: perlin 2026-11-10 01:44:27 +01:00
klemek 1c6cadd4c6 feat: perlin noise function 2026-11-08 23:04:54 +01:00
klemek 39bdaaaee9 chore: update glsl-glyphs 2026-11-08 18:53:37 +01:00
klemek a6240ecba8 fix: default project fx cp437 2026-11-08 18:48:12 +01:00
klemek b813c19057 chore: remove obsolete sentences.py 2026-11-08 18:30:18 +01:00
klemek 3d00594f88 feat: use glsl-glyphs 1.0.1 2026-11-08 18:27:54 +01:00
klemek 9e2acd3d4b fix: cp437 usage after glsl-glyphs 2026-11-08 18:14:38 +01:00
klemek 2a2460416d feat: lab utilites and fix 2026-11-08 18:14:21 +01:00
klemek f2c2bb5780 tools: add lab for working on default project 2026-11-08 17:47:11 +01:00
klemek 9be9576caf feat: use glsl-glyphs 1.0.0 2026-11-08 17:19:06 +01:00
klemek d604d60369 feat: generate cp437/sentences with glsl-glyphs 2026-11-08 17:16:33 +01:00
klemek fe2a9734f1 feat: new submodule glsl-glyphs 2026-11-08 13:07:10 +01:00
klemek d93746c74b tools(make): default args for quick launch 2026-11-08 13:06:59 +01:00
klemek 06613fe647 tools(make): much better Makefile.dev 2026-11-08 13:03:04 +01:00
38 changed files with 1012 additions and 564 deletions
+30 -26
View File
@@ -1,31 +1,35 @@
build !default/sentences.txt
.vscode
*.bmp
!images/* !images/*
*.bmp
*.cache *.cache
.deps *.gch
Makefile
*.log *.log
*.o *.o
.dirstamp
aclocal.m4
compile
install-sh
missing
depcomp
Makefile.in
configure~
config.status
forge
*.tar.gz
configure
*.pkg.tar.zst
pkg
forge-*
confdeps.*
conftest.*
*.txt
error.glsl
draft/
*.gch
*.out *.out
*.pkg.tar.zst
*.tar.gz
*.txt
.deps
.dirstamp
.vscode
Makefile
Makefile.in
aclocal.m4
build
compile
confdeps.*
config.status
configure
configure~
conftest.*
depcomp
draft/
error.glsl
forge
forge-*
install-sh
lab/*.glsl
!lab/*.example.glsl
!lab/inc_*.glsl
missing
pkg
+3
View File
@@ -7,3 +7,6 @@
[submodule "log.c"] [submodule "log.c"]
path = log.c path = log.c
url = https://github.com/rxi/log.c url = https://github.com/rxi/log.c
[submodule "glsl-glyphs"]
path = glsl-glyphs
url = https://git.klemek.fr/klemek/glsl-glyphs
+36 -10
View File
@@ -3,20 +3,45 @@
## Makefile.dev targets ## Makefile.dev targets
```text ```text
clean remove build folder Usage: make --no-print-directory [target1] [target2] ...
build build project into build/forge
run run project with test args Commands/Targets:
demo run project with demo mode help show this message
valgrind valgrind analysis init init project
full-clean remove build files and untracked files clean clean build artifacts
test-release try to build release full-clean remove any residual files
release-% make full release of version % build build project
release-arch make arch-linux release package build-no-video build project no video in
run run project with $RUN_ARGS
run-lab run lab for working on default project
run-% run {project} with $RUN_ARGS
format format project
release-test test release
release-% build release {version}
rm-build rm -rf build
git-clean git clean -f -x
rm-deps rm -rf */.deps
clang-format clang-format -i src/*
exec-build ./build/forge $RUN_ARGS
exec-build-% ./build/forge --project={project} $RUN_ARGS
aclocal aclocal
autoconf autoconf
automake automake --add-missing
start-configure ./configure
make-% make {target}
cp-release cp forge-steel-xxx.tar.gz build/
git-submodule-update git submodule update --init --recursive
git-pull git pull origin main
prepare-configure-% sed -i {version} configure.ac
prepare-pkgbuild-% sed -i {version} PKGBUILD
git-commit-release git commit -am "forge (steel) v{version}"
makepkg makepkg
glsl-glyphs glsl-glyphs
``` ```
## Release guide ## Release guide
```shell ```bash
# make full build # make full build
make -f Makefile.dev release-1.0.0 make -f Makefile.dev release-1.0.0
# push release # push release
@@ -25,6 +50,7 @@ git push origin main --tags
# attach .tar.gz to the github release # attach .tar.gz to the github release
make -f Makefile.dev release-arch make -f Makefile.dev release-arch
# attach .pkg.tar.zst to the github release # attach .pkg.tar.zst to the github release
make full-clean
``` ```
## Roadmap ## Roadmap
+2 -2
View File
@@ -5,6 +5,6 @@ forge_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays
forge_LDADD = -lm -lGL -lglfw -lasound forge_LDADD = -lm -lGL -lglfw -lasound
include_HEADERS = src/args.h src/arr.h src/config.h src/config_file.h src/constants.h src/file.h src/forge.h src/main.h src/midi.h src/project.h src/rand.h src/shaders.h src/state.h src/string.h src/tempo.h src/timer.h src/types.h src/video.h src/window.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h include_HEADERS = src/args.h src/arr.h src/config.h src/config_file.h src/constants.h src/file.h src/forge.h src/main.h src/midi.h src/project.h src/rand.h src/shaders.h src/state.h src/string.h src/tempo.h src/timer.h src/types.h src/video.h src/window.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h
EXTRA_DIST = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl EXTRA_DIST = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_map.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_write.glsl default/inc_yuyv.glsl
confdir = $(prefix)/share/$(PACKAGE) confdir = $(prefix)/share/$(PACKAGE)
conf_DATA = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl conf_DATA = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_map.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_write.glsl default/inc_yuyv.glsl
+187 -80
View File
@@ -1,107 +1,214 @@
TARGET ?= forge # ENV
INSTALL_DIR ?= $(HOME)/.local/bin
RUN_ARGS ?= --help RUN_ARGS ?= --demo -nmr -is=480 --monitor-only
SHELL := /bin/bash SHELL := /bin/bash
MAKE := $(MAKE) --no-print-directory
.PHONY: build BUILD_DIR ?= build
clean: TARGET ?= forge
@rm -rf build VERSION ?= invar-$(shell grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' configure.ac)
build/$(TARGET): CC ?= gcc
@mkdir -p build SOURCES ?= src/*.h src/*.c hashmap.c/hashmap.c log.c/src/log.c
gcc \ CFLAGS ?= -Ofast -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp -Iinclude -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE -DLOG_USE_COLOR -DVERSION=\"$(VERSION)\"
src/*.h src/*.c \ EXTRA_CFLAGS ?= -DEGL_DEBUG -DGL_DEBUG -DVIDEO_IN
-Iinclude \ LDLIBS ?= -lm -lGL -lglfw -lasound
hashmap.c/hashmap.c \
log.c/src/log.c \
-lm -lGL -lglfw -lasound \
-Wall -Wextra \
-Wno-format-truncation \
-DGLFW_INCLUDE_NONE \
-DGLFW_EXPOSE_NATIVE_EGL \
-DGLFW_NATIVE_INCLUDE_NONE \
-DLOG_USE_COLOR \
-DVIDEO_IN \
-o build/$(TARGET) \
-g -Og
.PHONY: build CLANG_FORMAT ?= clang-format
build: build/$(TARGET) VALGRIND ?= valgrind
.PHONY: build-no-video ACLOCAL ?= aclocal
build-no-video: AUTOCONF ?= autoconf
@mkdir -p build AUTOMAKE ?= automake
gcc \ CONFIGURE ?= ./configure
src/*.h src/*.c \ MAKEPKG ?= makepkg
-Iinclude \
hashmap.c/hashmap.c \
log.c/src/log.c \
-lm -lGL -lglfw -lasound \
-Wall -Wextra \
-Wno-format-truncation \
-DGLFW_INCLUDE_NONE \
-DGLFW_NATIVE_INCLUDE_NONE \
-DLOG_USE_COLOR \
-o build/$(TARGET) \
-g -Og
.PHONY: format INSTALL_DIR ?= $(HOME)/.local/bin
format:
clang-format -i src/*
.PHONY: run ifeq (,$(shell which uv))
run: build/$(TARGET) ifeq (,$(shell python3 -m uv --help||python3 -m pip install --user uv)) # detect uv install
./build/$(TARGET) $(RUN_ARGS) UV ?= false
endif
UV ?= python3 -m uv
endif
.PHONY: sample UV ?= uv
sample: build/$(TARGET) GLSL_GLYPHS_DIR ?= glsl-glyphs
./build/$(TARGET) --project=sample $(RUN_ARGS) GLSL_GLYPHS ?= $(UV) run --directory $(GLSL_GLYPHS_DIR) glsl-glyphs
.PHONY: valgrind # DOCS
valgrind: build/$(TARGET)
valgrind \ .PHONY: help
--show-realloc-size-zero=no \ help: ## show this message
--undef-value-errors=no \ @echo "Usage: $(MAKE) [target1] [target2] ..."
./build/$(TARGET) $(RUN_ARGS) @echo ""
@echo "Commands/Targets:"
@cat $(MAKEFILE_LIST) | grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
@echo ""
@echo "Environment:"
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+\s*\??=.*$$' | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} $(MAKE) -s print-{} 2> /dev/null
.PHONY: print-%
print-%:
@echo -e '\033[32m$*\033[0m = $($*)'
# FILES
$(BUILD_DIR)/$(TARGET):
mkdir -p $(BUILD_DIR)
$(CC) $(SOURCES) $(CFLAGS) $(EXTRA_CFLAGS) $(LDLIBS) -o $(BUILD_DIR)/$(TARGET)
default/inc_cp437.glsl:
$(MAKE) glsl-glyphs
default/inc_sentences.glsl: default/sentences.txt
$(MAKE) glsl-glyphs
lab/frag%.glsl:
cp lab/frag$*.example.glsl lab/frag$*.glsl
# ACTIONS
.PHONY: init
init: git-submodule-update ## init project
.PHONY: clean
clean: rm-build ## clean build artifacts
.PHONY: full-clean .PHONY: full-clean
full-clean: full-clean: rm-build git-clean rm-deps ## remove any residual files
.PHONY: build
build: $(BUILD_DIR)/$(TARGET) ## build project
.PHONY: build-no-video
build-no-video: ## build project no video in
EXTRA_CFLAGS= $(MAKE) build
.PHONY: run
run: exec-build ## run project with $RUN_ARGS
.PHONY: run-lab
run-lab: lab/frag1.glsl lab/frag2.glsl lab/frag3.glsl ## run lab for working on default project
RUN_ARGS="-nmr -is=480 --hot-reload" $(MAKE) exec-build-lab
.PHONY: run-%
run-%: ## run {project} with $RUN_ARGS
$(MAKE) exec-build-$*
.PHONY: format
format: clang-format ## format project
.PHONY: release-test
release-test: full-clean aclocal autoconf automake start-configure make-distcheck cp-release ## test release
.PHONY: release-arch
release-arch: clean makepkg
.PHONY: release-%
release-%: ## build release {version}
$(MAKE) full-clean git-pull prepare-configure-$* aclocal autoconf automake start-configure make-distcheck cp-release prepare-pkgbuild-$* git-commit-release-$*
# TOOLS
.PHONY: rm-build
rm-build: ## rm -rf build
rm -rf $(BUILD_DIR)
.PHONY: git-clean
git-clean: ## git clean -f -x
git clean -f -x git clean -f -x
.PHONY: rm-deps
rm-deps: ## rm -rf */.deps
rm -rf */*/.deps rm -rf */*/.deps
rm -rf */.deps rm -rf */.deps
.PHONY: test-release .PHONY: clang-format
test-release: clean full-clean clang-format: ## clang-format -i src/*
aclocal clang-format -i src/*
autoconf
automake --add-missing
./configure
make distcheck
mkdir -p build
cp $(TARGET)-steel-*.tar.gz build/
.PHONY: release-% .PHONY: exec-build
release-%: clean full-clean exec-build: $(BUILD_DIR)/$(TARGET) ## ./build/forge $RUN_ARGS
./$(BUILD_DIR)/$(TARGET) $(RUN_ARGS)
.PHONY: exec-build-%
exec-build-%: $(BUILD_DIR)/$(TARGET) ## ./build/forge --project={project} $RUN_ARGS
./$(BUILD_DIR)/$(TARGET) --project=$* $(RUN_ARGS)
.PHONY: valgrind
valgrind: build/$(TARGET)
$(VALGRIND) \
--show-realloc-size-zero=no \
--undef-value-errors=no \
./$(BUILD_DIR)/$(TARGET) $(RUN_ARGS)
.PHONY: aclocal
aclocal: ## aclocal
$(ACLOCAL)
.PHONY: autoconf
autoconf: ## autoconf
$(AUTOCONF)
.PHONY: automake
automake: ## automake --add-missing
$(AUTOMAKE) --add-missing
.PHONY: start-configure
start-configure: ## ./configure
$(CONFIGURE)
.PHONY: make-%
make-%: ## make {target}
$(MAKE) $*
.PHONY: cp-release
cp-release: ## cp forge-steel-xxx.tar.gz build/
mkdir -p $(BUILD_DIR)
cp $(TARGET)-steel-*.tar.gz $(BUILD_DIR)/
.PHONY: git-submodule-update
git-submodule-update: ## git submodule update --init --recursive
git submodule update --init --recursive
.PHONY: git-pull
git-pull: ## git pull origin main
git pull origin main git pull origin main
.PHONY: prepare-configure-%
prepare-configure-%: ## sed -i {version} configure.ac
sed -i -E "s/[0-9]+\\.[0-9]+\\.[0-9]+/$*/g" configure.ac sed -i -E "s/[0-9]+\\.[0-9]+\\.[0-9]+/$*/g" configure.ac
aclocal
autoconf .PHONY: prepare-pkgbuild-%
automake --add-missing prepare-pkgbuild-%: ## sed -i {version} PKGBUILD
./configure
make distcheck
mkdir -p build
cp "$(TARGET)-steel-$*.tar.gz" build/
sed -i -E "s/pkgver=[0-9]+\\.[0-9]+\\.[0-9]+/pkgver=$*/g" PKGBUILD sed -i -E "s/pkgver=[0-9]+\\.[0-9]+\\.[0-9]+/pkgver=$*/g" PKGBUILD
sha256sum build/forge-steel-$*.tar.gz | cut -d' ' -f1 | xargs -I{} sed -i -E "s/sha256sums=\\('.*'\\)/sha256sums=\\('{}'\\)/g" PKGBUILD sha256sum build/forge-steel-$*.tar.gz | cut -d' ' -f1 | xargs -I{} sed -i -E "s/sha256sums=\\('.*'\\)/sha256sums=\\('{}'\\)/g" PKGBUILD
.PHONY: git-commit-release-%
git-commit-release-%: ## git commit -am "forge (steel) v{version}"
git add configure.ac PKGBUILD git add configure.ac PKGBUILD
git commit -am "forge (steel) v$*" git commit -am "forge (steel) v$*"
git tag v$* -m "FORGE steel-$*" git tag v$* -m "FORGE steel-$*"
@echo "Push release: git push origin main --tags" @echo "Push release: git push origin main --tags"
@echo "Rollback release: git reset HEAD~1 --hard && git tag -d v$*" @echo "Rollback release: git reset HEAD~1 --hard && git tag -d v$*"
.PHONY: makepkg
makepkg: ## makepkg
mkdir -p $(BUILD_DIR)
cp PKGBUILD $(BUILD_DIR)
cd $(BUILD_DIR) && $(MAKEPKG) -c -r
.PHONY: release-arch .PHONY: glsl-glyphs
release-arch: clean glsl-glyphs: ## glsl-glyphs
mkdir -p build $(GLSL_GLYPHS) \
cp PKGBUILD build --name cp437 \
cd build && makepkg --functions \
--includes \
--input sample/cp437_8x8.png \
--glyph-names sample/cp437_names.txt \
--sets sample/cp437_sets.csv \
--output ../default/inc_cp437.glsl \
--sentences-input ../default/sentences.txt \
--sentences-output ../default/inc_sentences.glsl
+3 -3
View File
@@ -1,12 +1,12 @@
pkgname=forge-steel pkgname=forge-steel
pkgver=1.2.4 pkgver=1.2.6
pkgrel=1 pkgrel=1
pkgdesc="Fusion Of Real Time Generative Effects" pkgdesc="Fusion Of Real Time Generative Effects"
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64') 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') depends=('glfw>=1:3', 'v4l-utils>=1.32', 'alsa-lib>=1.2', 'libglvnd>=1.7')
url="https://git.klemek.fr/klemek/forge-steel" 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") source=("${pkgname}-steel-${pkgver}.tar.gz::https://git.klemek.fr/klemek/forge-steel/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('a34c7f8101d8d947e26bee1fa5ab8d87f4292014e5ef17d03eb34fefb387db9e') sha256sums=('cef68aa72f9dfd7d9083005e45fa046f9fe0ff24ff6bf3bdcbbd494d28675895')
srcdir=build srcdir=build
backup=("usr/share/${pkgname}") backup=("usr/share/${pkgname}")
@@ -18,5 +18,5 @@ build() {
package() { package() {
cd "$srcdir/$pkgname-$pkgver" cd "$srcdir/$pkgname-$pkgver"
sudo make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
} }
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT([forge], [steel-1.2.4], [klemek.dev@proton.me]) AC_INIT([forge], [steel-1.2.6], [klemek.dev@proton.me])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AC_PROG_CC AC_PROG_CC
+1 -1
View File
@@ -92,7 +92,7 @@ SUB_2_PREFIX=fx_
# =========== # ===========
# Total number of internal textures # Total number of internal textures (including texture 0)
TEX_COUNT=12 TEX_COUNT=12
# === VIDEO DEVICES # === VIDEO DEVICES
+1 -1
View File
@@ -7,7 +7,7 @@ in vec2 vUV;
out vec4 fragColor; out vec4 fragColor;
#include inc_map.glsl #include inc_map.glsl
#include inc_cp437.glsl #include inc_write.glsl
uniform sampler2D iTex0; uniform sampler2D iTex0;
uniform vec3 iGroup2_4[7]; uniform vec3 iGroup2_4[7];
+218 -324
View File
@@ -1,410 +1,304 @@
#include inc_sentences.glsl
#ifndef INC_CP437 #ifndef INC_CP437
#define INC_CP437 #define INC_CP437
const int cp437[] = int[1024]( #define CP437_COUNT 256
0x0000, 0x0000, 0x0000, 0x0000, // 0x00, NUL
0x151E, 0x8A87, 0xE19D, 0x789B, // 0x01, SOH, SMILEY BLACK const int cp437_glyphs[] = int[1024](
0xFBFE, 0xFDF7, 0xEF73, 0x7FEC, // 0x02, STX, SMILEY LIGHT 0x0000, 0x0000, 0x0000, 0x0000, // 0x00, EMPTY
0xFFF6, 0x7773, 0x08CE, 0x0013, // 0x03, ETX, HEART 0x151E, 0x8A87, 0xE19D, 0x789B, // 0x01, SMILEY BLACK
0xFEC8, 0x7310, 0x08CE, 0x0013, // 0x04, EOT, DIAMOND 0xFBFE, 0xFDF7, 0xEF73, 0x7FEC, // 0x02, SMILEY LIGHT
0xFCEC, 0x7131, 0xECEF, 0x3137, // 0x05, ENQ, CLUB 0xFFF6, 0x7773, 0x08CE, 0x0013, // 0x03, HEART
0xEC88, 0x3100, 0xECEF, 0x3137, // 0x06, ACK, SPADE 0xFEC8, 0x7310, 0x08CE, 0x0013, // 0x04, DIAMOND
0xC800, 0x3100, 0x008C, 0x0013, // 0x07, BEL, DOT 0xFCEC, 0x7131, 0xC8BF, 0x1067, // 0x05, CLUB
0x37FF, 0xCEFF, 0xFF73, 0xFFEC, // 0x08, BS, INVERT DOT 0xFEC8, 0x7310, 0xC8AF, 0x1027, // 0x06, SPADE
0x26C0, 0x4630, 0x0C62, 0x0364, // 0x09, HT, CIRCLE 0xC800, 0x3100, 0x008C, 0x0013, // 0x07, DOT
0xD93F, 0xB9CF, 0xF39D, 0xFC9B, // 0x0A, LF, INVERT CIRCLE 0x37FF, 0xCEFF, 0xFF73, 0xFFEC, // 0x08, INVERT DOT
0xE000, 0xBFEF, 0xE333, 0x1333, // 0x0B, VT, MALE 0x26C0, 0x4630, 0x0C62, 0x0364, // 0x09, CIRCLE
0x666C, 0x6663, 0x8E8C, 0x1713, // 0x0C, FF, FEMALE 0xD93F, 0xB9CF, 0xF39D, 0xFC9B, // 0x0A, INVERT CIRCLE
0xCCCC, 0x0FCF, 0x7FEC, 0x0000, // 0x0D, CR, NOTE 0xE000, 0xBFEF, 0xE333, 0x1333, // 0x0B, MALE
0x6E6E, 0xCFCF, 0x3766, 0x06EC, // 0x0E, SO, DOUBLE NOTE 0x666C, 0x6663, 0x8E8C, 0x1713, // 0x0C, FEMALE
0x7CA9, 0xE359, 0x9AC7, 0x953E, // 0x0F, SI, SUN 0xCCCC, 0x0767, 0x7FEC, 0x0000, // 0x0D, NOTE
0xFF71, 0x7100, 0x017F, 0x0001, // 0x10, DLE, RIGHT TRIANGLE 0x6E6E, 0x6767, 0x3766, 0x0376, // 0x0E, DOUBLE NOTE
0xFC00, 0x7774, 0x000C, 0x0477, // 0x11, DC1, LEFT TRIANGLE 0xCFB8, 0x3FD1, 0x08BF, 0x01DF, // 0x0F, SUN
0x8EC8, 0x1731, 0x8CE8, 0x1371, // 0x12, DC2, ARROW UP DOWN 0xEE60, 0x7100, 0x06EE, 0x0017, // 0x10, RIGHT TRIANGLE
0x6666, 0x6666, 0x0606, 0x0606, // 0x13, DC3, DOUBLE EXCLAMATION 0xE800, 0x7760, 0x008E, 0x0677, // 0x11, LEFT TRIANGLE
0xEBBE, 0xDDDF, 0x0888, 0x0DDD, // 0x14, DC4, PARAGRAPH 0x8EC8, 0x1731, 0x8CE8, 0x1371, // 0x12, ARROW UP DOWN
0x6C6C, 0x31C7, 0xE3C6, 0x1313, // 0x15, NAK, ? 0x6666, 0x3333, 0x0606, 0x0303, // 0x13, DOUBLE EXCLAMATION
0x0000, 0x0000, 0x0EEE, 0x0777, // 0x16, SYN, HALF SQUARE BOTTOM 0xEBBE, 0xDDDF, 0x0888, 0x0DDD, // 0x14, PARAGRAPH
0x8EC8, 0x1731, 0xF8CE, 0xF137, // 0x17, ETB, ARROW UP DOWN UNDERLINED 0x6C6C, 0x6387, 0xE1C6, 0x3636, // 0x15, ?
0x8EC8, 0x1731, 0x0888, 0x0111, // 0x18, CAN, ARROW UP 0x0000, 0x0000, 0x0EE0, 0x0770, // 0x16, HALF SQUARE BOTTOM
0x8888, 0x1111, 0x08CE, 0x0137, // 0x19, EM, ARROW DOWN 0x8EC8, 0x1731, 0xF8CE, 0xF137, // 0x17, ARROW UP DOWN UNDERLINED
0xF080, 0x7310, 0x0080, 0x0013, // 0x1A, SUB, ARROW RIGHT 0xEC80, 0x7310, 0x0888, 0x0111, // 0x18, ARROW UP
0xF6C0, 0x7000, 0x00C6, 0x0000, // 0x1B, ESC, ARROW LEFT 0x8880, 0x1110, 0x08CE, 0x0137, // 0x19, ARROW DOWN
0x3300, 0x0000, 0x00F3, 0x0070, // 0x1C, FS, ? 0xE000, 0x7310, 0x000E, 0x0137, // 0x1A, ARROW RIGHT
0xF640, 0xF620, 0x0046, 0x0026, // 0x1D, GS, ARROW LEFT RIGHT 0xEC80, 0x7000, 0x08CE, 0x0007, // 0x1B, ARROW LEFT
0xEC80, 0x7310, 0x00FF, 0x00FF, // 0x1E, RS, TRIANGLE UP 0x6000, 0x0000, 0x00E6, 0x0070, // 0x1C, ?
0xEFF0, 0x7FF0, 0x008C, 0x0013, // 0x1F, US, TRIANGLE DOWN 0xF640, 0xF620, 0x046F, 0x026F, // 0x1D, ARROW LEFT RIGHT
0xC880, 0x3110, 0x0EEC, 0x0773, // 0x1E, TRIANGLE UP
0xCEE0, 0x3770, 0x088C, 0x0113, // 0x1F, TRIANGLE DOWN
0x0000, 0x0000, 0x0000, 0x0000, // 0x20, SPACE 0x0000, 0x0000, 0x0000, 0x0000, // 0x20, SPACE
0xCEEC, 0x0110, 0x0C0C, 0x0000, // 0x21, ! 0x8CC8, 0x1331, 0x0808, 0x0101, // 0x21, !
0x0666, 0x0333, 0x0000, 0x0000, // 0x22, " 0x0466, 0x0133, 0x0000, 0x0000, // 0x22, "
0x6F66, 0x3733, 0x066F, 0x0337, // 0x23, # 0x6F66, 0x3733, 0x066F, 0x0337, // 0x23, #
0xE3EC, 0x1030, 0x0CF0, 0x0013, // 0x24, $ 0xC6C8, 0x3071, 0x08E0, 0x0136, // 0x24, $
0x8330, 0x1360, 0x036C, 0x0660, // 0x25, % 0x8330, 0x1360, 0x036C, 0x0660, // 0x25, %
0xEC6C, 0x6131, 0x0E3B, 0x0633, // 0x26, & 0xEC6C, 0x6131, 0x0E3B, 0x0633, // 0x26, &
0x0366, 0x0000, 0x0000, 0x0000, // 0x27, ' 0x0C88, 0x0011, 0x0000, 0x0000, // 0x27, '
0x66C8, 0x0001, 0x08C6, 0x0100, // 0x28, ( 0x66C8, 0x0001, 0x08C6, 0x0100, // 0x28, (
0x88C6, 0x1100, 0x06C8, 0x0001, // 0x29, ) 0x88C6, 0x1100, 0x06C8, 0x0001, // 0x29, )
0xFC60, 0xF360, 0x006C, 0x0063, // 0x2A, * 0xFC60, 0x7130, 0x006C, 0x0031, // 0x2A, *
0xFCC0, 0x3000, 0x00CC, 0x0000, // 0x2B, + 0xE880, 0x7110, 0x0088, 0x0011, // 0x2B, +
0x0000, 0x0000, 0x6CC0, 0x0000, // 0x2C, , 0x0000, 0x0000, 0xC880, 0x0110, // 0x2C, ,
0xF000, 0x3000, 0x0000, 0x0000, // 0x2D, - 0xE000, 0x7000, 0x0000, 0x0000, // 0x2D, -
0x0000, 0x0000, 0x0CC0, 0x0000, // 0x2E, . 0x0000, 0x0000, 0x0880, 0x0110, // 0x2E, .
0xC800, 0x0136, 0x0136, 0x0000, // 0x2F, / 0xC800, 0x1376, 0x037E, 0x0000, // 0x2F, /
0xB33E, 0x7763, 0x0E7F, 0x0366, // 0x30, 0 0xE66C, 0x7763, 0x0C6E, 0x0366, // 0x30, 0
0xCCEC, 0x0000, 0x0FCC, 0x0300, // 0x31, 1 0x88E8, 0x1111, 0x0E88, 0x0711, // 0x31, 1
0xC03E, 0x1331, 0x0F36, 0x0330, // 0x32, 2 0x806C, 0x3663, 0x0E6C, 0x0760, // 0x32, 2
0xC03E, 0x1331, 0x0E30, 0x0133, // 0x33, 3 0x806C, 0x3663, 0x0C60, 0x0366, // 0x33, 3
0x36C8, 0x3333, 0x080F, 0x0737, // 0x34, 4 0x36C8, 0x3333, 0x000F, 0x0337, // 0x34, 4
0x0F3F, 0x3103, 0x0E30, 0x0133, // 0x35, 5 0x0E6E, 0x6307, 0x0C60, 0x0366, // 0x35, 5
0xF36C, 0x1001, 0x0E33, 0x0133, // 0x36, 6 0xE6C8, 0x3003, 0x0C66, 0x0366, // 0x36, 6
0x803F, 0x1333, 0x0CCC, 0x0000, // 0x37, 7 0x006E, 0x3667, 0x0CC8, 0x0001, // 0x37, 7
0xE33E, 0x1331, 0x0E33, 0x0133, // 0x38, 8 0xC66C, 0x3663, 0x0C66, 0x0366, // 0x38, 8
0xE33E, 0x3331, 0x0E80, 0x0013, // 0x39, 9 0xC66C, 0x7663, 0x0C00, 0x0136, // 0x39, 9
0x0CC0, 0x0000, 0x0CC0, 0x0000, // 0x3A, : 0x8800, 0x1100, 0x0880, 0x0110, // 0x3A, :
0x0CC0, 0x0000, 0x6CC0, 0x0000, // 0x3B, ; 0x8800, 0x1100, 0xC880, 0x0110, // 0x3B, ;
0x36C8, 0x0001, 0x08C6, 0x0100, // 0x3C, < 0x6C80, 0x0013, 0x008C, 0x0310, // 0x3C, <
0x0F00, 0x0300, 0x00F0, 0x0030, // 0x3D, = 0x0E00, 0x0700, 0x000E, 0x0007, // 0x3D, =
0x08C6, 0x3100, 0x06C8, 0x0001, // 0x3E, > 0x08C6, 0x3100, 0x06C8, 0x0001, // 0x3E, >
0x803E, 0x1331, 0x0C0C, 0x0000, // 0x3F, ? 0x006C, 0x3663, 0x0808, 0x0101, // 0x3F, ?
0xBB3E, 0x7763, 0x0E3B, 0x0107, // 0x40, @ 0x666C, 0x7763, 0x0C66, 0x0307, // 0x40, @
0x33EC, 0x3310, 0x033F, 0x0333, // 0x41, A 0x66C8, 0x6631, 0x066E, 0x0667, // 0x41, A
0xE66F, 0x3663, 0x0F66, 0x0366, // 0x42, B 0xE66F, 0x3663, 0x0F66, 0x0366, // 0x42, B
0x336C, 0x0063, 0x0C63, 0x0360, // 0x43, C 0x336C, 0x0063, 0x0C63, 0x0360, // 0x43, C
0x666F, 0x6631, 0x0F66, 0x0136, // 0x44, D 0x666F, 0x6633, 0x0F66, 0x0336, // 0x44, D
0xE66F, 0x1147, 0x0F66, 0x0741, // 0x45, E 0xE66F, 0x1147, 0x0F66, 0x0741, // 0x45, E
0xE66F, 0x1147, 0x0F66, 0x0001, // 0x46, F 0xE66F, 0x1147, 0x0F66, 0x0001, // 0x46, F
0x336C, 0x0063, 0x0C63, 0x0767, // 0x47, G 0x336C, 0x0063, 0x0C63, 0x0767, // 0x47, G
0xF333, 0x3333, 0x0333, 0x0333, // 0x48, H 0xE666, 0x7666, 0x0666, 0x0666, // 0x48, H
0xCCCE, 0x0001, 0x0ECC, 0x0100, // 0x49, I 0x888C, 0x1113, 0x0C88, 0x0311, // 0x49, I
0x0008, 0x3337, 0x0E33, 0x0133, // 0x4A, J 0x0008, 0x3337, 0x0E33, 0x0133, // 0x4A, J
0xE667, 0x1366, 0x0766, 0x0663, // 0x4B, K 0xE667, 0x1366, 0x0766, 0x0663, // 0x4B, K
0x666F, 0x0000, 0x0F66, 0x0764, // 0x4C, L 0x666F, 0x0000, 0x0F66, 0x0764, // 0x4C, L
0xFF73, 0x7776, 0x033B, 0x0666, // 0x4D, M 0xBF73, 0x6776, 0x0333, 0x0666, // 0x4D, M
0xBF73, 0x7666, 0x0333, 0x0667, // 0x4E, N 0xBF73, 0x7666, 0x0333, 0x0667, // 0x4E, N
0x336C, 0x6631, 0x0C63, 0x0136, // 0x4F, O 0x336C, 0x6631, 0x0C63, 0x0136, // 0x4F, O
0xE66F, 0x3663, 0x0F66, 0x0000, // 0x50, P 0xE66F, 0x3663, 0x0F66, 0x0000, // 0x50, P
0x333E, 0x3331, 0x08EB, 0x0313, // 0x51, Q 0x666C, 0x6663, 0x00C6, 0x0737, // 0x51, Q
0xE66F, 0x3663, 0x0766, 0x0663, // 0x52, R 0xE66F, 0x3663, 0x076E, 0x0631, // 0x52, R
0xE73E, 0x0031, 0x0E38, 0x0133, // 0x53, S 0x8E6C, 0x3063, 0x0C60, 0x0367, // 0x53, S
0xCCDF, 0x0023, 0x0ECC, 0x0100, // 0x54, T 0x88AE, 0x1157, 0x0C88, 0x0311, // 0x54, T
0x3333, 0x3333, 0x0F33, 0x0333, // 0x55, U 0x6666, 0x6666, 0x0E66, 0x0766, // 0x55, U
0x3333, 0x3333, 0x0CE3, 0x0013, // 0x56, V 0x6666, 0x6666, 0x08C6, 0x0136, // 0x56, V
0xB333, 0x6666, 0x037F, 0x0677, // 0x57, W 0xB333, 0x6666, 0x037F, 0x0677, // 0x57, W
0xC633, 0x1366, 0x036C, 0x0631, // 0x58, X 0xC633, 0x1366, 0x0336, 0x0663, // 0x58, X
0xE333, 0x1333, 0x0ECC, 0x0100, // 0x59, Y 0xC666, 0x3666, 0x0C88, 0x0311, // 0x59, Y
0x813F, 0x1367, 0x0F6C, 0x0764, // 0x5A, Z 0xC93F, 0x0137, 0x0F36, 0x0764, // 0x5A, Z
0x666E, 0x0001, 0x0E66, 0x0100, // 0x5B, [ 0xCCCC, 0x0003, 0x0CCC, 0x0300, // 0x5B, [
0x8C63, 0x1000, 0x0000, 0x0463, // 0x5C, 0xCE73, 0x1000, 0x0008, 0x0673, // 0x5C, ANTISHASH
0x888E, 0x1111, 0x0E88, 0x0111, // 0x5D, ] 0x000C, 0x3333, 0x0C00, 0x0333, // 0x5D, ]
0x36C8, 0x6310, 0x0000, 0x0000, // 0x5E, ^ 0x36C8, 0x6310, 0x0000, 0x0000, // 0x5E, ^
0x0000, 0x0000, 0xF000, 0xF000, // 0x5F, _ 0x0000, 0x0000, 0xF000, 0xF000, // 0x5F, _
0x08CC, 0x0100, 0x0000, 0x0000, // 0x60, ` 0x0088, 0x0311, 0x0000, 0x0000, // 0x60, `
0x0E00, 0x3100, 0x0E3E, 0x0633, // 0x61, a 0x0E00, 0x3100, 0x0E3E, 0x0633, // 0x61, a
0xE667, 0x3000, 0x0B66, 0x0366, // 0x62, b 0x6E67, 0x6300, 0x0D66, 0x0366, // 0x62, b
0x3E00, 0x3100, 0x0E33, 0x0130, // 0x63, c 0x6C00, 0x6300, 0x0C66, 0x0360, // 0x63, c
0xE008, 0x3333, 0x0E33, 0x0633, // 0x64, d 0xE008, 0x3333, 0x0E33, 0x0633, // 0x64, d
0x3E00, 0x3100, 0x0E3F, 0x0103, // 0x65, e 0x6C00, 0x6300, 0x0C6E, 0x0307, // 0x65, e
0xF66C, 0x0031, 0x0F66, 0x0000, // 0x66, f 0xECC8, 0x1063, 0x0ECC, 0x0100, // 0x66, f
0x3E00, 0x3600, 0xF0E3, 0x1333, // 0x67, g 0x3E00, 0x3600, 0xF0E3, 0x1333, // 0x67, g
0xE667, 0x6300, 0x0766, 0x0666, // 0x68, h 0xE667, 0x6300, 0x0766, 0x0666, // 0x68, h
0xCE0C, 0x0000, 0x0ECC, 0x0100, // 0x69, i 0x8C08, 0x1101, 0x0C88, 0x0311, // 0x69, i
0x0000, 0x3303, 0xE330, 0x1333, // 0x6A, j 0x0C00, 0x3303, 0xC600, 0x1333, // 0x6A, j
0x6667, 0x3600, 0x076E, 0x0631, // 0x6B, k 0x6667, 0x3600, 0x076E, 0x0631, // 0x6B, k
0xCCCE, 0x0000, 0x0ECC, 0x0100, // 0x6C, l 0x888C, 0x1111, 0x0C88, 0x0311, // 0x6C, l
0xF300, 0x7300, 0x03BF, 0x0667, // 0x6D, m 0xF700, 0x7300, 0x033B, 0x0666, // 0x6D, m
0x3F00, 0x3100, 0x0333, 0x0333, // 0x6E, n 0x6E00, 0x6300, 0x0666, 0x0666, // 0x6E, n
0x3E00, 0x3100, 0x0E33, 0x0133, // 0x6F, o 0x3E00, 0x3100, 0x0E33, 0x0133, // 0x6F, o
0x6B00, 0x6300, 0xF6E6, 0x0036, // 0x70, p 0x6B00, 0x6300, 0xF6E6, 0x0036, // 0x70, p
0x3E00, 0x3600, 0x80E3, 0x7333, // 0x71, q 0x3E00, 0x3600, 0x80E3, 0x7333, // 0x71, q
0xEB00, 0x6300, 0x0F66, 0x0006, // 0x72, r 0xC600, 0x6300, 0x0ECC, 0x0106, // 0x72, r
0x3E00, 0x0300, 0x0F0E, 0x0131, // 0x73, s 0x6C00, 0x0700, 0x0E0C, 0x0363, // 0x73, s
0xCEC8, 0x0300, 0x08CC, 0x0120, // 0x74, t 0xCEC8, 0x0300, 0x08CC, 0x0120, // 0x74, t
0x3300, 0x3300, 0x0E33, 0x0633, // 0x75, u 0x3300, 0x3300, 0x0E33, 0x0633, // 0x75, u
0x3300, 0x3300, 0x0CE3, 0x0013, // 0x76, v 0x6600, 0x6600, 0x08C6, 0x0136, // 0x76, v
0xB300, 0x6600, 0x06FF, 0x0377, // 0x77, w 0x3300, 0x6600, 0x06FB, 0x0376, // 0x77, w
0x6300, 0x3600, 0x036C, 0x0631, // 0x78, x 0x6300, 0x3600, 0x036C, 0x0631, // 0x78, x
0x3300, 0x3300, 0xF0E3, 0x1333, // 0x79, y 0x6600, 0x6600, 0xE0C6, 0x3676, // 0x79, y
0x9F00, 0x1300, 0x0F6C, 0x0320, // 0x7A, z 0x2E00, 0x3700, 0x0EC8, 0x0741, // 0x7A, z
0x7CC8, 0x0003, 0x08CC, 0x0300, // 0x7B, { 0x6CC8, 0x0003, 0x08CC, 0x0300, // 0x7B, {
0x0888, 0x0111, 0x0888, 0x0111, // 0x7C, | 0x0888, 0x0111, 0x0888, 0x0111, // 0x7C, |
0x8CC7, 0x3000, 0x07CC, 0x0000, // 0x7D, } 0x088E, 0x3110, 0x0E88, 0x0011, // 0x7D, }
0x00BE, 0x0036, 0x0000, 0x0000, // 0x7E, ~ 0x00BE, 0x0036, 0x0000, 0x0000, // 0x7E, ~
0x6C80, 0x3100, 0x0F33, 0x0766, // 0x7F, DEL, HOUSE 0xC800, 0x3100, 0x0E66, 0x0766, // 0x7F, HOUSE
0x333E, 0x3031, 0xE08E, 0x1311, // 0x80, Ç 0x333E, 0x0031, 0x6CE3, 0x0013, // 0x80, Ç
0x3030, 0x3030, 0x0E33, 0x0733, // 0x81, ü 0x3030, 0x3030, 0x0E33, 0x0733, // 0x81, ü
0x3E08, 0x3103, 0x0E3F, 0x0103, // 0x82, é 0x6C80, 0x6313, 0x0C6E, 0x0307, // 0x82, é
0x0C3E, 0x63C7, 0x0C6C, 0x0F67, // 0x83, â 0x0C3E, 0x63C7, 0x0C6C, 0x0F67, // 0x83, â
0x0E03, 0x3103, 0x0E3E, 0x0733, // 0x84, ä 0x0E03, 0x3103, 0x0E3E, 0x0733, // 0x84, ä
0x0E07, 0x3100, 0x0E3E, 0x0733, // 0x85, à 0x0EC6, 0x3100, 0x0E3E, 0x0733, // 0x85, à
0x0ECC, 0x3100, 0x0E3E, 0x0733, // 0x86, å 0x0C6C, 0x6363, 0x0C6C, 0x0F67, // 0x86, å
0x3E00, 0x0100, 0xC0E3, 0x1310, // 0x87, ç 0x66C0, 0x0630, 0xC8C6, 0x0136, // 0x87, ç
0x6C3E, 0x63C7, 0x0C6E, 0x0307, // 0x88, ê 0x6C3E, 0x63C7, 0x0C6E, 0x0307, // 0x88, ê
0x3E03, 0x3103, 0x0E3F, 0x0103, // 0x89, ë 0x6C06, 0x6306, 0x0C6E, 0x0307, // 0x89, ë
0x3E07, 0x3100, 0x0E3F, 0x0103, // 0x8A, è 0x6C8C, 0x6310, 0x0C6E, 0x0307, // 0x8A, è
0xCE03, 0x0003, 0x0ECC, 0x0100, // 0x8B, ï 0x8C06, 0x1106, 0x0C88, 0x0311, // 0x8B, ï
0x8C3E, 0x1163, 0x0C88, 0x0311, // 0x8C, î 0x8C3E, 0x1163, 0x0C88, 0x0311, // 0x8C, î
0xCE07, 0x0000, 0x0ECC, 0x0100, // 0x8D, ì 0x8C8C, 0x1110, 0x0C88, 0x0311, // 0x8D, ì
0x36C3, 0x6316, 0x033F, 0x0667, // 0x8E, Ä 0x6C86, 0x6316, 0x06E6, 0x0676, // 0x8E, Ä
0xE0CC, 0x1000, 0x03F3, 0x0333, // 0x8F, Å 0xC848, 0x3121, 0x06E6, 0x0676, // 0x8F, Å
0x6F08, 0x0303, 0x0F6E, 0x0301, // 0x90, É 0x6FC8, 0x0301, 0x0F6E, 0x0301, // 0x90, É
0x0E00, 0x3F00, 0x0E3E, 0x0F3F, // 0x91, æ 0x0E00, 0x3700, 0x0E3E, 0x0737, // 0x91, æ
0xF36C, 0x7337, 0x0333, 0x0733, // 0x92, Æ 0xF36C, 0x7337, 0x0333, 0x0733, // 0x92, Æ
0xE03E, 0x1031, 0x0E33, 0x0133, // 0x93, ô 0xC06C, 0x3063, 0x0C66, 0x0366, // 0x93, ô
0xE030, 0x1030, 0x0E33, 0x0133, // 0x94, ö 0xC060, 0x3060, 0x0C66, 0x0366, // 0x94, ö
0xE070, 0x1000, 0x0E33, 0x0133, // 0x95, ò 0xC08C, 0x3010, 0x0C66, 0x0366, // 0x95, ò
0x303E, 0x3031, 0x0E33, 0x0733, // 0x96, û 0x303E, 0x3031, 0x0E33, 0x0733, // 0x96, û
0x3070, 0x3000, 0x0E33, 0x0733, // 0x97, ù 0x30C6, 0x3000, 0x0E33, 0x0733, // 0x97, ù
0x3030, 0x3030, 0xF0E3, 0x1333, // 0x98, ÿ 0x6060, 0x6060, 0xE0E6, 0x3676, // 0x98, ÿ
0x6C83, 0x631C, 0x08C6, 0x0136, // 0x99, Ö 0x3E03, 0x6306, 0x0E33, 0x0366, // 0x99, Ö
0x3303, 0x3303, 0x0E33, 0x0133, // 0x9A, Ü 0x6606, 0x6606, 0x0C66, 0x0366, // 0x9A, Ü
0x3E88, 0x0711, 0x88E3, 0x1170, // 0x9B, ¢ 0x3E88, 0x0711, 0x88E3, 0x1170, // 0x9B, ¢
0xF66C, 0x0231, 0x0F76, 0x0360, // 0x9C, £ 0xF66C, 0x0231, 0x0F76, 0x0360, // 0x9C, £
0xFE33, 0x3133, 0xCCFC, 0x0030, // 0x9D, ¥ 0xEC66, 0x7366, 0x88E8, 0x1171, // 0x9D, ¥
0xF33F, 0x5331, 0x3333, 0xE6F6, // 0x9E, ₧ 0xE22E, 0x1221, 0x02A2, 0x0713, // 0x9E, ₧
0xC880, 0x31D7, 0xEB88, 0x0111, // 0x9F, ƒ 0xE880, 0x71D7, 0x0EB8, 0x0011, // 0x9F, ƒ
0x0E08, 0x3103, 0x0E3E, 0x0733, // 0xA0, á 0x0EC8, 0x3101, 0x0E3E, 0x0733, // 0xA0, á
0xCE0C, 0x0001, 0x0ECC, 0x0100, // 0xA1, í 0x8C80, 0x1113, 0x0C88, 0x0311, // 0xA1, í
0xE080, 0x1030, 0x0E33, 0x0133, // 0xA2, ó 0xC000, 0x3036, 0x0C66, 0x0366, // 0xA2, ó
0x3080, 0x3030, 0x0E33, 0x0733, // 0xA3, ú 0x3080, 0x3013, 0x0E33, 0x0733, // 0xA3, ú
0xF0F0, 0x1010, 0x0333, 0x0333, // 0xA4, ñ 0xF0BE, 0x1036, 0x0333, 0x0333, // 0xA4, ñ
0x730F, 0x3303, 0x03BF, 0x0333, // 0xA5, Ñ 0x70BE, 0x3036, 0x03BF, 0x0333, // 0xA5, Ñ
0xC66C, 0x7333, 0x00E0, 0x0070, // 0xA6, ª 0xC66C, 0x7333, 0x00E0, 0x0070, // 0xA6, ª
0xC66C, 0x1331, 0x00E0, 0x0030, // 0xA7, º 0xC66C, 0x3663, 0x00E0, 0x0070, // 0xA7, º
0x6C0C, 0x0000, 0x0E33, 0x0130, // 0xA8, ¿ 0xC808, 0x0101, 0x0C66, 0x0360, // 0xA8, ¿
0xF000, 0x3000, 0x0033, 0x0000, // 0xA9, ⌐ 0xE000, 0x7000, 0x0066, 0x0000, // 0xA9, ⌐
0xF000, 0x3000, 0x0000, 0x0033, // 0xAA, ¬ 0xE000, 0x7000, 0x0000, 0x0066, // 0xAA, ¬
0xB333, 0x736C, 0x036C, 0xF36C, // 0xAB, ½ 0xB333, 0x736C, 0x036C, 0xF36C, // 0xAB, ½
0xB333, 0xD36C, 0x036C, 0xCFFE, // 0xAC, ¼ 0xB333, 0xD36C, 0x036C, 0xCFFE, // 0xAC, ¼
0x8088, 0x1011, 0x0888, 0x0111, // 0xAD, ¡ 0x8080, 0x1010, 0x8CC8, 0x1331, // 0xAD, ¡
0x36C0, 0x36C0, 0x00C6, 0x00C6, // 0xAE, « 0x36C0, 0x36C0, 0x00C6, 0x00C6, // 0xAE, «
0xC630, 0xC630, 0x0036, 0x0036, // 0xAF, » 0xC630, 0xC630, 0x0036, 0x0036, // 0xAF, »
0x1414, 0x1414, 0x1414, 0x1414, // 0xB0, ░ 0x8282, 0x8282, 0x8282, 0x8282, // 0xB0, ░
0x5A5A, 0x5A5A, 0x5A5A, 0x5A5A, // 0xB1, ▒ 0x5A5A, 0x5A5A, 0x5A5A, 0x5A5A, // 0xB1, ▒
0xBEBE, 0xBEBE, 0xBEBE, 0xBEBE, // 0xB2, ▓ 0xEBEB, 0xEBEB, 0xEBEB, 0xEBEB, // 0xB2, ▓
0x8888, 0x1111, 0x8888, 0x1111, // 0xB3, │ 0x8888, 0x1111, 0x8888, 0x1111, // 0xB3, │
0x8888, 0x1111, 0x888F, 0x1111, // 0xB4, ┤ 0xF888, 0x1111, 0x888F, 0x1111, // 0xB4, ┤
0x8F88, 0x1111, 0x888F, 0x1111, // 0xB5, ╡ 0x8FF8, 0x1111, 0x8FF8, 0x1111, // 0xB5, ╡
0xCCCC, 0x6666, 0xCCCF, 0x6666, // 0xB6, ╢ 0x7666, 0x6666, 0x6667, 0x6666, // 0xB6, ╢
0x0000, 0x0000, 0xCCCF, 0x6667, // 0xB7, ╖ 0xF000, 0x7000, 0x666F, 0x6667, // 0xB7, ╖
0x8F00, 0x1100, 0x888F, 0x1111, // 0xB8, ╕ 0x8FF0, 0x1110, 0x8FF8, 0x1111, // 0xB8, ╕
0x0FCC, 0x6666, 0xCCCF, 0x6666, // 0xB9, ╣ 0x0776, 0x6666, 0x6770, 0x6666, // 0xB9, ╣
0xCCCC, 0x6666, 0xCCCC, 0x6666, // 0xBA, ║ 0x6666, 0x6666, 0x6666, 0x6666, // 0xBA, ║
0x0F00, 0x6700, 0xCCCF, 0x6666, // 0xBB, ╗ 0x0FF0, 0x6770, 0x6770, 0x6666, // 0xBB, ╗
0x0FCC, 0x6666, 0x000F, 0x0007, // 0xBC, ╝ 0x0776, 0x6666, 0x0FF0, 0x0776, // 0xBC, ╝
0xCCCC, 0x6666, 0x000F, 0x0007, // 0xBD, ╜ 0xF666, 0x7666, 0x000F, 0x0007, // 0xBD, ╜
0x8F88, 0x1111, 0x000F, 0x0001, // 0xBE, ╛ 0x8FF8, 0x1111, 0x0FF8, 0x0111, // 0xBE, ╛
0x0000, 0x0000, 0x888F, 0x1111, // 0xBF, ┐ 0xF000, 0x1000, 0x888F, 0x1111, // 0xBF, ┐
0x8888, 0x1111, 0x0008, 0x000F, // 0xC0, └ 0x8888, 0xF111, 0x0008, 0x000F, // 0xC0, └
0x8888, 0x1111, 0x000F, 0x000F, // 0xC1, ┴ 0xF888, 0xF111, 0x000F, 0x000F, // 0xC1, ┴
0x0000, 0x0000, 0x888F, 0x111F, // 0xC2, ┬ 0xF000, 0xF000, 0x888F, 0x111F, // 0xC2, ┬
0x8888, 0x1111, 0x8888, 0x111F, // 0xC3, ├ 0x8888, 0xF111, 0x8888, 0x111F, // 0xC3, ├
0x0000, 0x0000, 0x000F, 0x000F, // 0xC4, ─ 0xF000, 0xF000, 0x000F, 0x000F, // 0xC4, ─
0x8888, 0x1111, 0x888F, 0x111F, // 0xC5, ┼ 0xF888, 0xF111, 0x888F, 0x111F, // 0xC5, ┼
0x8888, 0x1F11, 0x8888, 0x111F, // 0xC6, ╞ 0x8888, 0x1FF1, 0x8888, 0x1FF1, // 0xC6, ╞
0xCCCC, 0x6666, 0xCCCC, 0x666E, // 0xC7, ╟ 0x6666, 0xE666, 0x6666, 0x666E, // 0xC7, ╟
0xCCCC, 0x0E66, 0x000C, 0x000F, // 0xC8, ╚ 0x6666, 0x0EE6, 0x0EE6, 0x0FF0, // 0xC8, ╚
0xCC00, 0x0F00, 0xCCCC, 0x666E, // 0xC9, ╔ 0x6EE0, 0x0FF0, 0x6666, 0x6EE0, // 0xC9, ╔
0x0FCC, 0x0E66, 0x000F, 0x000F, // 0xCA, ╩ 0x0776, 0x0EE6, 0x0FF0, 0x0FF0, // 0xCA, ╩
0x0F00, 0x0F00, 0xCCCF, 0x666E, // 0xCB, ╦ 0x0FF0, 0x0FF0, 0x6770, 0x6EE0, // 0xCB, ╦
0xCCCC, 0x0E66, 0xCCCC, 0x666E, // 0xCC, ╠ 0x6666, 0x0EE6, 0x6666, 0x6EE0, // 0xCC, ╠
0x0F00, 0x0F00, 0x000F, 0x000F, // 0xCD, ═ 0x0FF0, 0x0FF0, 0x0FF0, 0x0FF0, // 0xCD, ═
0x0FCC, 0x0E66, 0xCCCF, 0x666E, // 0xCE, ╬ 0x0776, 0x0EE6, 0x6770, 0x6EE0, // 0xCE, ╬
0x0F88, 0x0F11, 0x000F, 0x000F, // 0xCF, ╧ 0x0FF8, 0x0FF1, 0x0FF0, 0x0FF0, // 0xCF, ╧
0xCCCC, 0x6666, 0x000F, 0x000F, // 0xD0, ╨ 0xF666, 0xF666, 0x000F, 0x000F, // 0xD0, ╨
0x0F00, 0x0F00, 0x888F, 0x111F, // 0xD1, ╤ 0x0FF0, 0x0FF0, 0x8FF0, 0x1FF0, // 0xD1, ╤
0x0000, 0x0000, 0xCCCF, 0x666F, // 0xD2, ╥ 0x0000, 0x0000, 0x6FF0, 0x6FF0, // 0xD2, ╥
0xCCCC, 0x6666, 0x000C, 0x000F, // 0xD3, ╙ 0xE666, 0xF666, 0x000E, 0x000F, // 0xD3, ╙
0x8888, 0x1F11, 0x0008, 0x000F, // 0xD4, ╘ 0x8888, 0x1FF1, 0x0888, 0x0FF1, // 0xD4, ╘
0x8800, 0x1F00, 0x8888, 0x111F, // 0xD5, ╒ 0x8880, 0x1FF0, 0x8888, 0x1FF1, // 0xD5, ╒
0x0000, 0x0000, 0xCCCC, 0x666F, // 0xD6, ╓ 0xE000, 0xF000, 0x666E, 0x666F, // 0xD6, ╓
0xCCCC, 0x6666, 0xCCCF, 0x666F, // 0xD7, ╫ 0xF666, 0xF666, 0x666F, 0x666F, // 0xD7, ╫
0x8F88, 0x1F11, 0x888F, 0x111F, // 0xD8, ╪ 0x8FF8, 0x1FF1, 0x8FF8, 0x1FF1, // 0xD8, ╪
0x8888, 0x1111, 0x000F, 0x0001, // 0xD9, ┘ 0xF888, 0x1111, 0x000F, 0x0001, // 0xD9, ┘
0x0000, 0x0000, 0x8888, 0x111F, // 0xDA, ┌ 0x8000, 0xF000, 0x8888, 0x111F, // 0xDA, ┌
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0xDB, █ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0xDB, █
0x0000, 0x0000, 0xFFFF, 0xFFFF, // 0xDC, ▄ 0x0000, 0x0000, 0xFFFF, 0xFFFF, // 0xDC, ▄
0xFFFF, 0x0000, 0xFFFF, 0x0000, // 0xDD, ▌ 0xFFFF, 0x0000, 0xFFFF, 0x0000, // 0xDD, ▌
0x0000, 0xFFFF, 0x0000, 0xFFFF, // 0xDE, ▐ 0x0000, 0xFFFF, 0x0000, 0xFFFF, // 0xDE, ▐
0xFFFF, 0xFFFF, 0x0000, 0x0000, // 0xDF, ▀ 0xFFFF, 0xFFFF, 0x0000, 0x0000, // 0xDF, ▀
0xBE00, 0x3600, 0x0EB3, 0x0631, // 0xE0, α 0xBE00, 0x3600, 0x00EB, 0x0063, // 0xE0, α
0xF3E0, 0x1310, 0x33F3, 0x0013, // 0xE1, ß 0xE6C0, 0x3630, 0x0CE6, 0x0036, // 0xE1, ß
0x33F0, 0x0330, 0x0333, 0x0000, // 0xE2, Γ 0x66E0, 0x0670, 0x0066, 0x0000, // 0xE2, Γ
0x66F0, 0x3370, 0x0666, 0x0333, // 0xE3, π 0x66F0, 0x3370, 0x0666, 0x0633, // 0xE3, π
0xC63F, 0x0033, 0x0F36, 0x0330, // 0xE4, Σ 0xC6E0, 0x0470, 0x0E6C, 0x0740, // 0xE4, Σ
0xBE00, 0x1700, 0x0EBB, 0x0011, // 0xE5, σ 0x6C00, 0x3700, 0x0C66, 0x0133, // 0xE5, σ
0x6660, 0x6660, 0x36E6, 0x0036, // 0xE6, µ 0x6600, 0x6600, 0x36E6, 0x0036, // 0xE6, µ
0x8BE0, 0x1360, 0x0888, 0x0111, // 0xE7, τ 0xBE00, 0x3600, 0x0888, 0x0111, // 0xE7, τ
0x3ECF, 0x3103, 0xFCE3, 0x3013, // 0xE8, Φ 0x6C8E, 0x6317, 0x0E8C, 0x0713, // 0xE8, Φ
0xF36C, 0x7631, 0x0C63, 0x0136, // 0xE9, Θ 0xE66C, 0x3331, 0x0C66, 0x0133, // 0xE9, Θ
0x336C, 0x6631, 0x0766, 0x0733, // 0xEA, Ω 0x336C, 0x6631, 0x0766, 0x0733, // 0xEA, Ω
0xE8C8, 0x3103, 0x0E33, 0x0133, // 0xEB, δ 0xC8C8, 0x3103, 0x0C66, 0x0366, // 0xEB, δ
0xBE00, 0xD700, 0x00EB, 0x007D, // 0xEC, ∞ 0xBE00, 0x6300, 0x00EB, 0x0036, // 0xEC, ∞
0xBE00, 0xD736, 0x36EB, 0x007D, // 0xED, φ 0xBE80, 0x6313, 0x36EB, 0x0036, // 0xED, φ
0xF36C, 0x1001, 0x0C63, 0x0100, // 0xEE, ε 0xE6C8, 0x3003, 0x08C6, 0x0300, // 0xEE, ε
0x333E, 0x3331, 0x0333, 0x0333, // 0xEF, ∩ 0x66C0, 0x6630, 0x0666, 0x0666, // 0xEF, ∩
0xF0F0, 0x3030, 0x00F0, 0x0030, // 0xF0, ≡ 0xE0E0, 0x7070, 0x00E0, 0x0070, // 0xF0, ≡
0xCFCC, 0x0300, 0x0F0C, 0x0300, // 0xF1, ± 0xCFCC, 0x0300, 0x0F0C, 0x0300, // 0xF1, ±
0xC8C6, 0x0100, 0x0F06, 0x0300, // 0xF2, ≥ 0xC8C6, 0x0100, 0x0F06, 0x0300, // 0xF2, ≥
0xC6C8, 0x0001, 0x0F08, 0x0301, // 0xF3, ≤ 0xC6C8, 0x0001, 0x0F08, 0x0301, // 0xF3, ≤
0x8880, 0x1DD7, 0x8888, 0x1111, // 0xF4, ⌠ 0x66C0, 0x3310, 0x6666, 0x0000, // 0xF4, ⌠
0x8888, 0x1111, 0xEBB8, 0x0111, // 0xF5, ⌡ 0x0000, 0x3333, 0x0C66, 0x0133, // 0xF5, ⌡
0xF0CC, 0x3000, 0x0CC0, 0x0000, // 0xF6, ÷ 0xE088, 0x7011, 0x0880, 0x0110, // 0xF6, ÷
0x0BE0, 0x0360, 0x00BE, 0x0036, // 0xF7, ≈ 0x0BE0, 0x0360, 0x00BE, 0x0036, // 0xF7, ≈
0xC66C, 0x1331, 0x0000, 0x0000, // 0xF8, ° 0xC66C, 0x1331, 0x0000, 0x0000, // 0xF8, °
0x8000, 0x1000, 0x0008, 0x0001, // 0xF9, ∙ 0x8000, 0x1000, 0x0008, 0x0001, // 0xF9, ∙
0x0000, 0x0000, 0x0008, 0x0001, // 0xFA, · 0x0000, 0x0000, 0x0008, 0x0001, // 0xFA, ·
0x0000, 0x333F, 0x8C67, 0x3333, // 0xFB, √ 0x2000, 0x1117, 0x08C6, 0x0111, // 0xFB, √
0x666E, 0x3331, 0x0006, 0x0003, // 0xFC, ⁿ 0x666E, 0x3331, 0x0000, 0x0000, // 0xFC, ⁿ
0x6C8E, 0x0010, 0x000E, 0x0001, // 0xFD, ² 0xC80C, 0x3131, 0x0000, 0x0000, // 0xFD, ²
0xCC00, 0x3300, 0x00CC, 0x0033, // 0xFE, ■ 0xEEE0, 0x7770, 0x0EEE, 0x0777, // 0xFE, ■
0x0000, 0x0000, 0x0000, 0x0000 // 0xFF, NBSP 0x22E0, 0x4470, 0x0E22, 0x0744 // 0xFF, NBSP
); );
const int charsets[] = int[18]( #define CP437_SETS 9
0x30, 10, // NUMBERS
0x41, 26, // UPPERCASE LETTERS const int cp437_sets[] = int[18](
0x61, 26, // LOWERCASE LETTERS 0x30, 10, // NUMBERS
0x01, 15, // SYMBOLS 0x41, 26, // UPPERCASE LETTERS
0x18, 4, // ARROWS 0x61, 26, // LOWERCASE LETTERS
0xB3, 40, // BARS 0x01, 15, // SYMBOLS
0xE0, 16, // GREEK 0x18, 4, // ARROWS
0x80, 28, // ACCENTS 0xB3, 40, // BARS
0xB0, 3 // SHADES 0xE0, 16, // GREEK
0x80, 28, // ACCENTS
0xB0, 3 // SHADES
); );
#define CHARSETS 8 bool cp437(vec2 pos, int code)
const int hex_chars[] = int[16](
0x30,
0x31,
0x32,
0x33,
0x34,
0x35,
0x36,
0x37,
0x38,
0x39,
0x41,
0x42,
0x43,
0x44,
0x45,
0x46
);
bool chr(vec2 pos, int code)
{ {
if (pos.x < .0 || pos.y < .0 || pos.x >= 1. || pos.y >= 1.) { if (pos.x < .0 || pos.y < .0 || pos.x >= 1. || pos.y >= 1. || code < 0 || code >= CP437_COUNT) {
return false; return false;
} }
ivec2 pos2 = ivec2(pos.x * 8., (1 - pos.y) * 8.); ivec2 pos2 = ivec2(pos.x * 8., (1 - pos.y) * 8.);
ivec2 subpos = pos2 % 4; ivec2 subpos = pos2 % 4;
int v = int(pow(2., subpos.y * 4. + subpos.x)); int v = int(pow(2., subpos.y * 4. + subpos.x));
int d = int(pos2.y * .25) * 2 + int(pos2.x * .25); int d = int(pos2.y * .25) * 2 + int(pos2.x * .25);
return (cp437[code * 4 + d] & v) > 0; return (cp437_glyphs[code * 4 + d] & v) > 0;
} }
float char_at(vec2 uv, vec2 pos, int code) float cp437_at(vec2 uv, vec2 pos, int code)
{ {
return chr(uv - pos, code) ? 1. : 0.; return cp437(uv - pos, code) ? 1. : 0.;
} }
float write_5(vec2 uv, vec2 pos, int str[5]) int cp437_set_glyph(int set, float v)
{ {
float d = 0.; if (v < .0 || v >= 1. || set < 0. || set >= CP437_SETS) {
int i; return 0;
for (i = 0; i < 5; i++) {
if (str[i] == 0) {
return d;
}
d += char_at(uv, pos + vec2(i, 0.), str[i]);
} }
return cp437_sets[set * 2] + int(v * cp437_sets[set * 2 + 1]);
return d;
} }
float write_10(vec2 uv, vec2 pos, int str[10]) #endif /* INC_CP437 */
{
float d = 0.;
int i;
for (i = 0; i < 10; i++) {
if (str[i] == 0) {
return d;
}
d += char_at(uv, pos + vec2(i, 0.), str[i]);
}
return d;
}
float write_20(vec2 uv, vec2 pos, int str[20])
{
float d = 0.;
int i;
for (i = 0; i < 20; i++) {
if (str[i] == 0) {
return d;
}
d += char_at(uv, pos + vec2(i, 0.), str[i]);
}
return d;
}
float write_int(vec2 uv, vec2 pos, int value, int magnitude)
{
value = max(0, value);
int i;
int m = 1;
float d = 0.;
for (i = 0; i < magnitude; i++) {
if (i == 0 || value >= m) {
d += char_at(uv, pos + vec2(magnitude - i - 1, 0.), int(0x30 + (value % (m * 10)) / m));
m *= 10;
}
}
return d;
}
float write_int_left(vec2 uv, vec2 pos, int value, int magnitude)
{
value = max(0, value);
int i;
int m = 1;
float d = 0.;
pos.x -= magnitude;
for (i = 0; i < magnitude; i++) {
if (i == 0 || value >= m) {
pos.x += 1.;
m *= 10;
}
}
return write_int(uv, pos, value, magnitude);
}
float write_sentence(vec2 uv, vec2 pos, int n)
{
float d = 0.;
int i;
for (i = 0; i < SENTENCE_MAX_LENGTH; i++) {
if (sentences[n * SENTENCE_MAX_LENGTH + i] == 0) {
return d;
}
d += char_at(uv, pos + vec2(i, 0.), sentences[n * SENTENCE_MAX_LENGTH + i]);
}
return d;
}
#endif
+9 -9
View File
@@ -1,7 +1,7 @@
#include inc_magic.glsl #include inc_magic.glsl
#include inc_functions.glsl #include inc_functions.glsl
#include inc_yuyv.glsl #include inc_yuyv.glsl
#include inc_cp437.glsl #include inc_write.glsl
#ifndef INC_DEBUG #ifndef INC_DEBUG
#define INC_DEBUG #define INC_DEBUG
@@ -146,17 +146,17 @@ vec4 debug(vec2 vUV)
} }
// show selected src/fx // show selected src/fx
f += char_at(uv2, vec2(-5.4, 1.45), hex_chars[selected_srca]); f += cp437_at(uv2, vec2(-5.4, 1.45), hex_chars[selected_srca]);
f += random_srca ? circle(uv2, vec2(-4.25, 2.7), .1) : 0.; f += random_srca ? circle(uv2, vec2(-4.25, 2.7), .1) : 0.;
f += char_at(uv2, vec2(-5.4, -2.55), hex_chars[selected_srcb]); f += cp437_at(uv2, vec2(-5.4, -2.55), hex_chars[selected_srcb]);
f += random_srcb ? circle(uv2, vec2(-4.25, -1.3), .1) : 0.; f += random_srcb ? circle(uv2, vec2(-4.25, -1.3), .1) : 0.;
f += char_at(uv2, vec2(-2.4, 1.45), hex_chars[selected_fxa]); f += cp437_at(uv2, vec2(-2.4, 1.45), hex_chars[selected_fxa]);
f += fxa_invert ? rect(uv2, vec2(-2., 2.7), vec2(.5, .05)) : 0.; f += fxa_invert ? rect(uv2, vec2(-2., 2.7), vec2(.5, .05)) : 0.;
f += random_fxa ? circle(uv2, vec2(-1.25, 2.7), .1) : 0.; f += random_fxa ? circle(uv2, vec2(-1.25, 2.7), .1) : 0.;
f += char_at(uv2, vec2(-2.4, -2.55), hex_chars[selected_fxb]); f += cp437_at(uv2, vec2(-2.4, -2.55), hex_chars[selected_fxb]);
f += fxb_invert ? rect(uv2, vec2(-2., -1.3), vec2(.5, .05)) : 0.; f += fxb_invert ? rect(uv2, vec2(-2., -1.3), vec2(.5, .05)) : 0.;
f += random_fxb ? circle(uv2, vec2(-1.25, -1.3), .1) : 0.; f += random_fxb ? circle(uv2, vec2(-1.25, -1.3), .1) : 0.;
f += char_at(uv2, vec2(4.6, -.55), hex_chars[selected_mfx]); f += cp437_at(uv2, vec2(4.6, -.55), hex_chars[selected_mfx]);
f += mfx_invert ? rect(uv2, vec2(5., .7), vec2(.5, .05)) : 0.; f += mfx_invert ? rect(uv2, vec2(5., .7), vec2(.5, .05)) : 0.;
f += random_mfx ? circle(uv2, vec2(5.75, .7), .1) : 0.; f += random_mfx ? circle(uv2, vec2(5.75, .7), .1) : 0.;
@@ -178,8 +178,8 @@ vec4 debug(vec2 vUV)
f += write_5(uv3 * .75, vec2(-11.6, -1.8), textSRC); f += write_5(uv3 * .75, vec2(-11.6, -1.8), textSRC);
f += write_5(uv3 * .75, vec2(-4.2, -1.8), textFX); f += write_5(uv3 * .75, vec2(-4.2, -1.8), textFX);
f += char_at(uv3 * .5, vec2(-11.5, 3.5), 0x41); f += cp437_at(uv3 * .5, vec2(-11.5, 3.5), 0x41);
f += char_at(uv3 * .5, vec2(-11.5, -6.), 0x42); f += cp437_at(uv3 * .5, vec2(-11.5, -6.), 0x42);
if (iDemo < 1 && (iInputFormat1 == YUYV_FOURCC || iInputFormat2 == YUYV_FOURCC)) { if (iDemo < 1 && (iInputFormat1 == YUYV_FOURCC || iInputFormat2 == YUYV_FOURCC)) {
f += write_5(uv3 * .75, vec2(-19.7, -1.8), textIN); f += write_5(uv3 * .75, vec2(-19.7, -1.8), textIN);
} }
@@ -221,7 +221,7 @@ vec4 debug(vec2 vUV)
f = mix(f, 1 - f, rect(uv2, vec2(5., -.9 + .9 * mfx_value), vec2(.9, .9 * mfx_value))); f = mix(f, 1 - f, rect(uv2, vec2(5., -.9 + .9 * mfx_value), vec2(.9, .9 * mfx_value)));
// show mix // show mix
f += char_at(uv2, vec2(1.55, -.6), mix_type ? 0x4B : 0x4D); f += cp437_at(uv2, vec2(1.55, -.6), mix_type ? 0x4B : 0x4D);
f = mix(f, 1 - f, rect(uv2, vec2(2., -.9 + .9 * mix_value), vec2(.9, .9 * mix_value))); f = mix(f, 1 - f, rect(uv2, vec2(2., -.9 + .9 * mix_value), vec2(.9, .9 * mix_value)));
// show debug info // show debug info
+52
View File
@@ -59,6 +59,11 @@ vec3 cmod(vec3 x, float k) {
return mod(x + k * .5, k) - k * .5; return mod(x + k * .5, k) - k * .5;
} }
float smoothstep_transition(float a, float b, float x)
{
return a + smoothstep(0., 1., x) * (b - a);
}
// COLORS // COLORS
vec3 col(float x) { vec3 col(float x) {
@@ -173,6 +178,53 @@ float noise_f(vec2 n, int f)
return o; return o;
} }
vec2 perlin_gradient(vec2 p, int seed)
{
vec2 v = normalize(
vec2(
rand(p.x * 12.34 + p.y * 56.78 + seed) * 2.0 - 1.0,
rand(p.x * 56.78 + p.y * 12.34 + seed) * 2.0 - 1.0
)
);
if (length(v) == 0.) {
return vec2(1, 0);
}
return v;
}
float perlin(vec2 p, int seed)
{
vec2 p00 = vec2(int(p.x), int(p.y));
vec2 p10 = p00 + vec2(1, 0);
vec2 p01 = p00 + vec2(0, 1);
vec2 p11 = p00 + vec2(1, 1);
float f00 = dot(perlin_gradient(p00, seed), p - p00);
float f10 = dot(perlin_gradient(p10, seed), p - p10);
float f01 = dot(perlin_gradient(p01, seed), p - p01);
float f11 = dot(perlin_gradient(p11, seed), p - p11);
return smoothstep_transition(
smoothstep_transition(f00, f10, fract(p).x),
smoothstep_transition(f01, f11, fract(p).x),
fract(p).y
) * 0.5 + 0.5;
}
float perlin_f(vec2 n, int seed, int f)
{
float o = perlin(n, seed) * .5;
o += mix(o, perlin(n * 2., seed + 10), f > 1. ? 1. : 0.) * .25;
o += mix(o, perlin(n * 4., seed + 20), f > 2. ? 1. : 0.) * .125;
o += mix(o, perlin(n * 8., seed + 30), f > 3. ? 1. : 0.) * .0625;
o += mix(o, perlin(n * 16., seed + 40), f > 4. ? 1. : 0.) * .03125;
o += mix(o, perlin(n * 32., seed + 50), f > 5. ? 1. : 0.) * .015626;
return o;
}
// VORONOI // VORONOI
float v_index(vec2 uv) { float v_index(vec2 uv) {
+4 -3
View File
@@ -271,8 +271,9 @@ subroutine(fx_stage_sub) vec4 fx_9(vec2 vUV, sampler2D previous, sampler2D feedb
float k1 = 100. * (1. - zoom) + 10.; float k1 = 100. * (1. - zoom) + 10.;
float inv_k = 1. / k1; float inv_k = 1. / k1;
uv2 = floor(uv2 * k1) * inv_k; uv2 = floor(uv2 * k1) * inv_k;
int start_char = charset_ctrl.x > 0. ? charsets[int(charset.x * CHARSETS) * 2] : 0x01; int charset_index = int(charset.x * (CP437_SETS - 1));
int char_span = int((charset_ctrl.x > 0. ? charsets[int(charset.x * CHARSETS) * 2 + 1] : 255)); int start_char = charset_ctrl.x > 0. ? cp437_sets[charset_index * 2] : 0x01;
int char_span = int((charset_ctrl.x > 0. ? cp437_sets[charset_index * 2 + 1] : 255));
char_span = int(char_span * max(1. - charset.y, 1. / (char_span * .75))); char_span = int(char_span * max(1. - charset.y, 1. / (char_span * .75)));
ivec2 uv2i = ivec2(uv2 * k1); ivec2 uv2i = ivec2(uv2 * k1);
int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span); int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span);
@@ -281,7 +282,7 @@ subroutine(fx_stage_sub) vec4 fx_9(vec2 vUV, sampler2D previous, sampler2D feedb
+ reframe(previous, uv2 + vec2(1., 1.) * inv_k * .125).xyz * .2 + reframe(previous, uv2 + vec2(1., 1.) * inv_k * .125).xyz * .2
+ reframe(previous, uv2 + vec2(0., 1.) * inv_k * .125).xyz * .2 + reframe(previous, uv2 + vec2(0., 1.) * inv_k * .125).xyz * .2
+ reframe(previous, uv2 + vec2(.5, .5) * inv_k * .125).xyz * .2; + reframe(previous, uv2 + vec2(.5, .5) * inv_k * .125).xyz * .2;
c = chr(mod(uv1 * k1, 1.), code) ? c : vec3(0.); c = cp437(mod(uv1 * k1, 1.), code) ? c : vec3(0.);
return fx_master(c0, c, seed, m0); return fx_master(c0, c, seed, m0);
} }
+43 -24
View File
@@ -1,30 +1,49 @@
#ifndef INC_SENTENCES #include inc_cp437.glsl
#define INC_SENTENCES
#define SENTENCE_COUNT 17 #ifndef INC_CP437_SENTENCES
#define SENTENCE_MAX_LENGTH 20 #define INC_CP437_SENTENCES
const int sentences[] = int[SENTENCE_COUNT * SENTENCE_MAX_LENGTH]( #define CP437_SENTENCE_COUNT 17
0x66, 0x6F, 0x72, 0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #define CP437_SENTENCE_MAX_LEN 18
0x46, 0x4F, 0x52, 0x47, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x46, 0x2E, 0x4F, 0x2E, 0x52, 0x2E, 0x47, 0x2E, 0x45, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, const int cp437_sentences[] = int[306](
0x46, 0x75, 0x73, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x6F, 0x72, 0x67, 0x65, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // forge
0x4F, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x4F, 0x52, 0x47, 0x45, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // FORGE
0x52, 0x65, 0x61, 0x6C, 0x2D, 0x74, 0x69, 0x6D, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x2E, 0x4F, 0x2E, 0x52, 0x2E, 0x47, 0x2E, 0x45, 0x2E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // F.O.R.G.E.
0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x75, 0x73, 0x69, 0x6F, 0x6E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Fusion
0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x66, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Of
0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6E, 0x67, 0x20, 0x79, 0x6F, 0x75, 0x20, 0x73, 0x65, 0x65, 0x00, 0x00, 0x52, 0x65, 0x61, 0x6C, 0x2D, 0x74, 0x69, 0x6D, 0x65, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Real-time
0x50, 0x69, 0x78, 0x65, 0x6C, 0x20, 0x62, 0x79, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Generative
0x4C, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Effects
0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x79, 0x6F, 0x75, 0x00, 0x73, 0x65, 0x65, // Everything you see
0x43, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x6C, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x69, 0x78, 0x65, 0x6C, 0x00, 0x62, 0x79, 0x00, 0x70, 0x69, 0x78, 0x65, 0x6C, 0xFF, 0xFF, 0xFF, 0xFF, // Pixel by pixel
0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x69, 0x76, 0x65, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Live
0x4B, 0x6C, 0x65, 0xE3, 0x65, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Generated
0x43, 0x6F, 0x64, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x72, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x6C, 0x65, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Controlled
0x41, 0x72, 0x74, 0x20, 0x61, 0x73, 0x20, 0x63, 0x6F, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // π
0x4B, 0x6C, 0x65, 0xE3, 0x65, 0x6B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Kleπek
0x43, 0x6F, 0x64, 0x65, 0x00, 0x61, 0x73, 0x00, 0x61, 0x72, 0x74, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Code as art
0x41, 0x72, 0x74, 0x00, 0x61, 0x73, 0x00, 0x63, 0x6F, 0x64, 0x65, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF // Art as code
); );
const int lengths[] = int[SENTENCE_COUNT]( const int cp437_sentences_lengths[] = int[17](
5, 5, 10, 6, 2, 9, 10, 7, 18, 14, 4, 9, 10, 1, 6, 11, 11 5, 5, 10, 6, 2, 9, 10, 7, 18, 14, 4, 9, 10, 1, 6, 11, 11
); );
#endif
float cp437_sentence(vec2 uv, vec2 pos, int n)
{
float d = 0.;
int i;
if (n < .0 || n > CP437_SENTENCE_COUNT) {
return d;
}
for (i = 0; i < cp437_sentences_lengths[n]; i++) {
d += cp437_at(uv, pos + vec2(i, 0.), cp437_sentences[n * CP437_SENTENCE_MAX_LEN + i]);
}
return d;
}
#endif /* INC_CP437_SENTENCES */
+10 -8
View File
@@ -2,6 +2,7 @@
#include inc_magic.glsl #include inc_magic.glsl
#include inc_functions.glsl #include inc_functions.glsl
#include inc_cp437.glsl #include inc_cp437.glsl
#include inc_sentences.glsl
#ifndef INC_SRC #ifndef INC_SRC
#define INC_SRC #define INC_SRC
@@ -195,13 +196,14 @@ subroutine(src_stage_sub) vec4 src_7(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
uv2 *= zoom * 20. + 3.; uv2 *= zoom * 20. + 3.;
uv2 += iBeats; uv2 += iBeats;
uv2 = mod(uv2, 100.) + 100.; uv2 = mod(uv2, 100.) + 100.;
int start_char = charset_ctrl.x > 0. ? charsets[int(charset.x * CHARSETS) * 2] : 0x01; int charset_index = int(charset.x * (CP437_SETS - 1));
int char_span = int((charset_ctrl.x > 0. ? charsets[int(charset.x * CHARSETS) * 2 + 1] : 255)); int start_char = charset_ctrl.x > 0. ? cp437_sets[charset_index * 2] : 0x01;
int char_span = int((charset_ctrl.x > 0. ? cp437_sets[charset_index * 2 + 1] : 255));
char_span = int(char_span * max(1. - charset.y, 1. / (char_span * .75))); char_span = int(char_span * max(1. - charset.y, 1. / (char_span * .75)));
ivec2 uv2i = ivec2(uv2); ivec2 uv2i = ivec2(uv2);
int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span); int code = ((charset_ctrl.y < 1. || (uv2i.x % 2 ^ uv2i.y % 2) > 0) ? 1 : 0) * (start_char + int((rand(uv2i) + char_delta) * char_span) % char_span);
uv2 = mod(uv2, 1.); uv2 = mod(uv2, 1.);
float f = chr(uv2, code) ? 1. : 0.; float f = cp437(uv2, code) ? 1. : 0.;
return vec4(f); return vec4(f);
} }
@@ -228,10 +230,10 @@ subroutine(src_stage_sub) vec4 src_8(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
vec2 uv2 = uv1; vec2 uv2 = uv1;
uv2 *= (1. + zoom) * 12.; uv2 *= (1. + zoom) * 12.;
uv2.y += .5; uv2.y += .5;
int s = int(sentence * (SENTENCE_COUNT - 1)); int s = int(sentence * (CP437_SENTENCE_COUNT - 1));
uv2.x += floor(uv2.y) * (h_delta - .5) * 2.; uv2.x += floor(uv2.y) * (h_delta - .5) * 2.;
uv2.y = mix(uv2.y, mod(uv2.y, 1.), h_delta_b.x); uv2.y = mix(uv2.y, mod(uv2.y, 1.), h_delta_b.x);
float f = write_sentence(uv2, vec2(-float(lengths[s]) * .5, 0.), s); float f = cp437_sentence(uv2, vec2(-float(cp437_sentences_lengths[s]) * .5, 0.), s);
return vec4(f); return vec4(f);
} }
@@ -258,13 +260,13 @@ subroutine(src_stage_sub) vec4 src_9(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3
uv2.x += h_shift; uv2.x += h_shift;
uv2 *= 15.; uv2 *= 15.;
uv2.y += .5; uv2.y += .5;
int s = int(sentence * (SENTENCE_COUNT - 1)); int s = int(sentence * (CP437_SENTENCE_COUNT - 1));
float slen = float(lengths[s]); float slen = float(cp437_sentences_lengths[s]);
uv2.x += floor(uv2.y) * (h_delta - .5) * 2.; uv2.x += floor(uv2.y) * (h_delta - .5) * 2.;
uv2.x = cmod(uv2.x, slen + 1.); uv2.x = cmod(uv2.x, slen + 1.);
vec2 uv3 = uv2; vec2 uv3 = uv2;
uv3.y = mix(uv3.y, mod(uv3.y, 1.), h_delta_b.x); uv3.y = mix(uv3.y, mod(uv3.y, 1.), h_delta_b.x);
float f = write_sentence(uv3, vec2(-slen * .5, 0.), s); float f = cp437_sentence(uv3, vec2(-slen * .5, 0.), s);
f *= (1. - abs(floor(uv2.y) * .125)) * (1. - abs(floor(uv2.y) * .125)); f *= (1. - abs(floor(uv2.y) * .125)) * (1. - abs(floor(uv2.y) * .125));
+104
View File
@@ -0,0 +1,104 @@
#include inc_cp437.glsl
#ifndef INC_WRITE
#define INC_WRITE
const int hex_chars[] = int[16](
0x30,
0x31,
0x32,
0x33,
0x34,
0x35,
0x36,
0x37,
0x38,
0x39,
0x41,
0x42,
0x43,
0x44,
0x45,
0x46
);
float write_5(vec2 uv, vec2 pos, int str[5])
{
float d = 0.;
int i;
for (i = 0; i < 5; i++) {
if (str[i] == 0) {
return d;
}
d += cp437_at(uv, pos + vec2(i, 0.), str[i]);
}
return d;
}
float write_10(vec2 uv, vec2 pos, int str[10])
{
float d = 0.;
int i;
for (i = 0; i < 10; i++) {
if (str[i] == 0) {
return d;
}
d += cp437_at(uv, pos + vec2(i, 0.), str[i]);
}
return d;
}
float write_20(vec2 uv, vec2 pos, int str[20])
{
float d = 0.;
int i;
for (i = 0; i < 20; i++) {
if (str[i] == 0) {
return d;
}
d += cp437_at(uv, pos + vec2(i, 0.), str[i]);
}
return d;
}
float write_int(vec2 uv, vec2 pos, int value, int magnitude)
{
value = max(0, value);
int i;
int m = 1;
float d = 0.;
for (i = 0; i < magnitude; i++) {
if (i == 0 || value >= m) {
d += cp437_at(uv, pos + vec2(magnitude - i - 1, 0.), int(0x30 + (value % (m * 10)) / m));
m *= 10;
}
}
return d;
}
float write_int_left(vec2 uv, vec2 pos, int value, int magnitude)
{
value = max(0, value);
int i;
int m = 1;
float d = 0.;
pos.x -= magnitude;
for (i = 0; i < magnitude; i++) {
if (i == 0 || value >= m) {
pos.x += 1.;
m *= 10;
}
}
return write_int(uv, pos, value, magnitude);
}
#endif
+17
View File
@@ -0,0 +1,17 @@
forge
FORGE
F.O.R.G.E.
Fusion
Of
Real-time
Generative
Effects
Everything you see
Pixel by pixel
Live
Generated
Controlled
π
Kleπek
Code as art
Art as code
Submodule
+1
Submodule glsl-glyphs added at 16b52e8fc7
+160
View File
@@ -0,0 +1,160 @@
# ================
# FRAGMENT SHADERS
# ================
# === UNIFORMS ===
# --- uniform float ---
UNIFORM_TIME=iTime
UNIFORM_TEMPO=iTempo
UNIFORM_BEATS=iBeats
# --- uniform int ---
UNIFORM_FPS=iFPS
UNIFORM_IN_FPS_PREFIX=iInputFPS
UNIFORM_DEMO=iDemo
UNIFORM_AUTORAND=iAutoRand
UNIFORM_AUTORANDCYCLE=iAutoRandCycle
UNIFORM_PAGE=iPage
UNIFORM_SELECTED=iSelected
UNIFORM_SEED_PREFIX=iSeed
UNIFORM_STATE_PREFIX=iState
UNIFORM_ACTIVE_PREFIX=iActive
UNIFORM_IN_FORMAT_PREFIX=iInputFormat
# --- uniform vec2 ---
UNIFORM_RESOLUTION=iResolution
UNIFORM_TEX_RESOLUTION=iTexResolution
UNIFORM_IN_RESOLUTION_PREFIX=iInputResolution
# --- uniform vec3 ---
UNIFORM_GROUP_PREFIX=iGroup
# --- uniform sampler2D ---
UNIFORM_TEX_PREFIX=iTex
# ===========
# TEXTURE I/O
# ===========
TEX_COUNT=2
# === FRAGMENT SHADERS
FRAG_FILE_PREFIX=frag
FRAG_COUNT=3
FRAG_1_OUT=1
FRAG_2_OUT=0
FRAG_OUTPUT=3
FRAG_MONITOR=3
# ==========
# I/O Inputs
# ==========
MIDI_HW=hw:CARD=nanoKONTROL2
# === TYPES OF EVENTS
FADER_COUNT=16
FADER_1=0
FADER_2=1
FADER_3=2
FADER_4=3
FADER_5=4
FADER_6=5
FADER_7=6
FADER_8=7
FADER_9=16
FADER_10=17
FADER_11=18
FADER_12=19
FADER_13=20
FADER_14=21
FADER_15=22
FADER_16=23
TAP_TEMPO=46
# === GROUP INPUT STATES
GROUP_COUNT=3
GROUP_1_COUNT=6
GROUP_1_1_X=33
GROUP_1_1_Y=49
GROUP_1_1_Z=65
GROUP_1_2_X=1
GROUP_1_2_Y=17
GROUP_1_2_Z=
GROUP_1_3_X=34
GROUP_1_3_Y=50
GROUP_1_3_Z=66
GROUP_1_4_X=2
GROUP_1_4_Y=18
GROUP_1_4_Z=
GROUP_1_5_X=35
GROUP_1_5_Y=51
GROUP_1_5_Z=67
GROUP_1_6_X=3
GROUP_1_6_Y=19
GROUP_1_6_Z=
GROUP_2_COUNT=7
GROUP_2_1_X=37
GROUP_2_1_Y=53
GROUP_2_1_Z=69
GROUP_2_2_X=5
GROUP_2_2_Y=21
GROUP_2_2_Z=
GROUP_2_3_X=38
GROUP_2_3_Y=54
GROUP_2_3_Z=70
GROUP_2_4_X=6
GROUP_2_4_Y=22
GROUP_2_4_Z=
GROUP_2_5_X=39
GROUP_2_5_Y=55
GROUP_2_5_Z=71
GROUP_2_6_X=7
GROUP_2_6_Y=23
GROUP_2_6_Z=
GROUP_2_7_X=4
GROUP_2_7_Y=20
GROUP_2_7_Z=59
GROUP_3_COUNT=2
GROUP_3_1_X=48
GROUP_3_1_Y=58
GROUP_3_1_Z=
GROUP_3_2_X=0
GROUP_3_2_Y=16
GROUP_3_2_Z=11089
ARI_COUNT=2
ARI_1=GROUP_3_1_Y
ARI_2=GROUP_3_2_Z
# =====
# OTHER
# =====
# R on (qwerty)
KEY_RANDOMIZE=1082
# SHIFT+R (qwerty)
KEY_RESET=11082
# D (qwerty)
KEY_DEMO=1068
# A (qwerty)
KEY_AUTORAND=1065
# Left arrow
KEY_AUTORAND_DOWN=1263
# Right arrow
KEY_AUTORAND_UP=1262
# Down arrow
KEY_TEMPO_DOWN=1264
# Up arrow
KEY_TEMPO_UP=1265
+38
View File
@@ -0,0 +1,38 @@
#version 460
#include inc_functions.glsl
#include inc_magic.glsl
in vec2 vUV;
out vec4 fragColor;
uniform sampler2D iTex0; // feedback
uniform int iSeed1;
uniform vec3 iGroup1_1[6];
vec4 src_stage(vec2 vUV, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3)
{
// start
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1.);
// controls
float ctrl1 = magic(f1, b1, seed + 10.);
float ctrl2 = magic(f2, b2, seed + 20.);
float ctrl3 = magic(f3, b3, seed + 30.);
// logic
vec3 c = vec3(uv1.x, uv1.y, cos(iBeats) * 0.5 + 0.5);
// output
return vec4(c, 1.);
}
void main() {
fragColor = src_stage(vUV, iSeed1, iGroup1_1[0], iGroup1_1[1].xy, iGroup1_1[2], iGroup1_1[3].xy, iGroup1_1[4], iGroup1_1[5].xy);
}
+53
View File
@@ -0,0 +1,53 @@
#version 460
#include inc_functions.glsl
#include inc_magic.glsl
in vec2 vUV;
out vec4 fragColor;
uniform sampler2D iTex0; // feedback/self
uniform sampler2D iTex1; // previous
uniform int iSeed2;
uniform vec3 iGroup2_1[7];
vec4 fx_master(vec3 c0, vec3 c, int seed, vec3 m0) {
float fx = magic(m0.xy, vec3(1., 0., 0.), seed);
bool invert = magic_trigger(vec3(m0.z, 0., 0.), seed);
vec3 c_out = mix(c0, c, fx);
c_out = mix(c_out, 1. - c_out, invert ? 1. : 0.);
return vec4(c_out, 1.);
}
vec4 fx_stage(vec2 vUV, sampler2D previous, sampler2D feedback, int seed, vec3 b1, vec2 f1, vec3 b2, vec2 f2, vec3 b3, vec2 f3, vec3 m0)
{
// start
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1.);
// controls
float ctrl1 = magic(f1, b1, seed + 10.);
float ctrl2 = magic(f2, b2, seed + 20.);
float ctrl3 = magic(f3, b3, seed + 30.);
// logic
vec3 c0 = texture(previous, uv0).xyz;
vec2 uv2 = uv1;
vec3 c = reframe(previous, uv2).xyz;
// output
return fx_master(c0, c, seed, m0);
}
void main() {
fragColor = fx_stage(vUV, iTex1, iTex0, iSeed2, iGroup2_1[0], iGroup2_1[1].xy, iGroup2_1[2], iGroup2_1[3].xy, iGroup2_1[4], iGroup2_1[5].xy, iGroup2_1[6]);
}
+17
View File
@@ -0,0 +1,17 @@
#version 460
#include inc_write.glsl
in vec2 vUV;
out vec4 fragColor;
uniform sampler2D iTex0;
uniform int iFPS;
void main() {
vec4 color = texture(iTex0, vUV);
color = mix(color, 1. - color, write_int_left(vUV * 20., vec2(1., 1.), min(120, iFPS), 3));
fragColor = color;
}
+1
View File
@@ -0,0 +1 @@
../default/inc_cp437.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_debug.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_functions.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_magic.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_map.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_rand.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_res.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_sentences.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_template.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_time.glsl
+1
View File
@@ -0,0 +1 @@
../default/inc_write.glsl
-66
View File
@@ -1,66 +0,0 @@
#!/usr/bin/env python3
import os
TARGET_FILE = os.path.join(
os.path.dirname(__file__), "..", "default", "inc_sentences.glsl"
)
SENTENCE_MAX_LENGTH = 20
SENTENCES = [
"forge",
"FORGE",
"F.O.R.G.E.",
"Fusion",
"Of",
"Real-time",
"Generative",
"Effects",
"Everything you see",
"Pixel by pixel",
"Live",
"Generated",
"Controlled",
"π",
"Kleπek",
"Code as art",
"Art as code",
]
MAPPING = {"π": "0xE3"}
def code(char: str) -> str:
if char in MAPPING:
return MAPPING[char]
return "0x" + f"{ord(char):02x}".upper()
def convert(txt: str) -> str:
out = []
for i in range(SENTENCE_MAX_LENGTH):
out += [code(txt[i]) if i < len(txt) else "0x00"]
return ', '.join(out)
def main() -> None:
with open(TARGET_FILE, mode="w") as file:
file.write("#ifndef INC_SENTENCES\n")
file.write("#define INC_SENTENCES\n\n")
file.write(f"#define SENTENCE_COUNT {len(SENTENCES)}\n")
file.write(f"#define SENTENCE_MAX_LENGTH {SENTENCE_MAX_LENGTH}\n\n")
file.write("const int sentences[] = int[SENTENCE_COUNT * SENTENCE_MAX_LENGTH](\n")
for i, sentence in enumerate(SENTENCES):
file.write(" " + convert(sentence) + ("," if i < len(SENTENCES) - 1 else "") + "\n")
file.write(");\n\n")
file.write("const int lengths[] = int[SENTENCE_COUNT](\n")
file.write(
" " + ", ".join(str(len(sentence)) for sentence in SENTENCES) + "\n"
)
file.write(");\n")
file.write("#endif")
if __name__ == "__main__":
main()
+2 -1
View File
@@ -6,7 +6,8 @@
static const char *vertex_shader_text = static const char *vertex_shader_text =
"#version 140\n" "#version 140\n"
"const mat4 mvp = " "const mat4 mvp = "
"mat4(vec4(2.,0.,0.,0.),vec4(0.,2.,0.,0.),vec4(0.,0.,2.,0.),vec4(-1.,-1.,1.,1.));\n" "mat4(vec4(2.,0.,0.,0.),vec4(0.,2.,0.,0.),vec4(0.,0.,2.,0.),vec4(-1.,-1.,1."
",1.));\n"
"in vec2 vPos;\n" "in vec2 vPos;\n"
"out vec2 vUV;\n" "out vec2 vUV;\n"
"void main()\n" "void main()\n"
+4 -1
View File
@@ -60,7 +60,10 @@ static void update_active(const Context *context, StateConfig state_config,
j++) { j++) {
k = state_config.group_active_offsets.values[i] + j; k = state_config.group_active_offsets.values[i] + j;
safe_midi_write(midi, state_config.group_active_codes.values[k], safe_midi_write(midi, state_config.group_active_codes.values[k],
context->active[i] == j && beat_active ? MIDI_MAX : 0); context->active[i] == j &&
(context->selected != k || beat_active)
? MIDI_MAX
: 0);
} }
} }
} }
+2 -2
View File
@@ -6,8 +6,8 @@
void state_parse_config(StateConfig *state_config, const ConfigFile *config); void state_parse_config(StateConfig *state_config, const ConfigFile *config);
void state_midi_event(Context *context, StateConfig state_config, void state_midi_event(Context *context, StateConfig state_config,
MidiDevice midi, unsigned char code, MidiDevice midi, unsigned char code, unsigned char value,
unsigned char value, bool trace_midi); bool trace_midi);
void state_key_event(Context *context, StateConfig state_config, void state_key_event(Context *context, StateConfig state_config,
unsigned int code, MidiDevice midi); unsigned int code, MidiDevice midi);
+3 -2
View File
@@ -3,12 +3,13 @@
#ifndef WINDOW_H #ifndef WINDOW_H
#define WINDOW_H #define WINDOW_H
void window_startup(void (*error_callback)(int, const char *), const unsigned int backend); void window_startup(void (*error_callback)(int, const char *),
const unsigned int backend);
void window_terminate(); void window_terminate();
Window *window_init(const char *title, unsigned char monitor_index, Window *window_init(const char *title, unsigned char monitor_index,
bool windowed, const unsigned int opengl_major, bool windowed, const unsigned int opengl_major,
const unsigned int opengl_minor, Window *shared_context, const unsigned int opengl_minor, Window *shared_context,
void (*key_callback)(Window *, int, int, int, int)); void (*key_callback)(Window *, int, int, int, int));