Difference between revisions of "4K Intro"

From SizeCoding
Jump to: navigation, search
Line 24: Line 24:
 
* Single scene vs multiple scenes
 
* Single scene vs multiple scenes
 
* Ray-Intersections or Ray Marching
 
* Ray-Intersections or Ray Marching
* What kind of softsynth to use
+
* What kind of softsynth to use, or writing your own
* Render pipeline - Single or multi (post)shader.
+
* Render pipeline - Single or multipass (post/audio)shaders.
 
* Scene, Camera and progression handling
 
* Scene, Camera and progression handling
 
* Text - Do you want to include text and if so: Are you using WindowsGlyphs texture or SDF
 
* Text - Do you want to include text and if so: Are you using WindowsGlyphs texture or SDF
 +
 +
==== Design pitfalls ====
 +
Here are a few design pitfalls you should try to avoid if necessary.
 +
 +
* Undirected raymarch experiments
 +
Wiggly domain repetition shadertoy experiments, with or without walking glows, might be sufficient for a shaderjam or shader-showdown, but usually make a sub-par 4k intro. Don't do it, even if it has the compofiller banner on the slide.
 +
 
 +
* The Rebranded cornell box - Just a shiny sphere bro!
 +
Its great as a rendertest reference for your PBR / pathtracing tests, but it doesn't make a compelling intro.
 +
The times you still see a reflective/pathtraced sphere and/or box with music mask as a 4k intro is staggering.
 +
Sadly sceners still accept these rebranded cornell boxes as legit an even winning/cdc receiving intros, because shineys.
 +
But my intuition says these will be looked upon like the countless early 2000s goa+bended sphers/torus intros that fail to stand the test of time.
 +
 +
* Shitty synths
 +
There are a few great intros out there that
 +
 +
==== Design tips ====
 +
* Don't miss the Low hanging fruit
 +
In 4k space i would suggest a postshader pass at minimum, which depending on your size budget you can use for things like Vignetting, DOF, tone-mapping, anti-aliasing, chromatic abberation, etc. But even if your 4k intro doesn't have a seperate post-shader pass, adding a bit of in-shader vignetting / gamma correction / tone-mapping to your intro are relative easy/cheap ways to improve visual quality of your intro, so why leave those options off the table?
 +
  
 
== Setup ==
 
== Setup ==
Line 44: Line 64:
 
* Multipass rendering
 
* Multipass rendering
 
* Optional: Post processing  
 
* Optional: Post processing  
 +
 +
==== Ray-Intersetions vs Raymarching ====
 +
In theory ideally you'd like to have multi-sample, multiple bounces, highly flexible, highly accurate raymarching
 +
 +
But in practice this is as of year (2024) still impossible to do realtime on most systems, therefore a choice has to be made between exact interesctions of primitives / raytracing vs ray marching. What are the differences in usecases and
 +
 +
  
 
== Sound ==
 
== Sound ==

Revision as of 01:24, 14 April 2024

Introduction

This category is dedicated to modern 4K Intro development for Windows/Win32, which consist of a small OpenGL/D3D/DX Framework, a softsynth and 1 or more pixelshaders. As such this won't be discussion legacy mesh techniques as few 4k intros make use of those techniques anymore.

Most Windows 4K Intros will be setup using C, sometimes in combination with assembler, or in some cases pure assembler. In general writing everything in assembler should give you a little more freedom in pushing/popping your function arguments and register usage.languages.

Graphics are usualy done using OpenGL / GLSL or Direct3D/DX11.

Tools

There are a couple of options for tools, but generally these tools are often used

  • Visual Studio / Vscode / GCC Compiler
  • Crinkler or other external packer for compression
  • Shader minifier
  • Optional: Local/Online GLSL Shader editing environment (e.g. Shadertoy, Kodelife, bonzo, etc.)
  • Optional: Timeline/Camera tooling
  • Optional: gnuRocket for timing.
  • Optional / Alternatively: NASM Assembler


Intro design

When designing a 4k intro, it is best practice to consider each of the following aspects seperately:

  • How much size budget do you want to allocate to render pipeline, sound, scene building, (post)shading, progression?
  • Abstract vs organic vs scene/world-building
  • Single scene vs multiple scenes
  • Ray-Intersections or Ray Marching
  • What kind of softsynth to use, or writing your own
  • Render pipeline - Single or multipass (post/audio)shaders.
  • Scene, Camera and progression handling
  • Text - Do you want to include text and if so: Are you using WindowsGlyphs texture or SDF

Design pitfalls

Here are a few design pitfalls you should try to avoid if necessary.

  • Undirected raymarch experiments

Wiggly domain repetition shadertoy experiments, with or without walking glows, might be sufficient for a shaderjam or shader-showdown, but usually make a sub-par 4k intro. Don't do it, even if it has the compofiller banner on the slide.

  • The Rebranded cornell box - Just a shiny sphere bro!

Its great as a rendertest reference for your PBR / pathtracing tests, but it doesn't make a compelling intro. The times you still see a reflective/pathtraced sphere and/or box with music mask as a 4k intro is staggering. Sadly sceners still accept these rebranded cornell boxes as legit an even winning/cdc receiving intros, because shineys. But my intuition says these will be looked upon like the countless early 2000s goa+bended sphers/torus intros that fail to stand the test of time.

  • Shitty synths

There are a few great intros out there that

Design tips

  • Don't miss the Low hanging fruit

In 4k space i would suggest a postshader pass at minimum, which depending on your size budget you can use for things like Vignetting, DOF, tone-mapping, anti-aliasing, chromatic abberation, etc. But even if your 4k intro doesn't have a seperate post-shader pass, adding a bit of in-shader vignetting / gamma correction / tone-mapping to your intro are relative easy/cheap ways to improve visual quality of your intro, so why leave those options off the table?


Setup

A 4k framework / intro can be setup in either C or Assembler, or a combination of both.

  • The groundlevel basics of a framework are discussed on the 1K Intro wiki at http://www.sizecoding.org/wiki/1K_Intro
  • From here you can setup your audiobuffer add a softsynth of choice, or write your own (either in GLSL or Software)
  • Most likely you'll like to add a few more function imports to properly pass uniforms to your shader.
  • Optionally: Add another render-pass by feeding the output of the main shader to a post-shading process
  • Optionally: Add an init pass where you prepare (glyph) textures and other buffers you'd like to feed into your main shader.
  • Optionally: Hook up a Scene/Camera/Timing system during development

Graphics

  • Setting up your Framework
  • Ray-Intersections vs Raymarching
  • Multipass rendering
  • Optional: Post processing

Ray-Intersetions vs Raymarching

In theory ideally you'd like to have multi-sample, multiple bounces, highly flexible, highly accurate raymarching

But in practice this is as of year (2024) still impossible to do realtime on most systems, therefore a choice has to be made between exact interesctions of primitives / raytracing vs ray marching. What are the differences in usecases and


Sound

Compression

Crinkler is the most commonly used compression at the moment for 4K intros. It maximizes compression by taking over the linking process, setting up the windows header for you and if needed re-arrange the different segments of the code.

Crinkler reports

When using the /REPORT:intro_report.html feature, crinkler will generate a report and heatmap for your intro binary. This is helpful to see how well your (shader)code compresses and where you can maybe gain a few more bytes.

Word about the resulting executable

Please note that when using crinkler in TINYHEADER mode, the resulting windows header will most likely trigger virus scanners / Microsoft Defender and mark it as suspicious content, which is a side-effect in recent years. Just exclude your work directory from this scan during development. Compo machines will run without these scanners too, but it is good practice to include a (slightly larger) safe version too in the final archive.

Frameworks

4K intros for Windows (with sourcecode)

Other Resources