• Stars
    star
    220
  • Rank 179,406 (Top 4 %)
  • Language
    C
  • License
    Other
  • Created over 3 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

4K Executable Graphics framework

Blossom 🌸

Blossom is a small framework for creating 4K Executable Graphics artworks for the demoscene.

You are free to use this as the basis for your own demoscene works; credit ("Blossom by yx") is welcome but not required.

Rendering Model

Blossom is built primarily with accumulative pathtracing in mind. There are two shaders, draw and present. The draw shader will be executed repeatedly up to a configurable sample-count or render duration, and each sample will be additively blended into a framebuffer. Once the samples are all accumulated, the present shader will be executed repeatedly until the user exits the program. Typically the present shader will sample the result of the accumulated draw passes, and perform some sort of post-processing, tonemapping, etc. for display.

In the example shaders provided, the alpha channel of the draw buffer is used to keep track of the sample count (by writing an additive 1.0 for each sample).

Requirements

The solution currently requires at least Visual Studio 2017.

Configurations

Debug

Does what it says on the tin - a debug-friendly mode, no executable compression (although shaders are still minified). By default this will open a smaller 1280x720 window, and a progressive rendering preview will be enabled. A debug console window is also available.

Release

This builds the executable with Crinkler enabled to shrink it as small as possible.

Capture

No minification, but the executable will save the rendered image out to a file, and then exit.

Shader Uniforms

vec4 iResolution

The target resolution, available in both shaders.
x and y components are the width and height respectively.
z and w contain the aspect ratio (width/height) and inverse aspect ratio (height/width) respectively.

int iFrame

The current sample index, only available in the draw shader.

sampler2D accumulatorTex

The accumulation framebuffer, only available in the present shader.

Custom Options

In config.h, there are a number of customization options for you to set how you see fit:

WINDOW_FULLSCREEN

If enabled, Blossom opens in exclusive-fullscreen, otherwise it opens a borderless window.

WINDOW_AUTO_SIZE

If enabled, Blossom will target the primary display's native resolution. Otherwise, the target resolution must be set explicitly with CANVAS_WIDTH and CANVAS_HEIGHT.

Note: If you enable WINDOW_AUTO_SIZE but your artwork needs to be presented in a certain aspect ratio, it's up to you to handle appropriate letterboxing/pillarboxing manually in your shader code - Blossom will not handle that for you.

CANVAS_WIDTH, CANVAS_HEIGHT

Specify the target resolution in pixels. Only used if WINDOW_AUTO_SIZE is disabled.

RENDER_MAX_TIME_MS

Specify the maximum rendering time in milliseconds. Recommended for compo use.

RENDER_MIN_SAMPLES

Optional. Specify the minimum number of samples to accumulate.

RENDER_MAX_SAMPLES

Optional. Specify the maximum number of samples to accumulate. Recommended for compo use, if you don't need a high sample count to converge your artwork.

RENDER_EXACT_SAMPLES

Specify an exact number of samples to accumulate. If defined, the values of RENDER_MAX_TIME_MS, RENDER_MIN_SAMPLES, and RENDER_MAX_SAMPLES will all be ignored.

RENDER_PROGRESSIVE

If enabled, the window will alternate between draw and present passes, so the current state of the rendering is always visible. If disabled, the window will appear black until the accumulation phase is complete, as required by Revision rules.

CAPTURE_SAVE_PNG

In Capture mode, the render will be saved as a PNG.

CAPTURE_SAVE_JPG

In Capture mode, the render will be saved as a JPG.

CAPTURE_SAVE_U8_BIN

In Capture mode, the render will be saved as a binary file containing 8-bit-per-channel RGB triplets.

CAPTURE_SAVE_F32_BIN

In Capture mode, the render will be saved as a binary file containing float32 RGBA data.

DESPERATE

If enabled, uses a couple of risky tricks to shave a few bytes.

REVISION_RULESET

If enabled, sets up a party-safe configuration based on the Revision rules.

As Seen In...

...and more!

Special Thanks

More Repositories

1

pridecat

🏳️‍🌈 Like cat but more colorful! ✨
C++
274
star
2

file2img

A utility for reinterpreting binary data as images.
C
100
star
3

hxdmp

The no-nonsense hexdumper.
C
67
star
4

utf8info

Reads UTF-8 on stdin and prints out the raw Unicode codepoints. Useful for seeing exactly what a string consists of.
C++
62
star
5

twitter-alt-text-viewer

Make alt-text visible on Twitter web
CSS
50
star
6

zalgo

C++
45
star
7

the-emoji-demo

NOVA 2018 8k intro
Assembly
44
star
8

miles-per-hour

How often are people called 'Miles' born in the US?
Python
43
star
9

sloth

Like cat, but slower
C++
42
star
10

bad-apple-emoji

Bad Apple, but 🌙
C++
40
star
11

succ

no
C++
38
star
12

aoc-21

Advent of Code 2021, in pure ARM assembly on GBA.
Assembly
36
star
13

executable.graphics

Gallery of 4K Executable Graphics artworks from the Demoscene.
SCSS
28
star
14

cga-trans-flag

Sizecoding a trans pride flag in x86 DOS assembly.
Assembly
24
star
15

engine-software-gba-tools

Tools for interacting with music data in GBA games that use the Engine Software replayer.
C++
22
star
16

useless-machine

A machine that is useless.
C++
19
star
17

ac-pixel-filter-investigation

C++
17
star
18

rs-cpp

C++
17
star
19

keygender

Pro Nouns Keygenderator
JavaScript
16
star
20

bad-apple-braille

Bad Apple, but braille.
C++
16
star
21

overwatch-highlights

C#
14
star
22

zat

The Stargate process manager
Python
13
star
23

fake

Another build system.
C
12
star
24

gba-lz77

C++
11
star
25

hw

HW: a modern, open-source, typeless, turing-incomplete programming language.
Makefile
10
star
26

slice

A no-nonsense tool to copy a blob of data from one file to another.
C
9
star
27

miette

C
9
star
28

utf8enc

Turns unicode codepoint strings into UTF-8 characters
C++
9
star
29

vg-layoffs

Python
9
star
30

qbdiff

Quick diff of binary files
C++
8
star
31

pictionary-nes

C++
8
star
32

better-bsky-notifs

Better notification highlights in Bluesky
CSS
8
star
33

brailify

C++
8
star
34

niccc-matplotlib

Python
8
star
35

twitter-headline-unhider

Unhide link card headlines on Twitter's web interface
CSS
7
star
36

yx-long-way-from-home

SynchroNY 2020 Executable Graphics entry
C
5
star
37

rifftool

rifftool dumps the block structure of RIFF files
C++
5
star
38

yx-penrose-pathtraced

Revision 2019 Executable Graphics entry
C
4
star
39

circleci-test

SCSS
3
star
40

relighter

An experimental renderer that separates the raycasting and texturing phases.
C++
2
star
41

yx-fragments-of-self

C
2
star
42

fun-unicode

A collection of unicode chars/combinations I find fun/interesting/useful
1
star
43

yx-brutal-knowledge

Demosplash 2019 Executable Graphics entry
C
1
star
44

vasm

C
1
star
45

overwatch-highlights-test-data

A large amount of overwatch highlight files, intended to be used as test data for overwatch-highlights
1
star
46

lzrwlkr-rgs

Rust
1
star
47

yx-light-at-the-end-of-the-tunnel

NOVA 2019 Executable Graphics entry
C
1
star