├── Readme.txt
├── .gitignore
├── Thumbnail.jpg
├── audio
├── 4klang.mp3
├── 4klang.h
├── 4klang.inc
└── 4klang.asm
├── scripts
├── directories.js
├── .eslintrc.yml
├── spawn-promise.js
├── convert.js
└── build.js
├── shaders
├── beat.stoy
├── shader.preset
├── shader.glsl
└── shader.stoy
├── src
├── window.hpp
├── audio.hpp
├── time.hpp
├── gl.hpp
├── shots.hpp
└── intro.cpp
├── package.json
├── config.yml
└── Readme.md
/Readme.txt:
--------------------------------------------------------------------------------
1 | Those Who Leave
2 | by Koltes, Ponk, Unix
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .settings/
2 | build/
3 | dist/
4 | node_modules/
5 | .cproject
6 | .project
7 |
--------------------------------------------------------------------------------
/Thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KoltesDigital/Those-Who-Leave/HEAD/Thumbnail.jpg
--------------------------------------------------------------------------------
/audio/4klang.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KoltesDigital/Those-Who-Leave/HEAD/audio/4klang.mp3
--------------------------------------------------------------------------------
/scripts/directories.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | exports.audioDirectory = 'audio';
4 | exports.buildDirectory = 'build';
5 | exports.distDirectory = 'dist';
6 | exports.shadersDirectory = 'shaders';
7 | exports.srcDirectory = 'src';
8 |
--------------------------------------------------------------------------------
/shaders/beat.stoy:
--------------------------------------------------------------------------------
1 | uniform float synth_Time;
2 | uniform float BPM; //! slider[10, 100, 200]
3 | #define Beat (synth_Time*BPM/60.)
4 |
5 | // begin
6 |
7 | void main() {
8 | gl_FragColor = vec4(fract(Beat));
9 | }
10 |
--------------------------------------------------------------------------------
/scripts/.eslintrc.yml:
--------------------------------------------------------------------------------
1 | env:
2 | es6: true
3 | node: true
4 | extends: 'eslint:recommended'
5 | rules:
6 | indent:
7 | - error
8 | - tab
9 | no-console: off
10 | quotes:
11 | - error
12 | - single
13 | semi:
14 | - error
15 | - always
16 |
--------------------------------------------------------------------------------
/src/window.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | static const PIXELFORMATDESCRIPTOR pfd = {
4 | sizeof(PIXELFORMATDESCRIPTOR),
5 | 1,
6 | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
7 | PFD_TYPE_RGBA,
8 | 32,
9 | 0,
10 | 0,
11 | 0,
12 | 0,
13 | 0,
14 | 0,
15 | 8,
16 | 0,
17 | 0,
18 | 0,
19 | 0,
20 | 0,
21 | 0,
22 | 32,
23 | 0,
24 | 0,
25 | PFD_MAIN_PLANE,
26 | 0,
27 | 0,
28 | 0,
29 | 0,
30 | };
31 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "flower",
4 | "version": "1.0.0",
5 | "description": "4k for evoke 2017.",
6 | "main": "build-shader-header.js",
7 | "scripts": {
8 | "build": "node scripts/build.js",
9 | "convert": "node scripts/convert.js",
10 | "watch": "nodemon -e cpp,h,hpp,js,preset,stoy,yml -i build scripts/build.js"
11 | },
12 | "dependencies": {
13 | "glsl-unit": "^0.0.7",
14 | "js-yaml": "^3.9.1",
15 | "make-dir": "^1.0.0",
16 | "node-notifier": "^5.1.2",
17 | "nodemon": "^1.11.0",
18 | "rimraf-promise": "^2.0.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/scripts/spawn-promise.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { spawn } = require('child_process');
4 |
5 | module.exports = function(command, args, options) {
6 | return new Promise((resolve, reject) => {
7 | const cp = spawn(command, args, options);
8 |
9 | cp.stdout.on('data', (data) => {
10 | console.log(data.toString());
11 | });
12 |
13 | cp.stderr.on('data', (data) => {
14 | console.error(data.toString());
15 | });
16 |
17 | cp.on('close', (code, signal) => {
18 | if (code)
19 | return reject(new Error(command + ' exited with code ' + code + '.'));
20 | else if (signal)
21 | return reject(new Error(command + ' was stopped by signal ' + signal + '.'));
22 | else
23 | return resolve();
24 | });
25 | });
26 | };
27 |
--------------------------------------------------------------------------------
/src/audio.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | static SAMPLE_TYPE soundBuffer[MAX_SAMPLES * 2];
4 | static HWAVEOUT waveOut;
5 |
6 | #pragma data_seg(".wavefmt")
7 | static const WAVEFORMATEX waveFormat = {
8 | #ifdef FLOAT_32BIT
9 | WAVE_FORMAT_IEEE_FLOAT,
10 | #else
11 | WAVE_FORMAT_PCM,
12 | #endif
13 | 2, // channels
14 | SAMPLE_RATE, // samples per sec
15 | SAMPLE_RATE * sizeof(SAMPLE_TYPE) * 2, // bytes per sec
16 | sizeof(SAMPLE_TYPE) * 2, // block alignment;
17 | sizeof(SAMPLE_TYPE) * 8, // bits per sample
18 | 0, // extension not needed
19 | };
20 |
21 | #pragma data_seg(".wavehdr")
22 | static WAVEHDR waveHDR = {
23 | (LPSTR)soundBuffer,
24 | MAX_SAMPLES * sizeof(SAMPLE_TYPE) * 2, // MAX_SAMPLES*sizeof(float)*2(stereo)
25 | 0,
26 | 0,
27 | 0,
28 | 0,
29 | 0,
30 | 0,
31 | };
32 |
33 | static MMTIME mmTime = {
34 | TIME_SAMPLES,
35 | 0,
36 | };
37 |
--------------------------------------------------------------------------------
/config.yml:
--------------------------------------------------------------------------------
1 | # capture:
2 | # width: 1280
3 | # height: 720
4 | # fps: 30
5 | # duration: 128
6 | constantsPreset: Default
7 | distFile: those-who-leave-by-koltes-ponk-unix/those-who-leave.exe
8 | # forceResolution:
9 | # width: 1920
10 | # height: 1080
11 | globals:
12 | float:
13 | - currentHeight
14 | - hash
15 | - stepIndex
16 | - TAU = 6.283
17 | shaderFile: shader.stoy
18 | uniforms:
19 | - Beat
20 | - EndCameraAnglesX
21 | - EndCameraAnglesY
22 | - EndCameraAnglesZ
23 | - EndCameraPositionX
24 | - EndCameraPositionY
25 | - EndCameraPositionZ
26 | - EndSeedPositionX
27 | - EndSeedPositionY
28 | - EndSeedPositionZ
29 | - StartCameraAnglesX
30 | - StartCameraAnglesY
31 | - StartCameraAnglesZ
32 | - StartCameraPositionX
33 | - StartCameraPositionY
34 | - StartCameraPositionZ
35 | - StartSeedPositionX
36 | - StartSeedPositionY
37 | - StartSeedPositionZ
38 | - StartEndRatio
39 |
--------------------------------------------------------------------------------
/audio/4klang.h:
--------------------------------------------------------------------------------
1 | // some useful song defines for 4klang
2 | #define SAMPLE_RATE 44100
3 | #define BPM 100.000000
4 | #define MAX_INSTRUMENTS 5
5 | #define MAX_PATTERNS 53
6 | #define PATTERN_SIZE_SHIFT 4
7 | #define PATTERN_SIZE (1 << PATTERN_SIZE_SHIFT)
8 | #define MAX_TICKS (MAX_PATTERNS*PATTERN_SIZE)
9 | #define SAMPLES_PER_TICK 6615
10 | #define MAX_SAMPLES (SAMPLES_PER_TICK*MAX_TICKS)
11 | #define POLYPHONY 2
12 | #define FLOAT_32BIT
13 | #define SAMPLE_TYPE float
14 |
15 | #define WINDOWS_OBJECT
16 |
17 | // declaration of the external synth render function, you'll always need that
18 | extern "C" void __stdcall _4klang_render(void*);
19 | // declaration of the external envelope buffer. access only if you're song was exported with that option
20 | extern "C" float _4klang_envelope_buffer;
21 | // declaration of the external note buffer. access only if you're song was exported with that option
22 | extern "C" int _4klang_note_buffer;
23 |
--------------------------------------------------------------------------------
/scripts/convert.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { audioDirectory, distDirectory } = require('./directories');
4 | const { readFileSync } = require('fs');
5 | const { safeLoad } = require('js-yaml');
6 | const { dirname, join } = require('path');
7 | const spawnPromise = require('./spawn-promise');
8 |
9 | const config = safeLoad(readFileSync('config.yml'));
10 |
11 | spawnPromise('ffmpeg', [
12 | '-y',
13 | '-f',
14 | 'image2',
15 | '-r',
16 | config.capture.fps,
17 | '-s',
18 | config.capture.width + 'x' + config.capture.height,
19 | '-pix_fmt',
20 | 'rgb24',
21 | '-start_number',
22 | '0',
23 | '-i',
24 | join(distDirectory, dirname(config.distFile), 'frame%05d.raw'),
25 | '-i',
26 | join(audioDirectory, '4klang.mp3'),
27 | '-vf',
28 | 'vflip',
29 | '-codec:v',
30 | 'libx264',
31 | '-crf',
32 | '18',
33 | '-bf',
34 | '2',
35 | '-flags',
36 | '+cgop',
37 | '-pix_fmt',
38 | 'yuv420p',
39 | '-codec:a',
40 | 'aac',
41 | '-strict',
42 | '-2',
43 | '-b:a',
44 | '384k',
45 | '-movflags',
46 | 'faststart',
47 | join(distDirectory, 'intro.mp4'),
48 | ])
49 | .catch(console.error);
50 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Those Who Leave
2 |
3 | PC 4k intro, released at evoke 2017.
4 |
5 |
6 |
7 | ## Credits
8 |
9 | [Koltes](https://github.com/KoltesDigital): direction, optimization, toolchain.
10 |
11 | [Ponk](https://github.com/leon196): art, modeling.
12 |
13 | [Unix](https://github.com/unixdal): music.
14 |
15 | ## Demoscene is a big family
16 |
17 | Framework derived from [wsmind](https://github.com/wsmind) and [halcy](https://github.com/halcy/), themselves took from iq...
18 |
19 | Shader contains snippets from IQ, Mercury, LJ, Duke...
20 |
21 | ## Build instructions
22 |
23 | Requirements:
24 |
25 | 1. Windows only.
26 | 2. [Visual Studio](https://www.visualstudio.com/) for the C++ compiler.
27 | 3. [NASM](http://www.nasm.us) for the ASM compiler.
28 | 4. [Crinkler](http://www.crinkler.net/) for the linker, unzipped somewhere and available in the PATH.
29 | 5. [Node.js](https://nodejs.org/) for the toolchain.
30 |
31 | Open a *VS x86 tools prompt* and execute:
32 |
33 | npm install
34 | npm run build
35 |
36 | ## Development
37 |
38 | Shaders are developed within [Synthclipse](http://synthclipse.sourceforge.net/).
39 |
40 | In order to automatically build when a file changes, execute:
41 |
42 | npm run watch
43 |
--------------------------------------------------------------------------------
/src/time.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef CAPTURE_FRAMES
4 |
5 | static int frameNumber;
6 | static HANDLE frameFile;
7 | static DWORD frameBytesWritten;
8 | static char *frameBuffer;
9 |
10 | static char *frameFilename(int n)
11 | {
12 | static char *name = "frame00000.raw";
13 | char *ptr = name + 9;
14 |
15 | while (n > 0)
16 | {
17 | *ptr-- = (n - (n / 10) * 10) + '0';
18 | n /= 10;
19 | }
20 |
21 | return name;
22 | }
23 |
24 | static void startTime()
25 | {
26 | frameNumber = 0;
27 | frameBuffer = (char *)HeapAlloc(GetProcessHeap(), 0, width * height * 3 /* RGB8 */);
28 | }
29 |
30 | static float getTime()
31 | {
32 | return frameNumber / captureFPS;
33 | }
34 |
35 | #define capture() \
36 | glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, frameBuffer); \
37 | frameFile = CreateFile(frameFilename(frameNumber), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); \
38 | if (frameFile) \
39 | { \
40 | WriteFile(frameFile, frameBuffer, width * height * 3, &frameBytesWritten, NULL); \
41 | CloseHandle(frameFile); \
42 | } \
43 | frameNumber++; \
44 | if (getTime() >= captureDuration) \
45 | break
46 |
47 | #else
48 |
49 | static void startTime()
50 | {
51 | }
52 |
53 | static float getTime()
54 | {
55 | waveOutGetPosition(waveOut, &mmTime, sizeof(MMTIME));
56 | return (float)mmTime.u.sample / (float)SAMPLE_RATE;
57 | }
58 |
59 | static void capture()
60 | {
61 | }
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/src/gl.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // relevant glext.h fragment
4 | #define APIENTRYP __stdcall *
5 | typedef char GLchar;
6 | #define GL_FRAGMENT_SHADER 0x8B30
7 | typedef void(APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
8 | typedef void(APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader);
9 | typedef GLuint(APIENTRYP PFNGLCREATEPROGRAMPROC)(void);
10 | typedef GLuint(APIENTRYP PFNGLCREATESHADERPROC)(GLenum type);
11 | typedef void(APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program);
12 | typedef void(APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length);
13 | typedef void(APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program);
14 | typedef void(APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat *value);
15 | // end of glext.h fragment
16 |
17 | #define GL_EXT_FUNCTION_COUNT 8
18 |
19 | static const char *glExtFunctionNames[] = {
20 | "glAttachShader",
21 | "glCompileShader",
22 | "glCreateProgram",
23 | "glCreateShader",
24 | "glLinkProgram",
25 | "glShaderSource",
26 | "glUseProgram",
27 | "glUniform1fv",
28 | };
29 |
30 | static void *glExtFunctions[GL_EXT_FUNCTION_COUNT];
31 |
32 | #define glAttachShader ((PFNGLATTACHSHADERPROC)glExtFunctions[0])
33 | #define glCompileShader ((PFNGLCOMPILESHADERPROC)glExtFunctions[1])
34 | #define glCreateProgram ((PFNGLCREATEPROGRAMPROC)glExtFunctions[2])
35 | #define glCreateShader ((PFNGLCREATESHADERPROC)glExtFunctions[3])
36 | #define glLinkProgram ((PFNGLLINKPROGRAMPROC)glExtFunctions[4])
37 | #define glShaderSource ((PFNGLSHADERSOURCEPROC)glExtFunctions[5])
38 | #define glUseProgram ((PFNGLUSEPROGRAMPROC)glExtFunctions[6])
39 | #define glUniform1fv ((PFNGLUNIFORM1FVPROC)glExtFunctions[7])
40 |
--------------------------------------------------------------------------------
/src/shots.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct Shot
4 | {
5 | float endBeat;
6 | float startCameraPosition[3];
7 | float startCameraAngles[3];
8 | float endCameraPosition[3];
9 | float endCameraAngles[3];
10 | float startSeedPosition[3];
11 | float endSeedPosition[3];
12 | };
13 |
14 | static Shot shots[] = {
15 | {
16 | 24,
17 | { 0.f, 8.f, -16.f },
18 | { -.8f, 0.f, 0.f },
19 | { 0.f, 4.f, -12.f },
20 | { 0.3f, 0.f, 0.f },
21 | { 0.f, 0.f, -16.f },
22 | { 0.f, 0.f, -16.f },
23 | },
24 | {
25 | 32,
26 | { -3.5f, 1.8f, -3.3f },
27 | { 0.2f, -0.4f, 0.f },
28 | { -3.5f, 1.8f, -3.3f },
29 | { 0.2f, -1.f, 0.f },
30 | { 0.f, 0.f, -16.f },
31 | { 0.f, 0.f, -16.f },
32 | },
33 | {
34 | 44,
35 | { 0.5f, -0.7f, -8.f },
36 | { -0.2f, -0.2f, 0.f },
37 | { -0.2f, 1.f, -3.f },
38 | { 0.2f, 0.f, 0.f },
39 | { 7.f, .5f, 2.5f },
40 | { 0.f, 1.f, 0.f },
41 | },
42 | {
43 | 64,
44 | { 0.0f, 0.f, -2.f },
45 | { 0.f, -0.4f, .3f },
46 | { 0.0f, 3.f, -3.f },
47 | { 0.8f, 0.f, 0.f },
48 | { 0.f, 1.f, 0.f },
49 | { 0.f, -3.f, 0.f },
50 | },
51 | {
52 | 76,
53 | { -2.f, -.1f, -12.f },
54 | { -0.2f, -.2f, 0.5f },
55 | { 2.f, 1.f, -8.f },
56 | { 0.2f, 0.2f, 0.2f },
57 | },
58 | {
59 | 88,
60 | { 0.f, 1.f, -1.f },
61 | { 0.7f, 0.f, 0.f },
62 | { 0.f, 1.f, -2.f },
63 | { -.8f, 0.f, 0.f },
64 | },
65 | {
66 | 104,
67 | { 0.f, 7.f, -1.f },
68 | { 1.4f, 0.f, 0.f },
69 | { 0.f, 9.f, -1.f },
70 | { 1.4f, 0.f, 0.f },
71 | },
72 | {
73 | 120,
74 | { 0.f, 2.f, -1.f },
75 | { -1.4f, 0.f, 0.5f },
76 | { 0.f, 8.f, -1.f },
77 | { -1.4f, 0.f, -0.5f },
78 | },
79 | {
80 | 136,
81 | { 0.f, 0.f, 6.f },
82 | { 0.2f, 3.14f, 0.f },
83 | { 0.f, 0.f, 3.f },
84 | { -1.2f, 3.14f, 0.f },
85 | },
86 | {
87 | 160,
88 | { 0.f, 14.f, -1.5f },
89 | { 1.4f, 0.f, 0.f },
90 | { 0.f, 26.f, -.2f },
91 | { 1.5f, 0.f, 0.f },
92 | },
93 | {
94 | 184,
95 | { 0.f, -5.f, -15.f },
96 | { -0.5f, 0.f, -0.5f },
97 | { 0.f, 28.f, -5.f },
98 | { 1.f, 0.f, 0.3f },
99 | { 0.f, 5.f, 0.f },
100 | { 0.f, 15.f, 0.f },
101 | },
102 | {
103 | 212,
104 | { 0.f, 22.f, -1.f },
105 | { 0.5f, 0.f, 0.f },
106 | { 0.f, 20.f, -8.f },
107 | { -0.5f, 0.f, 0.f },
108 | { 0.f, 20.f, 0.f },
109 | { 0.f, 24.f, 0.f },
110 | },
111 | };
112 |
--------------------------------------------------------------------------------
/shaders/shader.preset:
--------------------------------------------------------------------------------
1 | /*!
2 | *
3 | * BPM = <1.0|10.0|200.0> 100.0
4 | * CamHeight = <1.0|5.0|50.0> 21.0
5 | * CloudColor0 = <0.004, 0.004, 0.004> 0.6, 1.0, 1.0
6 | * CloudColor1 = <0.004, 0.004, 0.004> 0.2, 0.2, 0.4
7 | * Direction = <0.1, 0.1, 0.1> 0.46408966, -0.7117283, -0.5273175
8 | * DissolutionEnd = <1.0|0.0|300.0> 196.0
9 | * DissolutionStart = <1.0|0.0|300.0> 194.0
10 | * EndCameraAnglesX = <0.8|-8.0|8.0> 0.4
11 | * EndCameraAnglesY = <0.8|-8.0|8.0> 0.0
12 | * EndCameraAnglesZ = <0.8|-8.0|8.0> 0.0
13 | * EndCameraPositionX = <1.0|-10.0|10.0> -0.2
14 | * EndCameraPositionY = <1.0|-10.0|30.0> 2.0
15 | * EndCameraPositionZ = <1.0|-10.0|10.0> -3.0
16 | * EndSeedPositionX = <1.0|-10.0|10.0> -6.0
17 | * EndSeedPositionY = <1.0|-10.0|30.0> 1.0
18 | * EndSeedPositionZ = <1.0|-10.0|10.0> 1.0
19 | * EquiRectangular = false
20 | * Exposure = <0.5|0.0|16.0> 3.0
21 | * Eye = <1.0, 1.0, 1.0|-50.0, -50.0, -50.0|50.0, 50.0, 50.0> -4.7041225, 6.167966, 4.835952
22 | * FOV = <0.1|0.0|2.0> 0.4
23 | * FadeInEnd = <1.0|0.0|300.0> 8.0
24 | * FadeInStart = <1.0|0.0|300.0> 0.0
25 | * FadeOutEnd = <1.0|0.0|300.0> 212.0
26 | * FadeOutStart = <1.0|0.0|300.0> 204.0
27 | * FlowerColor0 = <0.004, 0.004, 0.004> 1.0, 0.5411765, 0.5411765
28 | * FlowerColor1 = <0.004, 0.004, 0.004> 1.0, 0.81960785, 0.8039216
29 | * FlowerEnd = <1.0|0.0|300.0> 160.0
30 | * FlowerStart = <1.0|0.0|300.0> 144.0
31 | * GroundBottomColor = <0.004, 0.004, 0.004> 0.3, 0.2, 0.1
32 | * GroundTopColor0 = <0.004, 0.004, 0.004> 0.0, 1.0, 1.0
33 | * GroundTopColor1 = <0.004, 0.004, 0.004> 0.0, 0.5019608, 1.0
34 | * Octaves = <0.5|0.0|10.0> 4.0
35 | * RootAmplitude = <0.25|0.0|5.0> 1.7
36 | * RootColor0 = <0.004, 0.004, 0.004> 1.0, 0.0, 0.1
37 | * RootColor1 = <0.004, 0.004, 0.004> 1.0, 0.6, 0.1
38 | * RootDamping = <0.25|0.0|1.5> 1.3
39 | * RootEnd = <1.0|0.0|300.0> 68.0
40 | * RootFadeDamping = <0.25|0.0|5.0> 0.6
41 | * RootFall = <0.5|0.0|10.0> 4.0
42 | * RootPulsation = <0.5|0.0|10.0> 2.6
43 | * RootStart = <1.0|0.0|300.0> 48.0
44 | * RootSubHelixStep = <0.5|0.0|10.0> 3.0
45 | * RootSubRadius = <0.015000001|0.0|0.3> 0.07
46 | * SeedColor = <0.004, 0.004, 0.004> 1.0, 1.0, 1.0
47 | * SkyColor0 = <0.004, 0.004, 0.004> 0.0, 0.0, 0.0
48 | * SkyColor1 = <0.004, 0.004, 0.004> 0.0, 0.019607844, 0.050980393
49 | * StarColor = <0.004, 0.004, 0.004> 0.1, 0.1, 0.1
50 | * StartCameraAnglesX = <0.8|-8.0|8.0> -0.2
51 | * StartCameraAnglesY = <0.8|-8.0|8.0> -0.2
52 | * StartCameraAnglesZ = <0.8|-8.0|8.0> 0.0
53 | * StartCameraPositionX = <1.0|-10.0|10.0> 0.5
54 | * StartCameraPositionY = <1.0|-10.0|30.0> -0.7
55 | * StartCameraPositionZ = <1.0|-10.0|10.0> -8.0
56 | * StartEndRatio = <0.05|0.0|1.0> *AX* \
57 | * AWYBTk8AAARzMAAAAAAAAAYvMD+AAAA=
58 | * StartSeedPositionX = <1.0|-10.0|10.0> -4.0
59 | * StartSeedPositionY = <1.0|-10.0|30.0> 1.0
60 | * StartSeedPositionZ = <1.0|-10.0|10.0> 9.0
61 | * StemColor0 = <0.004, 0.004, 0.004> 1.0, 0.0, 0.7
62 | * StemColor1 = <0.004, 0.004, 0.004> 1.0, 0.6, 0.0
63 | * StemEnd = <1.0|0.0|300.0> 160.0
64 | * StemGrowFactor = <1.0|0.0|300.0> 0.25
65 | * StemMaxHeight = <1.0|0.0|300.0> 20.0
66 | * StemRadius = <0.05|0.0|1.0> 0.15
67 | * StemStart = <1.0|0.0|300.0> 78.0
68 | * Steps = <1.0|5.0|50.0> 50.0
69 | * SynthclipseCamera = false
70 | * Up = <0.1, 0.1, 0.1> 0.13053678, 0.64376163, -0.75401
71 | *
72 | */
--------------------------------------------------------------------------------
/shaders/shader.glsl:
--------------------------------------------------------------------------------
1 |
2 | uniform vec2 synth_Resolution;
3 | uniform float synth_Time;
4 | uniform mat4 synth_ViewMatrix;
5 |
6 | //!
7 | uniform float BPM; //! slider[10, 100, 200]
8 | #define Beat (synth_Time*BPM/60.)
9 |
10 | //!
11 | uniform float CamHeight; //! slider[5, 21, 50]
12 | uniform float Octaves; //! slider[0, 4, 10]
13 | uniform vec3 GroundTopColor0; //! color[1, 1, 1]
14 | uniform vec3 GroundTopColor1; //! color[1, 1, 1]
15 | uniform vec3 GroundBottomColor; //! color[1, 1, 1]
16 | uniform vec3 SeedColor; //! color[1, 1, 1]
17 | uniform vec3 RootColor0; //! color[1, 1, 1]
18 | uniform vec3 RootColor1; //! color[1, 1, 1]
19 | uniform float RootFadeDamping; //! slider[0, .5, 5]
20 | uniform float RootAmplitude; //! slider[0, .5, 5]
21 | uniform float RootPulsation; //! slider[0, 5, 10]
22 | uniform float RootDamping; //! slider[0, .5, 50]
23 | uniform float RootSubRadius; //! slider[0, .05, .3]
24 | uniform float RootSubHelixStep; //! slider[0, 5, 10]
25 | uniform float RootFall; //! slider[0, 5, 10]
26 | uniform vec3 StemColor0; //! color[1, 1, 1]
27 | uniform vec3 StemColor1; //! color[1, 1, 1]
28 | uniform float StemRadius; //! slider[0, .5, 1]
29 | uniform float StemGrowFactor; //! slider[0, 20, 300]
30 | uniform float StemMaxHeight; //! slider[0, 20, 300]
31 | uniform vec3 FlowerColor0; //! color[1, 1, 1]
32 | uniform vec3 FlowerColor1; //! color[1, 1, 1]
33 | uniform float Exposure; //! slider[0, 5, 10]
34 | uniform vec3 CloudColor0; //! color[1, 1, 1]
35 | uniform vec3 CloudColor1; //! color[1, 1, 1]
36 | uniform vec3 SkyColor0; //! color[1, 1, 1]
37 | uniform vec3 SkyColor1; //! color[1, 1, 1]
38 | uniform vec3 StarColor; //! color[1, 1, 1]
39 |
40 | //!
41 | uniform float Steps; //! slider[5, 10, 50]
42 |
43 | //!
44 | uniform bool SynthclipseCamera; //! checkbox[false]
45 | uniform float StartEndRatio; //! slider[0, 0.5, 1]
46 | uniform float StartCameraPositionX; //! slider[-10, 0, 10]
47 | uniform float StartCameraPositionY; //! slider[-10, 0, 30]
48 | uniform float StartCameraPositionZ; //! slider[-10, 0, 10]
49 | uniform float StartCameraAnglesX; //! slider[-8, 0, 8]
50 | uniform float StartCameraAnglesY; //! slider[-8, 0, 8]
51 | uniform float StartCameraAnglesZ; //! slider[-8, 0, 8]
52 | uniform float EndCameraPositionX; //! slider[-10, 0, 10]
53 | uniform float EndCameraPositionY; //! slider[-10, 0, 30]
54 | uniform float EndCameraPositionZ; //! slider[-10, 0, 10]
55 | uniform float EndCameraAnglesX; //! slider[-8, 0, 8]
56 | uniform float EndCameraAnglesY; //! slider[-8, 0, 8]
57 | uniform float EndCameraAnglesZ; //! slider[-8, 0, 8]
58 | uniform float StartSeedPositionX; //! slider[-10, 0, 10]
59 | uniform float StartSeedPositionY; //! slider[-10, 0, 30]
60 | uniform float StartSeedPositionZ; //! slider[-10, 0, 10]
61 | uniform float EndSeedPositionX; //! slider[-10, 0, 10]
62 | uniform float EndSeedPositionY; //! slider[-10, 0, 30]
63 | uniform float EndSeedPositionZ; //! slider[-10, 0, 10]
64 |
65 | //!
66 | uniform float FadeInStart; //! slider[0, 0.1, 300]
67 | uniform float FadeInEnd; //! slider[0, 1, 300]
68 | uniform float RootStart; //! slider[0, 5.1, 300]
69 | uniform float RootEnd; //! slider[0, 15, 300]
70 | uniform float StemStart; //! slider[0, 7.2, 300]
71 | uniform float StemEnd; //! slider[0, 87.2, 300]
72 | uniform float FlowerStart; //! slider[0, 70, 300]
73 | uniform float FlowerEnd; //! slider[0, 100, 300]
74 | uniform float DissolutionStart; //! slider[0, 102, 300]
75 | uniform float DissolutionEnd; //! slider[0, 118, 300]
76 | uniform float FadeOutStart; //! slider[0, 120, 300]
77 | uniform float FadeOutEnd; //! slider[0, 124, 300]
78 |
--------------------------------------------------------------------------------
/src/intro.cpp:
--------------------------------------------------------------------------------
1 | #define WIN32_LEAN_AND_MEAN
2 | #define WIN32_EXTRA_LEAN
3 | #include
4 |
5 | #include
6 | #include
7 | #include
8 |
9 | #define HALF_SCREEN
10 |
11 | #include