From 9646be5552b55d4701c05c059353240933aa17df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20J=C3=A4rvisalo?= Date: Mon, 29 Jul 2024 22:18:06 +0300 Subject: [PATCH 1/3] kamera-ajo --- shader.glsl | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/shader.glsl b/shader.glsl index cd83208..93a550d 100644 --- a/shader.glsl +++ b/shader.glsl @@ -4,7 +4,7 @@ * Contact: tdmaav@gmail.com */ -precision mediump float; +// precision mediump float; uniform vec2 u_resolution; uniform float u_time; const float PI = 22./7.; @@ -324,16 +324,28 @@ vec3 postProcess(vec3 col) { return col; } +vec3 getCpos(float time) { + return vec3((cos(time)-0.9)*2., -sin(time)*0.8, 5.);; +} + + vec3 cameraPos() { // first zoom in to the gate + vec3 cPos = vec3(0., clamp(6.-u_time,2.,6.), clamp((75.-u_time*8.),6.,75.)); if (u_time > 7.5) cPos += vec3(0., clamp(7.5-u_time,-1.,0.), 0.); // close up shot for 1st glyph lock if (u_time > 10.5) cPos = vec3(2.,-1.,1.); // zoom away for 2nd glyph animation - if (u_time > 12.) cPos = vec3(-1., -.7, 4.); - if (u_time > 22.) cPos = vec3(0., -1., 5.); + if (u_time > 12.) cPos = vec3(-1., -.7, 4.); + if (u_time > 22.) { + cPos = getCpos(u_time); + } + if (u_time > 26.5) { + cPos = mix(getCpos(26.5), vec3(0., 0., 5.), clamp((u_time-26.5) * 1.5, 0., 1.1)); + } + return cPos; } @@ -342,7 +354,7 @@ vec3 cameraPointAt() { // look at 1st glyph if (u_time > 10.5) p = vec3(1.7,-1.1,0.); // look gate at distance - if(u_time > 12.) p = vec3(0.); + if(u_time > 12.) p = vec3(0.,0.,0.); return p; } @@ -402,11 +414,11 @@ vec3 sceneGate(vec2 uv) col *= vec3(.1)+ addSpecular(n,rd,0.5); if(mat ==5.) col *= chevronColor; // activated glyph color - } - col = applyFog(col, d, rd, vec3(0., -.1, -1.), .01); - col = colorFlashesAnim(col); // animated color flash - return postProcess(col); + + col = applyFog(col, d, rd, vec3(0., -.1, -1.), .01); + col = colorFlashesAnim(col); // animated color flash + return postProcess(col); } void main() { From 0284461cd5fd4903dc1aeca729b9783bc61dac78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20J=C3=A4rvisalo?= Date: Mon, 29 Jul 2024 22:20:30 +0300 Subject: [PATCH 2/3] kamera ajo --- 4kdemo.compofiller | 2 +- shader.glsl | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/4kdemo.compofiller b/4kdemo.compofiller index baa5bd0..a1db361 100644 --- a/4kdemo.compofiller +++ b/4kdemo.compofiller @@ -6,7 +6,7 @@ PROJECT_INFO_FILE=prod.nfo PROJECT_SCREENSHOT= # Currently active config file name -ACTIVE_CONFIG=minified.config +ACTIVE_CONFIG=base.config # ------- GUI options/preferences -------- # Automatically rebuild DLLs when things have changed? diff --git a/shader.glsl b/shader.glsl index cd83208..30f1a44 100644 --- a/shader.glsl +++ b/shader.glsl @@ -4,7 +4,7 @@ * Contact: tdmaav@gmail.com */ -precision mediump float; +//precision mediump float; uniform vec2 u_resolution; uniform float u_time; const float PI = 22./7.; @@ -75,15 +75,13 @@ float sdTriPrism( vec3 p, vec2 h, float rot ) ////////////////// // POSITIONS -/* const vec3 glyph1Pos = vec3(1.7,-1.1,0.0); const vec3 glyph2Pos = vec3(2.0,0.0,0.0); const vec3 glyph3Pos = vec3(1.5,1.4,0.0); const vec3 glyph4Pos = vec3(0.0,2.0,0.0); -const vec3 glyph5Pos = vec3(1.5,1.4,0.0); +const vec3 glyph5Pos = vec3(-1.5,1.4,0.0); const vec3 glyph6Pos = vec3(1.5 * -1.,1.4,0.0); const vec3 glyph7Pos = vec3(1.7 * -1.,-1.1,0.0); -*/ // DELAYS float STARTDELAY = 9.; @@ -332,8 +330,16 @@ vec3 cameraPos() // close up shot for 1st glyph lock if (u_time > 10.5) cPos = vec3(2.,-1.,1.); // zoom away for 2nd glyph animation - if (u_time > 12.) cPos = vec3(-1., -.7, 4.); - if (u_time > 22.) cPos = vec3(0., -1., 5.); + if (u_time > 12.) cPos = vec3(-1., -.7, 4.); + if (u_time > 13.5) { + cPos = vec3(0., 0., 4.); + cPos.yz *= rot2D(-0.6-(cos(u_time-15.))*0.2); + cPos.xz *= rot2D(sin((u_time-16.5)*0.5)*.6); + } + if (u_time > 19.5) + { + cPos = vec3(-1., -.7, 4.); + } return cPos; } @@ -342,7 +348,15 @@ vec3 cameraPointAt() { // look at 1st glyph if (u_time > 10.5) p = vec3(1.7,-1.1,0.); // look gate at distance - if(u_time > 12.) p = vec3(0.); + if(u_time > 12.) p = vec3(0.); + if(u_time > 13.5) { + p = mix(glyph3Pos,glyph4Pos, (u_time-13.5)*0.3); + } + if(u_time > 16.8) + { + p = mix(glyph4Pos,glyph5Pos, clamp((u_time-16.8)*0.3,0.,1.)); + } + if(u_time > 19.5) p = vec3(0.); return p; } @@ -402,10 +416,9 @@ vec3 sceneGate(vec2 uv) col *= vec3(.1)+ addSpecular(n,rd,0.5); if(mat ==5.) col *= chevronColor; // activated glyph color - } col = applyFog(col, d, rd, vec3(0., -.1, -1.), .01); - col = colorFlashesAnim(col); // animated color flash + col = colorFlashesAnim(col); // animated color flash return postProcess(col); } From 4f1f573b8fb753ae97a645aed1e346976d803330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20J=C3=A4rvisalo?= Date: Mon, 29 Jul 2024 22:51:50 +0300 Subject: [PATCH 3/3] kamera ajoja --- shader.glsl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/shader.glsl b/shader.glsl index ad97344..52ca85a 100644 --- a/shader.glsl +++ b/shader.glsl @@ -75,18 +75,17 @@ float sdTriPrism( vec3 p, vec2 h, float rot ) ////////////////// // POSITIONS -const vec3 glyph1Pos = vec3(1.7,-1.1,0.0); -const vec3 glyph2Pos = vec3(2.0,0.0,0.0); +//const vec3 glyph1Pos = vec3(1.7,-1.1,0.0); +//const vec3 glyph2Pos = vec3(2.0,0.0,0.0); const vec3 glyph3Pos = vec3(1.5,1.4,0.0); const vec3 glyph4Pos = vec3(0.0,2.0,0.0); const vec3 glyph5Pos = vec3(-1.5,1.4,0.0); -const vec3 glyph6Pos = vec3(1.5 * -1.,1.4,0.0); -const vec3 glyph7Pos = vec3(1.7 * -1.,-1.1,0.0); +//const vec3 glyph6Pos = vec3(1.5 * -1.,1.4,0.0); +//const vec3 glyph7Pos = vec3(1.7 * -1.,-1.1,0.0); // DELAYS float STARTDELAY = 9.; - // COLORS vec3 fogColor1 = vec3(.4, .2, .4), // fog color1 fogColor2 = vec3(.7, .4, .2), // fog color2 @@ -344,13 +343,11 @@ vec3 cameraPos() } if (u_time > 19.5) { - cPos = vec3(-1., -.7, 4.); + cPos = vec3(3., -.7, 4.); } if (u_time > 22.) { - cPos = getCpos(u_time); - } - if (u_time > 26.5) { - cPos = mix(getCpos(26.5), vec3(0., 0., 5.), clamp((u_time-26.5) * 1.5, 0., 1.1)); + cPos.yz *= rot2D(((1.-cos(u_time-22.))*0.25)*-0.1); + cPos.xz *= rot2D(sin((u_time-22.)*0.2)*.6); } return cPos;