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: https://jmonkeyengine.googlecode.com/svn/trunk@10503 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
6f54913af3
commit
c689ba4e9b
@ -164,6 +164,7 @@ vec4 underWater(){
|
|||||||
vec3 refraction = color2;
|
vec3 refraction = color2;
|
||||||
#ifdef ENABLE_REFRACTION
|
#ifdef ENABLE_REFRACTION
|
||||||
texC = texCoord.xy *sin (fresnel+1.0);
|
texC = texCoord.xy *sin (fresnel+1.0);
|
||||||
|
texC = clamp(texC,0.0,1.0);
|
||||||
refraction = texture2D(m_Texture, texC).rgb;
|
refraction = texture2D(m_Texture, texC).rgb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ vec4 underWater(int sampleNum){
|
|||||||
vec3 refraction = color2;
|
vec3 refraction = color2;
|
||||||
#ifdef ENABLE_REFRACTION
|
#ifdef ENABLE_REFRACTION
|
||||||
texC = texCoord.xy *sin (fresnel+1.0);
|
texC = texCoord.xy *sin (fresnel+1.0);
|
||||||
|
texC = clamp(texC,0.0,1.0);
|
||||||
#ifdef RESOLVE_MS
|
#ifdef RESOLVE_MS
|
||||||
ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
|
ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
|
||||||
refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;
|
refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;
|
||||||
@ -349,7 +350,7 @@ vec4 main_multiSample(int sampleNum){
|
|||||||
// texC = texCoord.xy+ m_ReflectionDisplace * normal.x;
|
// texC = texCoord.xy+ m_ReflectionDisplace * normal.x;
|
||||||
texC = texCoord.xy;
|
texC = texCoord.xy;
|
||||||
texC += sin(m_Time*1.8 + 3.0 * abs(position.y))* (refractionScale * min(depth2, 1.0));
|
texC += sin(m_Time*1.8 + 3.0 * abs(position.y))* (refractionScale * min(depth2, 1.0));
|
||||||
texC = clamp(texC,0.0,1.0);
|
texC = clamp(texC,vec2(0.0),vec2(0.999));
|
||||||
#ifdef RESOLVE_MS
|
#ifdef RESOLVE_MS
|
||||||
ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
|
ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
|
||||||
refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;
|
refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user