ocean beach surface underwater tile - SOLVED
Posted: Sat Jan 10, 2015 8:41 pm
simple solution (has some slight bugs, like water is clipping with ocean beach...) -
ok solved at the end. in case somebody is interested to have water_surface which will have surface of ocean_beach (you have to add default object) but will be actin like regular underwater tile when jumped inside (test for forest_underweater tile), you need just to move offsets correctly.
what is it for ? you can create really deep beaches not just on the end of the map, you are not limited by shallow water etc...
complicated solution, but should work without bugs, adviced by minmay
Try adding a WaterSurfaceMesh component to ocean_water and using an invisible material for its "material" field. An invisible material would look like this:
You can then leave water_surface_underwater as the underwater material. Note that the water shader only works correctly on materials with certain names so you will need to redefine water_surface_underwater if you want it to look more like ocean_water. Also you'll probably want to add fogColor and fogDensity fields to the WaterSurface component, like water_surface and water_surface_underground have.
example:
unlimited beach

underwater

ok solved at the end. in case somebody is interested to have water_surface which will have surface of ocean_beach (you have to add default object) but will be actin like regular underwater tile when jumped inside (test for forest_underweater tile), you need just to move offsets correctly.
what is it for ? you can create really deep beaches not just on the end of the map, you are not limited by shallow water etc...
complicated solution, but should work without bugs, adviced by minmay
Try adding a WaterSurfaceMesh component to ocean_water and using an invisible material for its "material" field. An invisible material would look like this:
Code: Select all
defineMaterial{
name = "invisible",
diffuseMap = "mod_assets/textures/invisible.tga", -- a texture with all pixels transparent
doubleSided = false,
lighting = false,
alphaTest = true, -- accounts for the transparency
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 0,
depthBias = 0,
}
example:
unlimited beach

underwater

Code: Select all
defineObject{
name = "water_no_surface",
baseObject = "base_floor_decoration",
components = {
{
-- updates global reflection and refraction maps
class = "WaterSurface",
planeY = -0.4,
fogColor = vec(0.042, 0.09, 0.26) * 0.5,
fogDensity = 0.2,
--planeY = -0.4,
reflectionColor = vec(0.77, 0.9, 1.0) * 0.9,
refractionColor = vec(1,1,1),
},
{
-- builds a continuous mesh from underwater tiles
class = "WaterSurfaceMesh",
offset = vec(0,-7,0,0),
material = "water_surface_calm",
underwaterMaterial = "water_surface_underwater",
offset = vec(0, -1.25, 0),
},
},
dontAdjustHeight = true,
editorIcon = 264,
}