private void CreateWater(WarpRenderer renderer) { 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/2) - 0.5f, waterHeight, (m_scene.RegionInfo.RegionSizeY/2) - 0.5f); warp_Material waterColormaterial = new warp_Material(ConvertColor(WATER_COLOR)); waterColormaterial.setTransparency((byte) ((1f - WATER_COLOR.A)*255f)*2); waterColormaterial.setReflectivity(50); renderer.Scene.addMaterial("WaterColor", waterColormaterial); renderer.SetObjectMaterial("Water", "WaterColor"); }
// Add a water plane to the renderer. private void CreateWater(WarpRenderer renderer) { 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 / 2 - 0.5f, waterHeight, m_scene.RegionInfo.RegionSizeY / 2 - 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"); }