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] 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); }