From 22cbc9644b79df60b3f6336f9563debd47fb3ea1 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 28 Jun 2012 11:44:15 -0700 Subject: Added capability to split a mesh into multiiple parts to avoid buffer overflow situations. --- assets/shaders/Flag.vert.glsl | 3 ++- assets/shaders/Pulse.frag.glsl | 1 + assets/shaders/test_fshader_full.glsl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'assets') diff --git a/assets/shaders/Flag.vert.glsl b/assets/shaders/Flag.vert.glsl index 1c842cb0..8ba00922 100644 --- a/assets/shaders/Flag.vert.glsl +++ b/assets/shaders/Flag.vert.glsl @@ -35,7 +35,8 @@ void main() const float pi = 3.14159; float angle = time; - v_uv = texcoord; + v_uv.x = texcoord.x; + v_uv.y = texcoord.y; float x = 2.0*pi*texcoord.x/u_waveWidth; float y = 2.0*pi*texcoord.y; diff --git a/assets/shaders/Pulse.frag.glsl b/assets/shaders/Pulse.frag.glsl index 9aeb05c9..b717d359 100644 --- a/assets/shaders/Pulse.frag.glsl +++ b/assets/shaders/Pulse.frag.glsl @@ -22,6 +22,7 @@ void main(void) float cLength = length(cPos); vec2 uv = gl_FragCoord.xy/u_resolution.xy+(cPos/cLength)*sin(cLength/30.0-time*10.0)/25.0; + uv.y = 1.0 - uv.y; vec3 col = texture2D(u_tex0,uv).xyz*50.0/cLength; gl_FragColor = vec4(col,1.0); diff --git a/assets/shaders/test_fshader_full.glsl b/assets/shaders/test_fshader_full.glsl index ef721b39..0ea3cf1b 100755 --- a/assets/shaders/test_fshader_full.glsl +++ b/assets/shaders/test_fshader_full.glsl @@ -38,7 +38,7 @@ varying vec3 vEyePos; void main() { - vec4 colMapTexel = vec4(texture2D(colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); + vec4 colMapTexel = vec4(texture2D(colMap, vec2(vNormal.w, 1.0 - vECPos.w)).rgb, 1.0); // normal mapping vec3 normal = normalize(vNormal.xyz); -- cgit v1.2.3