예제 #1
0
        private void CreateWater(WarpRenderer renderer, bool threeD)
        {
            float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;

            warp_Material waterColormaterial;

            if (!threeD)
            {
                if (m_scene.RegionInfo.RegionSizeX >= m_scene.RegionInfo.RegionSizeY)
                {
                    renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeX / 2);
                }
                else
                {
                    renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeY / 2);
                }

                renderer.Scene.sceneobject("Water").setPos((m_scene.RegionInfo.RegionSizeX / 2) - 0.5f, waterHeight,
                                                           (m_scene.RegionInfo.RegionSizeY / 2) - 0.5f);
                waterColormaterial = new warp_Material(ConvertColor(WATER_COLOR));
                waterColormaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f) * 2);
            }
            else
            {
                if (m_scene.RegionInfo.RegionSizeX >= m_scene.RegionInfo.RegionSizeY)
                {
                    renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeX / 2);
                }
                else
                {
                    renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeY / 2);
                }

                renderer.Scene.sceneobject("Water").setPos(
                    (m_scene.RegionInfo.RegionSizeX / 2) - 0.5f,
                    -0.5f,
                    waterHeight + 5.1f
                    );

                waterColormaterial = new warp_Material(ConvertColor(OPAQUE_WATER_COLOR));
                waterColormaterial.setTransparency(48);
                //waterColormaterial.opaque = true;
            }

            waterColormaterial.setReflectivity(0);
            renderer.Scene.addMaterial("WaterColor", waterColormaterial);
            renderer.SetObjectMaterial("Water", "WaterColor");
        }
        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");
        }