minmay wrote:The water shader only works on materials named "ocean_water", "water_surface_calm", and "water_surface_underwater". If you want more than 3 water materials you should take advantage of the onUpdate hook to change the materials' properties when needed.
That sounds cool. Currently I've [as mentioned above] defined a copy of water_surface_calm, and applied it upon load; with the water surface raised just slightly above 0 elevation. To appear like a foot of flood water in the tunnels. I'd seen it of course, but I hadn't actually used the onUpdate hook yet.
Code: Select all
defineMaterial{
name = "water_surface_adjusted",
shader = "ocean_water",
diffuseMap = "assets/textures/env/ocean_foam_dif.tga",
normalMap = "assets/textures/env/ocean_normal.tga",
displacementMap = "assets/textures/env/ocean_disp.tga",
doubleSided = true,
lighting = true,
alphaTest = false,
blendMode = "Translucent",
textureAddressMode = "Wrap",
glossiness = 80,
depthBias = 0,
texOffset = 0,
foamOffset = 0,
foamAmount = 0,
waveAmplitude = 0.25, --=------[changed from 2 to .25]
onUpdate = function(self, time)
self:setParam("texOffset", time*0.15)
end,
}
I'm not happy with the final effect ~yet; but it does change that to this:
And can be seen here in-game:
https://www.dropbox.com/s/0bhn1if7mq7po ... l.avi?dl=0