Difference between revisions of "4K Intro"

From SizeCoding
Jump to: navigation, search
(Created page with "== Introduction == This category is dedicated to 4K Intros for Windows Win32 === Setup === TBA === Graphics === * Setting up a OpenGL Window * Initialising GLSL Shader * ==...")
 
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
 
This category is dedicated to 4K Intros for Windows Win32
 
This category is dedicated to 4K Intros for Windows Win32
 +
 +
Windows 4K Intros can be setup in C or Assembler, or a combination of both, with only the few windows calls that are used being linked in.
 +
In general writing everything in assembler should give you a little more freedom in pushing/popping your function arguments and register usage, but in the past quality intros have been written in both languages.
 +
 +
Graphics are usualy done using OpenGL / GLSL, but there are 4K intros out there that have used D3D/DX11 instead.
 +
 +
=== 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 / Alternatively: NASM Assembler
 +
* Optional: Local/Online GLSL Shader editing environment (e.g. Shadertoy, Kodelife, bonzo, etc.)
  
 
=== Setup ===
 
=== Setup ===
Line 11: Line 24:
  
 
=== Sound ===
 
=== Sound ===
 +
* Softsynth - Sointu ( https://github.com/vsariola/sointu/ )
 +
* Softsynth - 4klang ( http://4klang.untergrund.net/ )
 +
* Softsynth - Oidos ( https://github.com/askeksa/Oidos )
 +
* Softsynth - Clinkster ( https://demozoo.org/productions/96592/ )
 +
* GLSL Softsynth
 
* Win32 MIDI
 
* Win32 MIDI
* Bytebeat softsynth
 
  
 
=== Compression ===
 
=== Compression ===
* Crinkler
+
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.
* Microsoft CAB/LZ Compression
+
 
 +
==== Crinkler reports ====
 +
When using the <code>/REPORT:intro_report.html</code> 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 ==
 
== Frameworks ==
Line 22: Line 45:
 
* [https://github.com/in4k/isystem1k4k IQ's 1k/4k frameworks]
 
* [https://github.com/in4k/isystem1k4k IQ's 1k/4k frameworks]
 
* [https://github.com/psycholns/TinyDX11 Psycho's 1k/4k framework]
 
* [https://github.com/psycholns/TinyDX11 Psycho's 1k/4k framework]
 
+
* [http://www.kameli.net/compofillerstudio/ Compofiller studio]
 +
* [https://github.com/yosshin4004/minimal_gl Minimal gl framework]
  
 
== 4K intros for Windows ==
 
== 4K intros for Windows ==
 
* [https://demozoo.org/productions/200150/ TBA]
 
* [https://demozoo.org/productions/200150/ TBA]
 +
 +
 +
== Other Resources ==
 +
* [https://www.codeslow.com/2020/07/writing-winning-4k-intro-in-rust.html] Article about writing a 4k intro using Rust
 +
* [https://in4k.github.io/wiki/aulds-4k-synth] Article about writing a softsynth

Revision as of 14:19, 13 April 2024

Introduction

This category is dedicated to 4K Intros for Windows Win32

Windows 4K Intros can be setup in C or Assembler, or a combination of both, with only the few windows calls that are used being linked in. In general writing everything in assembler should give you a little more freedom in pushing/popping your function arguments and register usage, but in the past quality intros have been written in both languages.

Graphics are usualy done using OpenGL / GLSL, but there are 4K intros out there that have used D3D/DX11 instead.

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 / Alternatively: NASM Assembler
  • Optional: Local/Online GLSL Shader editing environment (e.g. Shadertoy, Kodelife, bonzo, etc.)

Setup

TBA

Graphics

  • Setting up a OpenGL Window
  • Initialising GLSL Shader

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


Other Resources

  • [1] Article about writing a 4k intro using Rust
  • [2] Article about writing a softsynth