Its hard to explain unless you see it for yourself. Its not that it is too quick. However the syncing might be the problem. I am using 1 Sync command and 2 sync mask's and 1 fastsync.
The problem is I do not know which order they are supposed to be in.
`----------------------------------------------------
` 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"
fog color rgb(75,120,150) // Distant Mountain Fog View
fog distance 800,2000
UpDateReflection()
else
fog color rgb(0,20,50)
fog distance 0,200
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#
fog color rgb(10,80,110)
fog distance 0,10 + (camera position y() - WaterHeight#) * 2
endif
if camera position y() < WaterHeight#
fog color rgb(0,45,105) // under water surface color
fog distance 0,10
endif
sync mask 2^1
fastsync
endfunction
`----------------------------------------------------
` Reflection Update
`----------------------------------------------------
function UpDateReflection()
position camera 2,camera position x(),camera position y(),camera position z()
rotate camera 2,-camera angle x(),camera angle y(),camera angle z()
sync mask 2^2
fastsync
endfunction
The UpDateWater() function is called once per SYNC command. The Sync command comes AFTER this is called. The other two functions you see here are called from within the UpDateWater() function.
"Life is like a box of chocolates.. eat it before it melts."