add the water fix for very large var regions
parent
8e32d1e251
commit
d3a2bf2455
|
@ -313,16 +313,20 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
|||
{
|
||||
float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
|
||||
|
||||
renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeX * 0.5f);
|
||||
renderer.Scene.sceneobject("Water").setPos(m_scene.RegionInfo.RegionSizeX * 0.5f - 0.5f,
|
||||
waterHeight,
|
||||
m_scene.RegionInfo.RegionSizeY * 0.5f - 0.5f);
|
||||
|
||||
warp_Material waterColorMaterial = new warp_Material(ConvertColor(WATER_COLOR));
|
||||
waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif
|
||||
waterColorMaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f));
|
||||
renderer.Scene.addMaterial("WaterColor", waterColorMaterial);
|
||||
renderer.SetObjectMaterial("Water", "WaterColor");
|
||||
|
||||
for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / 256; x++)
|
||||
{
|
||||
for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / 256; y++)
|
||||
{
|
||||
renderer.AddPlane("Water-" + x + "-" + y, 256);
|
||||
renderer.Scene.sceneobject("Water-" + x + "-" + y).setPos(128 * x, waterHeight, 128 * y);
|
||||
renderer.SetObjectMaterial("Water-" + x + "-" + y, "WaterColor");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add a terrain to the renderer.
|
||||
|
|
Loading…
Reference in New Issue