Ejemplo n.º 1
0
        private void BuildBackground(Rule rule, TerrainMeshData meshData, MeshRegion meshRegion, RenderMode renderMode)
        {
            if (meshRegion.Mesh == null)
            {
                return;
            }
            var gradient = rule.GetBackgroundLayerGradient(_customizationService);

            float eleNoiseFreq   = rule.GetBackgroundLayerEleNoiseFreq();
            float colorNoiseFreq = renderMode == RenderMode.Scene ? rule.GetBackgroundLayerColorNoiseFreq() : 0;

            foreach (var triangle in meshRegion.Mesh.Triangles)
            {
                AddTriangle(rule, meshData, triangle, gradient, eleNoiseFreq, colorNoiseFreq);
            }

            meshRegion.Dispose();
        }
Ejemplo n.º 2
0
        private void BuildSurface(Rule rule, TerrainMeshData meshData, MeshRegion meshRegion, RenderMode renderMode)
        {
            if (meshRegion.Mesh == null)
            {
                return;
            }

            float colorNoiseFreq = renderMode == RenderMode.Scene ? meshRegion.ColorNoiseFreq : 0;
            float eleNoiseFreq   = renderMode == RenderMode.Scene ? meshRegion.ElevationNoiseFreq : 0;
            var   gradient       = _customizationService.GetGradient(meshRegion.GradientKey);

            if (meshRegion.ModifyMeshAction != null)
            {
                meshRegion.ModifyMeshAction(meshRegion.Mesh);
            }

            foreach (var triangle in meshRegion.Mesh.Triangles)
            {
                AddTriangle(rule, meshData, triangle, gradient, eleNoiseFreq, colorNoiseFreq);
            }

            meshRegion.Dispose();
        }