From db6eced21314e6d8d2e40f899d2866cba0b19a2f Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Wed, 29 Nov 2023 19:36:58 +0100 Subject: [PATCH] Shader fixes for Delta Touch. --- shaders/glsl/95Bg.fp | 2 +- shaders/glsl/96Bg.fp | 10 +++++----- shaders/glsl/97Bg.fp | 4 ++-- shaders/glsl/MeshEnviroMapMasked.fp | 2 +- shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp | 14 +++++++------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/shaders/glsl/95Bg.fp b/shaders/glsl/95Bg.fp index 079378e..d873326 100644 --- a/shaders/glsl/95Bg.fp +++ b/shaders/glsl/95Bg.fp @@ -1,7 +1,7 @@ vec4 ProcessTexel() { const vec3 fadecol = vec3(.9,.1,.2); - vec2 coord = vTexCoord.st+vec2(timer*0.02,0.); + vec2 coord = vTexCoord.st+vec2(timer*.02,0.); coord = fract(coord); vec3 base = getTexel(coord).rgb; float dist = abs(vTexCoord.s-.5)*2.; diff --git a/shaders/glsl/96Bg.fp b/shaders/glsl/96Bg.fp index bb3c40b..803394d 100644 --- a/shaders/glsl/96Bg.fp +++ b/shaders/glsl/96Bg.fp @@ -2,21 +2,21 @@ vec4 ProcessTexel() { vec2 uv = vTexCoord.st; uv.x += 1.; - float ang = timer*0.05; + float ang = timer*.05; vec2 uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.3; vec3 col = getTexel(fract(uv2)).rgb; uv.y -= 2.; - ang = timer*0.03; + ang = timer*.03; uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.5; col += getTexel(fract(uv2)).rgb; uv.x -= 3.; - ang = timer*0.04; + ang = timer*.04; uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.6; col += getTexel(fract(uv2)).rgb; uv.y += 4.; - ang = timer*0.02; + ang = timer*.02; uv2 = vec2(uv.x*cos(ang)-uv.y*sin(ang),uv.y*cos(ang)+uv.x*sin(ang))*1.2; col += getTexel(fract(uv2)).rgb; - col *= 0.25; + col *= .25; return vec4(col,1.); } diff --git a/shaders/glsl/97Bg.fp b/shaders/glsl/97Bg.fp index 075057d..0227f41 100644 --- a/shaders/glsl/97Bg.fp +++ b/shaders/glsl/97Bg.fp @@ -1,7 +1,7 @@ vec4 ProcessTexel() { vec2 ccoord = vTexCoord.st-vec2(.5); - if ( ccoord.y < 0 ) ccoord.x *= -1.; + if ( ccoord.y < 0. ) ccoord.x *= -1.; ccoord.y = abs(ccoord.y); vec3 pt = vec3(ccoord.x,ccoord.y-1.,ccoord.y); vec2 proj = pt.xy/pt.z; @@ -13,7 +13,7 @@ vec4 ProcessTexel() coord = proj*.123234+vec2(0.,-1.)*timer*.092346; coord = fract(coord); col += getTexel(coord).rgb; - coord = proj*.145463+vec2(0.3,-1.)*timer*.093242; + coord = proj*.145463+vec2(.3,-1.)*timer*.093242; coord = fract(coord); col += getTexel(coord).rgb; col *= vec3(1.2,.4,.8); diff --git a/shaders/glsl/MeshEnviroMapMasked.fp b/shaders/glsl/MeshEnviroMapMasked.fp index ec62d39..02356bc 100644 --- a/shaders/glsl/MeshEnviroMapMasked.fp +++ b/shaders/glsl/MeshEnviroMapMasked.fp @@ -5,5 +5,5 @@ vec4 ProcessTexel() float mask = texture(masktex,vTexCoord.st).x; vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); - return vec4(base.rgb+texture(envtex,norm.xz*0.5+0.5).rgb*mask,base.a); + return vec4(base.rgb+texture(envtex,norm.xz*.5+.5).rgb*mask,base.a); } diff --git a/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp b/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp index 2aa526b..556cf54 100644 --- a/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp +++ b/shaders/glsl/MeshEnviroMapMasked_AmbientGlow.fp @@ -5,11 +5,11 @@ vec4 ProcessLight( vec4 color ) if ( gs.x > .5 ) return color; if ( gs.y > .5 ) { - float glow = max(0.,sin(timer*4)-.5); + float glow = max(0.,sin(timer*4.)-.5); return vec4(min(color.rgb+vec3(glow),1.),color.a); } - float glow = 0.25+0.2*sin(timer*8); - return vec4(min(color.rgb+vec3(glow),1.0),color.a); + float glow = .25+.2*sin(timer*8.); + return vec4(min(color.rgb+vec3(glow),1.),color.a); } // imitation of the Unreal Engine 1.x bMeshEnviroMap effect, not 1:1 but gets close @@ -21,12 +21,12 @@ vec4 ProcessTexel() vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); vec2 gs = texture(ambglow,vec2(.5)).xy; - if ( gs.x > .5 ) return vec4(base.rgb+texture(envtex,norm.xz*0.5+0.5).rgb*mask,base.a); + if ( gs.x > .5 ) return vec4(base.rgb+texture(envtex,norm.xz*.5+.5).rgb*mask,base.a); if ( gs.y > .5 ) { - float glow = max(0.,sin(timer*4)-.5); - vec3 col = base.rgb+texture(envtex,norm.xz*0.5+0.5).rgb*mask; + float glow = max(0.,sin(timer*4.)-.5); + vec3 col = base.rgb+texture(envtex,norm.xz*.5+.5).rgb*mask; return vec4(min(col+vec3(glow),1.),base.a); } - return vec4(base.rgb+texture(envtex,norm.xz*0.5+0.5).rgb*mask,base.a); + return vec4(base.rgb+texture(envtex,norm.xz*.5+.5).rgb*mask,base.a); }