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.
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).
The solution currently requires at least Visual Studio 2017.
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.
This builds the executable with Crinkler enabled to shrink it as small as possible.
No minification, but the executable will save the rendered image out to a file, and then exit.
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.
The current sample index, only available in the draw
shader.
The accumulation framebuffer, only available in the present
shader.
In config.h
, there are a number of customization options for you to set how you see fit:
If enabled, Blossom opens in exclusive-fullscreen, otherwise it opens a borderless window.
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.
Specify the target resolution in pixels. Only used if WINDOW_AUTO_SIZE
is disabled.
Specify the maximum rendering time in milliseconds. Recommended for compo use.
Optional. Specify the minimum number of samples to accumulate.
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.
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.
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.
In Capture mode, the render will be saved as a PNG.
In Capture mode, the render will be saved as a JPG.
In Capture mode, the render will be saved as a binary file containing 8-bit-per-channel RGB triplets.
In Capture mode, the render will be saved as a binary file containing float32 RGBA data.
If enabled, uses a couple of risky tricks to shave a few bytes.
If enabled, sets up a party-safe configuration based on the Revision rules.
- Is This Your Card? by yx
- Tesseract by Sinmix
- You Are Here by tdhooper
...and more!
- LLB, for Shader Minifier
- Blueberry & Mentor, for Crinkler
- noby, for Leviathan, which served as an invaluable reference.