• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

修訂94c3bfdafec8ff566dcd1bfba8f17d90171538f0 (tree)
時間2013-03-28 04:39:41
作者remy.bouquet@gmail.com <remy.bouquet@gmai...>
Commiterremy.bouquet@gmail.com

Log Message

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

Change Summary

差異

--- a/engine/src/core-effects/Common/MatDefs/Water/Water.frag
+++ b/engine/src/core-effects/Common/MatDefs/Water/Water.frag
@@ -164,6 +164,7 @@ vec4 underWater(){
164164 vec3 refraction = color2;
165165 #ifdef ENABLE_REFRACTION
166166 texC = texCoord.xy *sin (fresnel+1.0);
167+ texC = clamp(texC,0.0,1.0);
167168 refraction = texture2D(m_Texture, texC).rgb;
168169 #endif
169170
--- a/engine/src/core-effects/Common/MatDefs/Water/Water15.frag
+++ b/engine/src/core-effects/Common/MatDefs/Water/Water15.frag
@@ -161,6 +161,7 @@ vec4 underWater(int sampleNum){
161161 vec3 refraction = color2;
162162 #ifdef ENABLE_REFRACTION
163163 texC = texCoord.xy *sin (fresnel+1.0);
164+ texC = clamp(texC,0.0,1.0);
164165 #ifdef RESOLVE_MS
165166 ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
166167 refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;
@@ -349,7 +350,7 @@ vec4 main_multiSample(int sampleNum){
349350 // texC = texCoord.xy+ m_ReflectionDisplace * normal.x;
350351 texC = texCoord.xy;
351352 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));
353354 #ifdef RESOLVE_MS
354355 ivec2 iTexC = ivec2(texC * textureSize(m_Texture));
355356 refraction = texelFetch(m_Texture, iTexC, sampleNum).rgb;