-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
2,026 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "CMake: launch current target", | ||
"type": "shell", | ||
"command": "${command:cmake.launchTargetPath}", | ||
"args": [], | ||
"group": "build", | ||
"dependsOn": "CMake: build", | ||
}, | ||
{ | ||
"type": "cmake", | ||
"label": "CMake: build", | ||
"command": "build", | ||
"targets": [ | ||
"asteroids" | ||
], | ||
"preset": "${command:cmake.activeBuildPresetName}", | ||
"group": "build", | ||
"problemMatcher": [], | ||
"detail": "CMake template build task" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"oldParams": true, | ||
"wave_type": 3, | ||
"p_env_attack": 0, | ||
"p_env_sustain": 0.3400512095246295, | ||
"p_env_punch": 0.48519889379528036, | ||
"p_env_decay": 0.3972516406875707, | ||
"p_base_freq": 0.05054721600947243, | ||
"p_freq_limit": 0, | ||
"p_freq_ramp": -0.008087208760721859, | ||
"p_freq_dramp": 0, | ||
"p_vib_strength": 0, | ||
"p_vib_speed": 0, | ||
"p_arp_mod": 0, | ||
"p_arp_speed": 0, | ||
"p_duty": 0, | ||
"p_duty_ramp": 0, | ||
"p_repeat_speed": 0.5865777415692228, | ||
"p_pha_offset": 0, | ||
"p_pha_ramp": 0, | ||
"p_lpf_freq": 1, | ||
"p_lpf_ramp": 0, | ||
"p_lpf_resonance": 0, | ||
"p_hpf_freq": 0, | ||
"p_hpf_ramp": 0, | ||
"sound_vol": 0.25, | ||
"sample_rate": 44100, | ||
"sample_size": 16 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"oldParams": true, | ||
"wave_type": 0, | ||
"p_env_attack": 0, | ||
"p_env_sustain": 0.186, | ||
"p_env_punch": 0.14416162357904438, | ||
"p_env_decay": 0.359, | ||
"p_base_freq": 0.515, | ||
"p_freq_limit": 0.134, | ||
"p_freq_ramp": -0.2619783169500224, | ||
"p_freq_dramp": 0, | ||
"p_vib_strength": 0.283, | ||
"p_vib_speed": 1, | ||
"p_arp_mod": -0.053, | ||
"p_arp_speed": 0, | ||
"p_duty": 0.718, | ||
"p_duty_ramp": -0.158, | ||
"p_repeat_speed": 0, | ||
"p_pha_offset": 0.189, | ||
"p_pha_ramp": -0.234, | ||
"p_lpf_freq": 1, | ||
"p_lpf_ramp": 0, | ||
"p_lpf_resonance": 0, | ||
"p_hpf_freq": 0.126, | ||
"p_hpf_ramp": 0, | ||
"sound_vol": 0.25, | ||
"sample_rate": 44100, | ||
"sample_size": 16 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"oldParams": true, | ||
"wave_type": 1, | ||
"p_env_attack": 0, | ||
"p_env_sustain": 0.103, | ||
"p_env_punch": 0.254, | ||
"p_env_decay": 0.76, | ||
"p_base_freq": 0.605, | ||
"p_freq_limit": 0.185, | ||
"p_freq_ramp": -0.285, | ||
"p_freq_dramp": 0.06, | ||
"p_vib_strength": 0.361, | ||
"p_vib_speed": 0, | ||
"p_arp_mod": -0.712, | ||
"p_arp_speed": 0, | ||
"p_duty": 0.26, | ||
"p_duty_ramp": 0.647, | ||
"p_repeat_speed": 0, | ||
"p_pha_offset": -0.007, | ||
"p_pha_ramp": -0.024, | ||
"p_lpf_freq": 1, | ||
"p_lpf_ramp": 0, | ||
"p_lpf_resonance": 0, | ||
"p_hpf_freq": 0.021623842742273, | ||
"p_hpf_ramp": 0, | ||
"sound_vol": 0.25, | ||
"sample_rate": 44100, | ||
"sample_size": 16 | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#version 330 | ||
|
||
precision mediump float; | ||
|
||
in vec2 fragTexCoord; | ||
in vec4 fragColor; | ||
out vec4 finalColor; | ||
uniform sampler2D texture0; | ||
uniform vec4 colDiffuse; | ||
|
||
uniform float aberration; | ||
|
||
#define USE_CHROMATIC_ABERRATION | ||
#define USE_BLOOM | ||
#define USE_GAMMA_CORRECTION | ||
#define USE_SATURATION | ||
#define USE_CONTRAST | ||
#define USE_BRIGHTNESS | ||
#define USE_PIXELATION | ||
|
||
void applyPixelation(inout vec2 normalizedFragTexCoord) { | ||
#ifdef USE_PIXELATION | ||
float pixelation = 0.005; | ||
float pixelationIntensity = pow(aberration, 1.0 / 2.0) * 0.5; | ||
|
||
vec2 pixelatedFragTexCoord = floor(normalizedFragTexCoord / pixelation) * pixelation; | ||
normalizedFragTexCoord = mix(normalizedFragTexCoord, pixelatedFragTexCoord, pixelationIntensity); | ||
#endif | ||
} | ||
|
||
void applyChromaticAberration(inout vec4 texelColor, in vec2 normalizedFragTexCoord, in vec2 texelSize) { | ||
#ifdef USE_CHROMATIC_ABERRATION | ||
float edgeFactor = max(length(normalizedFragTexCoord - 0.5) * 2.0, 0.35); | ||
float aberrationIntensity = edgeFactor * aberration * 1.5; | ||
vec2 aberrationOffset = vec2(aberrationIntensity, -aberrationIntensity); | ||
float red = texture(texture0, normalizedFragTexCoord + aberrationOffset * texelSize).r; | ||
float green = texture(texture0, normalizedFragTexCoord).g; | ||
float blue = texture(texture0, normalizedFragTexCoord - aberrationOffset * texelSize).b; | ||
texelColor.rgb = vec3(red, green, blue); | ||
#endif | ||
} | ||
|
||
void applyGammaCorrection(inout vec4 texelColor) { | ||
#ifdef USE_GAMMA_CORRECTION | ||
float gammmaCorrectionIntensity = 0.25; | ||
texelColor.rgb = mix(texelColor.rgb, pow(texelColor.rgb, vec3(1.0 / 2.2)), gammmaCorrectionIntensity); | ||
#endif | ||
} | ||
|
||
void applyBloom(inout vec4 texelColor, in vec2 normalizedFragTexCoord, in vec2 texelSize) { | ||
#ifdef USE_BLOOM | ||
float bloomIntensity = 0.95; | ||
float bloomThreshold = 0.60; | ||
int bloomRadius = 4; | ||
vec4 bloomColor = vec4(0.0); | ||
for (int i = -bloomRadius; i <= bloomRadius; i++) { | ||
for (int j = -bloomRadius; j <= bloomRadius; j++) { | ||
vec2 offset = vec2(i, j) * texelSize; | ||
vec4 bloomTexelColor = texture(texture0, normalizedFragTexCoord + offset); | ||
if (length(bloomTexelColor.rgb) > bloomThreshold) { | ||
bloomColor += bloomTexelColor; | ||
} | ||
} | ||
} | ||
bloomColor /= float((bloomRadius * 2 + 1) * (bloomRadius * 2 + 1)); | ||
// Tint the bloom color | ||
vec4 tint = vec4(1.0, 0.9, 0.7, 1.0); | ||
bloomColor *= tint; | ||
|
||
texelColor.rgb += bloomColor.rgb * bloomIntensity; | ||
#endif | ||
} | ||
|
||
void applySaturation(inout vec4 texelColor) { | ||
#ifdef USE_SATURATION | ||
float saturation = 1.25; | ||
float luminance = dot(texelColor.rgb, vec3(0.2126, 0.7152, 0.0722)); | ||
texelColor.rgb = mix(vec3(luminance), texelColor.rgb, saturation); | ||
#endif | ||
} | ||
|
||
void applyContrast(inout vec4 texelColor) { | ||
#ifdef USE_CONTRAST | ||
float contrast = 0.98; | ||
texelColor.rgb = (texelColor.rgb - 0.5) * pow(contrast, 2.0) + 0.5; | ||
#endif | ||
} | ||
|
||
void applyBrightness(inout vec4 texelColor) { | ||
#ifdef USE_BRIGHTNESS | ||
float brightness = 1.05; | ||
texelColor.rgb *= pow(brightness, 2.0); | ||
#endif | ||
} | ||
|
||
void main() { | ||
vec2 texelSize = 1.0 / textureSize(texture0, 0); | ||
// Flip vertically to match OpenGL's texture coordinate system | ||
vec2 normalizedFragTexCoord = vec2(fragTexCoord.x, 1.0 - fragTexCoord.y); | ||
|
||
applyPixelation(normalizedFragTexCoord); | ||
|
||
vec4 texelColor = texture(texture0, normalizedFragTexCoord); | ||
|
||
applyChromaticAberration(texelColor, normalizedFragTexCoord, texelSize); | ||
applyGammaCorrection(texelColor); | ||
applyBloom(texelColor, normalizedFragTexCoord, texelSize); | ||
|
||
applySaturation(texelColor); | ||
applyContrast(texelColor); | ||
applyBrightness(texelColor); | ||
|
||
finalColor = texelColor * colDiffuse * fragColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#version 330 | ||
|
||
precision mediump float; | ||
|
||
in vec2 fragTexCoord; | ||
in vec4 fragColor; | ||
out vec4 finalColor; | ||
uniform sampler2D texture0; | ||
uniform vec4 colDiffuse; | ||
|
||
uniform vec2 resolution; | ||
|
||
vec3 applyVignetteLinear(vec3 color) { | ||
// Apply vignette | ||
float radius = 0.95; | ||
float softness = 0.9999; | ||
float intensity = 0.6; | ||
vec2 position = gl_FragCoord.xy / resolution.xy; | ||
|
||
float vignette = smoothstep(radius, radius - softness, length(position - 0.5)); | ||
return mix(color, color * vignette, intensity); | ||
} | ||
|
||
void main() { | ||
// DEBUG: Render gl_FragCoord gradient | ||
// finalColor = vec4(gl_FragCoord.x / resolution.x, gl_FragCoord.y / resolution.y, 0.0, 1.0); return; | ||
|
||
finalColor = vec4(0.0, 0.06, 0.1, 1.0); | ||
|
||
// DEBUG: Apply gamma correction | ||
// finalColor.rgb = pow(finalColor.rgb, vec3(1.0 / 2.2)); | ||
|
||
// Apply vignette | ||
finalColor.rgb = applyVignetteLinear(finalColor.rgb); | ||
} |
Oops, something went wrong.