@
jeffhuys it looks like coffee, that's wrong with it.Just the screenshot isn't that good.Sometimes there could be artefacts reflections from other applications/games that used directx
Normaly i would give you whole code but the problem is that i messed up controls and they don't work as original anymore.In fact they don't work at all.
Try to replace with this code where is necessary :
`Make Water plain
load image "Media/Waves.dds",Img+2
load image "Media/Fresnel.bmp",Img+3
load image "Media/WaterMask.bmp",Img+4
make object plain WaterObj,5000,5000
texture object WaterObj,0,Img
texture object WaterObj,1,Img+1
texture object WaterObj,2,Img+2
texture object WaterObj,3,1
texture object WaterObj,4,Img+4
xrotate object WaterObj,270
load effect "FX/Water.fx",Fx,0
set object effect WaterObj,Fx
set object transparency WaterObj,1
endfunction
`----------------------------------------------------
` Update Water
`----------------------------------------------------
function UpDateWater()
`UpDate Water plain
position object WaterObj,object position x(WaterObj),WaterHeight#,object position z(WaterObj)
Hide object WaterObj
`Upade Refract/Reflect cameras
set effect technique Fx,"Refract"
UpDateRefraction()
if camera position y()>WaterHeight#
set effect technique Fx,"ReflectRefract"
UpDateReflection()
else
remstart
fog on:fog color rgb(55,65,75)
fog distance 2000
remend
endif
`Show Water
show object WaterObj
sync mask 2^0
endfunction
`----------------------------------------------------
` Refraction Update
`----------------------------------------------------
function UpDateRefraction()
position camera 1,camera position x(),camera position y(),camera position z()
rotate camera 1,camera angle x(),camera angle y(),camera angle z()
if camera position y()>WaterHeight#
set camera clip 1,1,0,WaterHeight#+30,0,0,-1,0
remstart
fog on:fog color rgb(55,65,75)
fog distance 250+(camera position y()-WaterHeight#)*10
remend
endif
if camera position y()<WaterHeight#
set camera clip 1,1,0,WaterHeight#-30,0,0,1,0
remstart
fog on:fog color rgb(55,65,75)
fog distance 20000
remend
endif
set camera clip 2,0,0,0,0,0,0,0
sync mask 2^1
fastsync
`fog off
endfunction
`----------------------------------------------------
` Reflection Update
`----------------------------------------------------
function UpDateReflection()
position camera 2,camera position x(),WaterHeight#-(camera position y()-WaterHeight#),camera position z()
rotate camera 2,-camera angle x(),camera angle y(),camera angle z()
set camera clip 1,0,0,0,0,0,0,0
set camera clip 2,1,0,WaterHeight#-15,0,0,1,0
sync mask 2^2
fastsync
endfunction
If you are lazy you can read this thread
http://forum.thegamecreators.com/?m=forum_view&t=166720&b=1
then just follow the given link there to solution of this problem.Also
jeffhuys can see better what's the real problem in my thread, just look the images.
EDIT: I'm not sure what was original WaterMask.bmp but i think you need to make it all white so the water is clear everywhere.Any color between white and black is gonna make transition between clear and black water more smoother.Basicly all grey nuances.
Coding is My Kung Fu!
And My Kung Fu is better than Yours!