diff options
| author | hachem <im@hachem.wtf> | 2025-08-22 04:48:42 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-22 04:48:42 +0200 |
| commit | 77717ae7c4f7c8f180e5c5e24cf1098c02f3dbf4 (patch) | |
| tree | 61ef3218a5e1f46e13b10cea3141f2eeee81bd7c /assets/shaders/geodesic.glsl | |
| parent | 2dd07499241638e66ee0df97cba91219f5599151 (diff) | |
feat: add bloom and blur
Diffstat (limited to 'assets/shaders/geodesic.glsl')
| -rw-r--r-- | assets/shaders/geodesic.glsl | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/assets/shaders/geodesic.glsl b/assets/shaders/geodesic.glsl index eba7213..70e41ef 100644 --- a/assets/shaders/geodesic.glsl +++ b/assets/shaders/geodesic.glsl @@ -323,7 +323,10 @@ vec4 SampleDiskColor(vec3 pos) float brightness_medium = fbm(rotated_brightness_pos * 5.0, 2); float brightness_small = fbm(rotated_brightness_pos * 7.0, 2); float brightness_noise = (brightness_large * 0.6 + brightness_medium * 0.3 + brightness_small * 0.1); - float brightness = 1.0 + density * 1.0 + brightness_noise * 0.4; + + float baseBrightness = 1.0 + density * 1.5; + float glowBrightness = brightness_noise * 0.8; + float brightness = baseBrightness + glowBrightness; return vec4(baseColor * brightness, density); } @@ -413,14 +416,21 @@ void main() vec3 diskColor = diskSample.rgb; float stepLength = currentStepSize * 1e-8; - float absorption = density * stepLength * 1.2; - float scattering = density * stepLength * 0.8; + + float absorption = density * stepLength * 0.8; + float scattering = density * stepLength * 1.5; float extinction = absorption + scattering; float stepTransmittance = exp(-extinction); - vec3 emission = diskColor * density * stepLength * 2.5 * sqrt(disk_density); - accumulatedColor.rgb += emission * transmittance; + vec3 emission = diskColor * density * stepLength * 4.0 * sqrt(disk_density); + + vec3 glowColor = mix(diskColor, vec3(1.0, 0.8, 0.6), 0.3); + float glowIntensity = density * stepLength * 2.0; + vec3 atmosphericGlow = glowColor * glowIntensity * 0.8; + + vec3 totalEmission = emission + atmosphericGlow; + accumulatedColor.rgb += totalEmission * transmittance; transmittance *= stepTransmittance; |
