Alcatraz 8kode
=========
A framework for developing 8k intros.
Initial setup:
1) Start Visual Studio 2013 and open 8kode.sln
2) Right click your solution and choose "Set StartUp Projects..."
3) Under Common Properties -> Startup Project, choose "Multiple startup projects"
4) Set both "intro" and "tool" to Start.
5) Click "OK"
6) Set your build configuration to "Authoring"
7) Hit F5 and enjoy.
Interface:
8kode's interface is very similar to Blender 2.5.
If you're unfamiliar with it, please have a look at http://vimeo.com/19628478 starting from 1:59
You can set up multiple views of the same data, and you can split, resize and merge views as you need.
Layouts can be saved and loaded using the Layouts menu.
Intro navigation:
You can move through time by clicking and dragging in the Audio view.
The seek positions snap to intro "scenes".
A scene is defined by SOUND_TICKS_PER_SCENE * SAMPLES_PER_TICK samples.
The preconfigured SOUND_TICKS_PER_SCENE is 64 ticks and SAMPLES_PER_TICK is provided by 4klang.h
File and folder structure:
The intro coder musn't take care of the src\intro\framework folder.
Shaders are inside src\intro\shaders, intro code is inside src\intro\intro.
Put your intro init code in src\intro\intro\init.h and your per-frame code in src\intro\intro\update.h.
Variables and such can be put in src\intro\intro\data.h
Shader compiler tool (shc):
8kode comes with a shader preprocessor. It has 2 main purposes:
1) Resolve all #includes, so that Ctrl+Alt+Test's shader minifier can minify everything together
2) Automatically generate C++ code with ready-to-use DirectX shader pointers
In order to have autogenerated shader pointers, you can use an [EntryPoint(foo)] attribute on your HLSL function.
This will signal shc that this function is an entry point, and it will create a corresponding IID3D11FooShader* pointer.
Obviously you should replace foo with the correct shader profile name (e.g. vs, ps, cs).
Example:
[numthreads(16, 16, 1)]
[entrypoint(cs)]
void colorPattern(uint3 id:SV_DispatchThreadID)
{
float2 resolution;
out0.GetDimensions(resolution.x, resolution.y);
out0[id.xy] = float4(id.xy / resolution, 0.5, 1.0);
}
When compiling with shc, it will generate corresponding code and provide a ID3D11ComputeShader* cs_colorPattern pointer.
The coder can use that pointer immediately in the intro code.
8kode's authoring tool allows instant shader compilation with the shortcut Ctrl+Enter. It invokes shc, which in turn:
1) generates intro\framework\codegen\shaders_shc.g.h, containing all entry point shader pointers and compile code for the intro
2) runs Ctrl+Alt+Test's shader minifier and outputs the minified shader to intro\framework\codegen\intro_hlsl.g.h
3) recompiles every entry point that was present at the last intro compile time. If entry points changed, a tool restart is required.
All shader compilation errors are marked in the code view as line decorations. Hovering over marked lines will display a tooltip
with the errors in that line.