Main repository of MikuMikuStudio
修订版 | 94c3bfdafec8ff566dcd1bfba8f17d90171538f0 (tree) |
---|---|
时间 | 2013-03-28 04:39:41 |
作者 | remy.bouquet@gmail.com <remy.bouquet@gmai...> |
Commiter | remy.bouquet@gmail.com |
Fixed remaining black artifacts with post waters when using the 1.5 shader and also clamped refraction tex coordinates for under water in both shader
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10503 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -164,6 +164,7 @@ vec4 underWater(){ | ||
164 | 164 | vec3 refraction = color2; |
165 | 165 | #ifdef ENABLE_REFRACTION |
166 | 166 | texC = texCoord.xy *sin (fresnel+1.0); |
167 | + texC = clamp(texC,0.0,1.0); | |
167 | 168 | refraction = texture2D(m_Texture, texC).rgb; |
168 | 169 | #endif |
169 | 170 |
@@ -161,6 +161,7 @@ vec4 underWater(int sampleNum){ | ||
161 | 161 | vec3 refraction = color2; |
162 | 162 | #ifdef ENABLE_REFRACTION |
163 | 163 | texC = texCoord.xy *sin (fresnel+1.0); |
164 | + texC = clamp(texC,0.0,1.0); | |
164 | 165 | #ifdef RESOLVE_MS |
165 | 166 | ivec2 iTexC = ivec2(texC * textureSize(m_Texture)); |
166 | 167 | refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb; |
@@ -349,7 +350,7 @@ vec4 main_multiSample(int sampleNum){ | ||
349 | 350 | // texC = texCoord.xy+ m_ReflectionDisplace * normal.x; |
350 | 351 | texC = texCoord.xy; |
351 | 352 | texC += sin(m_Time*1.8 + 3.0 * abs(position.y))* (refractionScale * min(depth2, 1.0)); |
352 | - texC = clamp(texC,0.0,1.0); | |
353 | + texC = clamp(texC,vec2(0.0),vec2(0.999)); | |
353 | 354 | #ifdef RESOLVE_MS |
354 | 355 | ivec2 iTexC = ivec2(texC * textureSize(m_Texture)); |
355 | 356 | refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb; |