Animaatiot toimii

This commit is contained in:
2024-07-24 16:48:38 +03:00
parent 0ea616d2ec
commit 4389be6ef8
2 changed files with 62 additions and 35 deletions

View File

@ -6,7 +6,7 @@ PROJECT_INFO_FILE=prod.nfo
PROJECT_SCREENSHOT= PROJECT_SCREENSHOT=
# Currently active config file name # Currently active config file name
ACTIVE_CONFIG=minified.config ACTIVE_CONFIG=base.config
# ------- GUI options/preferences -------- # ------- GUI options/preferences --------
# Automatically rebuild DLLs when things have changed? # Automatically rebuild DLLs when things have changed?

View File

@ -83,8 +83,8 @@ float factor = 9.0+9.0*clamp(sin(ringRotateFunc(2.0, 0.0, 1.0) * 0.05), -0.9, 0.
// delay start // delay start
if( u_time >= STARTDELAY ) { if( u_time >= STARTDELAY ) {
factor = 9.0+9.0*clamp(sin(ringRotateFunc(2.0, 0.0, 1.0) * 0.05), -0.9, 0.9); factor = 9.0+9.0*clamp(sin(ringRotateFunc(2.0, 0.0, 1.0) * 0.05), -0.9, 0.9);
p.xy = rot2D(factor) * p.xy; p.xy = rot2D(factor) * p.xy;
} }
if(u_time >= 14.0) { if(u_time >= 14.0) {
@ -275,6 +275,8 @@ void main( )
vec3 rd = GetRayDir(uv, ro, vec3(0, 0., 0.), 1.); // ray direction vec3 rd = GetRayDir(uv, ro, vec3(0, 0., 0.), 1.); // ray direction
vec3 col = vec3(0); // color vec3 col = vec3(0); // color
if(u_time > 0.0)
{
float d = rayMarch(ro, rd); float d = rayMarch(ro, rd);
if (d < 1000.) if (d < 1000.)
@ -311,6 +313,31 @@ void main( )
col *= vec3(1,0,0); col *= vec3(1,0,0);
} }
} }
gl_FragColor = vec4(col, 1); gl_FragColor = vec4(col, 1);
}
else {
// ************* post-process pass ******************
// Uncomment this to try a post-processing "effect"
vec4 c = texture2D(texture_sampler, (gl_FragCoord.xy / u_resolution )),
c1 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(1.0, 0.0)) / u_resolution) ),
c2 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(0.0, 1.0)) / u_resolution) ),
c3 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(1.0, 1.0)) / u_resolution) ),
c4 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(-1.0, 1.0)) / u_resolution) ),
c5 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(-1.0, 0.0)) / u_resolution) ),
c6 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(-1.0, -1.0)) / u_resolution) ),
c7 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(0.0, -1.0)) / u_resolution) ),
c8 = texture2D(texture_sampler, ((gl_FragCoord.xy + vec2(1.0, -1.0)) / u_resolution) )
;
// weird emboss effect
// gl_FragColor = (c - c1 - c2 - c3 - c4 + c5 + c6 + c7 + c8) / 2.0;
// some sort of gamma correction with smoothing
gl_FragColor = sqrt(c * 2.0 + c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8) / 3.0;
}
} }