4K Executable Graphics framework

Related tags

Graphics Blossom
Overview

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).

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.

Special Thanks

You might also like...
📽 Highly Optimized Graphics Math (glm) for C

🎥 OpenGL Mathematics (glm) for C Documentation Almost all functions (inline versions) and parameters are documented inside the corresponding headers.

A library for high-performance, modern 2D graphics with SDL written in C.

SDL_gpu, a library for making hardware-accelerated 2D graphics easy. by Jonathan Dearborn SDL_gpu is licensed under the terms of the MIT License. See

3D engine from scratch (without OpenGL or any other 3D graphics library)
3D engine from scratch (without OpenGL or any other 3D graphics library)

Simple 3d engine based on SFML library. I tried to make this engine powerful and easy to understand.

Dear PyGui 3D Engine (early development) and Graphics API demos.
Dear PyGui 3D Engine (early development) and Graphics API demos.

Marvel This repo is the working location of the eventual Dear PyGui 3D Engine. It also contains several single file examples of creating a triangle wi

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision
This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Computer Graphics and Computer Vision Description: This repository is used for storing sourcecode related to final project of Computer Graphics and Co

Sandbox for graphics paper implementation
Sandbox for graphics paper implementation

Graphics Experiments 適当にグラフィックス関連の論文などを読んで実装・検証したものを置きます。 I'll randomly put something for implementing/validating graphics papers here. 実装 / Implement

A small cross-platform graphics library made in C
A small cross-platform graphics library made in C

minigfx Small graphics library made in C Intended to be: Simple to understand Intuitive Fun to use Features Cross platform: Windows and Linux. To see

My computer graphics playground. Currently has a raytracer implemented with D3D11 compute shader.
My computer graphics playground. Currently has a raytracer implemented with D3D11 compute shader.

Graphics Playground I use this project as my "toy" engine. I'll be implementing various graphics projects in this repository. The code here is not sui

CS-GY 6533 A – Interactive Computer Graphics - Fall 2021

CS-GY 6533 A – Interactive Computer Graphics - Fall 2021 Course Instructors Cláudio Silva (instructor) 370 Jay Street, room 1153 [email protected] Offic

Comments
  • TheError following the NVidia driver update has been fixed:

    TheError following the NVidia driver update has been fixed:

    "error C7616: global variable gl_FragColor is removed after version 420"

    • Added out layout for FragColor in draw.frag and present.frag and use this instead of gl_FragColor.
    • Adds 2 bytes to size of Release executable.
    opened by pmalin 3
  • Support for latest Nvidia drivers

    Support for latest Nvidia drivers

    Looks like gl_FragColor with #version 430 is no longer supported, since October 2021 (driver 496.13 and later).

    This will inescapably affect all previously-compiled binaries, but we should at least find a workaround and implement it into the template for future releases.

    opened by lunasorcery 1
  • Fix corrupted vcxproj

    Fix corrupted vcxproj

    Replace the non-breaking space on line 71 col 17, with a regular space.

    When I load the project with VS2019, it didn't like the non-breaking space and wouldn't load

    opened by tdhooper 1
  • Several optimizations on C++ side

    Several optimizations on C++ side

    Description

    • Did 3 unrelated changes in main.cpp . All of them are size improvements. See the each commit logs.

    Points need review

    • I don't have enough confidence about validity across configs and syntax and usage of preprocessors. I really don't do C++ usually...
    opened by 0b5vr 1
Owner
Luna
Luna
A terminal-based graphics library for both 2D and 3D graphics.

TermGL A terminal-based graphics library for both 2D and 3D graphics. Written in C, created for terminals supporting ANSI escape codes. Table of Conte

null 215 Dec 28, 2022
kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics

kaun kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics. It is a Lua module you can require from a shared library

Joel Schumacher 4 Apr 5, 2021
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.

DirectX-Graphics-Samples This repo contains the DirectX 12 Graphics samples that demonstrate how to build graphics intensive applications for Windows

Microsoft 4.9k Dec 26, 2022
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

bgfx - Cross-platform rendering library GitHub Discussions Discord Chat What is it? Cross-platform, graphics API agnostic, "Bring Your Own Engine/Fram

Бранимир Караџић 12.6k Jan 8, 2023
A modern cross-platform low-level graphics library and rendering framework

Diligent Engine A Modern Cross-Platform Low-Level 3D Graphics Library Diligent Engine is a lightweight cross-platform graphics API abstraction library

Diligent Graphics 2.6k Dec 30, 2022
graphics and computational physics framework

atto Graphics and computational physics research framework: aligned memory allocation, string manipulation, file IO, etc. 2-, 3- and 4-dimensional vec

Carlos Correia 0 Jul 24, 2022
2D Graphics Framework for C99

roita 2D Graphics Framework for C99. Install clone the repo cd into roita run make install Dependencies -lX11 -lpthread -lxcb -lXau -lXdmcp -lGLX -lGL

r0tthin 1 Dec 4, 2021
2D Vector Graphics Engine Powered by a JIT Compiler

Blend2D 2D Vector Graphics Powered by a JIT Compiler. Official Home Page (blend2d.com) Official Repository (blend2d/blend2d) Public Chat Channel Zlib

Blend2D 1.2k Dec 27, 2022
Lightweight and modular C++11 graphics middleware for games and data visualization

Magnum — Lightweight and modular C++11/C++14 graphics middleware for games and data visualization Looking for an open-source library that gives you gr

Vladimír Vondruš 4.3k Dec 30, 2022
Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics

Yocto/GL: Tiny C++ Libraries for Data-Oriented Physically-based Graphics Yocto/GL is a collection of small C++17 libraries for building physically-bas

Fabio Pellacini 2.4k Dec 27, 2022