private void DrawHeightMapParams()
        {
            GHeightMapGeneratorParams param = GTextureToolParams.Instance.HeightMap;

            param.Terrain         = EditorGUILayout.ObjectField("Terrain", param.Terrain, typeof(GStylizedTerrain), true) as GStylizedTerrain;
            param.UseRealGeometry = EditorGUILayout.Toggle("Real Geometry", param.UseRealGeometry);

            lockLivePreviewTerrain = true;
            SetLivePreviewTerrain(param.Terrain);

            GTextureToolParams.Instance.HeightMap = param;
        }
Beispiel #2
0
        public void Generate(RenderTexture targetRt)
        {
            GHeightMapGeneratorParams param = GTextureToolParams.Instance.HeightMap;

            if (param.Terrain == null || param.Terrain.TerrainData == null)
            {
                GCommon.CopyToRT(Texture2D.blackTexture, targetRt);
            }
            else
            {
                if (param.UseRealGeometry)
                {
                    RenderGeometryHeightMap(param.Terrain, targetRt);
                }
                else
                {
                    RenderPixelHeightMap(param.Terrain, targetRt);
                }
            }
        }