X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fscene_fxglow.h;h=a86f5207db00688f5ded3d26c3a33049a8a4bb57;hb=99376ce8eaf30125fb08dd5dc8b534800580fe47;hp=82251455ee48d0232ca5ed6978dc8ea0fc23cf88;hpb=6190deb68aa1c9e92ede62ea05c2a755bf5516de;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/scene_fxglow.h b/shaders/scene_fxglow.h index 8225145..a86f520 100644 --- a/shaders/scene_fxglow.h +++ b/shaders/scene_fxglow.h @@ -7,7 +7,7 @@ static struct vg_shader _shader_scene_fxglow = { .link = shader_scene_fxglow_link, .vs = { -.orig_file = "shaders/scene.vs", +.orig_file = "shaders/scene_fxglow.vs", .static_src = "layout (location=0) in vec3 a_co;\n" "layout (location=1) in vec4 a_norm;\n" @@ -36,6 +36,7 @@ static struct vg_shader _shader_scene_fxglow = { "uniform mat4x3 uMdl;\n" "uniform mat4 uPv;\n" "uniform mat4 uPvmPrev;\n" +"uniform vec2 uUvOffset;\n" "\n" "out vec2 aUv;\n" "out vec4 aNorm;\n" @@ -52,7 +53,7 @@ static struct vg_shader _shader_scene_fxglow = { "\n" " gl_Position = vproj0;\n" "\n" -" aUv = a_uv;\n" +" aUv = a_uv + uUvOffset;\n" " aNorm = vec4( mat3(uMdl) * a_norm.xyz, a_norm.w );\n" " aCo = a_co;\n" " aWorldCo = world_pos0;\n" @@ -444,6 +445,7 @@ static struct vg_shader _shader_scene_fxglow = { static GLuint _uniform_scene_fxglow_uMdl; static GLuint _uniform_scene_fxglow_uPv; static GLuint _uniform_scene_fxglow_uPvmPrev; +static GLuint _uniform_scene_fxglow_uUvOffset; static GLuint _uniform_scene_fxglow_uTexMain; static GLuint _uniform_scene_fxglow_uCamera; static GLuint _uniform_scene_fxglow_g_world_depth; @@ -458,6 +460,9 @@ static void shader_scene_fxglow_uPv(m4x4f m){ static void shader_scene_fxglow_uPvmPrev(m4x4f m){ glUniformMatrix4fv(_uniform_scene_fxglow_uPvmPrev,1,GL_FALSE,(float*)m); } +static void shader_scene_fxglow_uUvOffset(v2f v){ + glUniform2fv(_uniform_scene_fxglow_uUvOffset,1,v); +} static void shader_scene_fxglow_uTexMain(int i){ glUniform1i(_uniform_scene_fxglow_uTexMain,i); } @@ -475,6 +480,7 @@ static void shader_scene_fxglow_link(void){ _uniform_scene_fxglow_uMdl = glGetUniformLocation( _shader_scene_fxglow.id, "uMdl" ); _uniform_scene_fxglow_uPv = glGetUniformLocation( _shader_scene_fxglow.id, "uPv" ); _uniform_scene_fxglow_uPvmPrev = glGetUniformLocation( _shader_scene_fxglow.id, "uPvmPrev" ); + _uniform_scene_fxglow_uUvOffset = glGetUniformLocation( _shader_scene_fxglow.id, "uUvOffset" ); _uniform_scene_fxglow_uTexMain = glGetUniformLocation( _shader_scene_fxglow.id, "uTexMain" ); _uniform_scene_fxglow_uCamera = glGetUniformLocation( _shader_scene_fxglow.id, "uCamera" ); _uniform_scene_fxglow_g_world_depth = glGetUniformLocation( _shader_scene_fxglow.id, "g_world_depth" );