Skip to content

Commit

Permalink
Re-enabled brush preview, tweaked default settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayden-donnelly committed May 12, 2023
1 parent 96fa23f commit 4548025
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public class NeuralTerrainGeneratorTool : TerrainPaintTool<NeuralTerrainGenerato
private const float maxSignalRate = 0.9f;
private const float minSignalRate = 0.02f;
private Diffuser diffuser = new Diffuser();
private int fromScratchDiffusionSteps = 20;
private int fromScratchDiffusionSteps = 10;
private int fromSelectedDiffusionSteps = 20;
private int fromSelectedStartingStep = 18;
private float selectedTerrainWeight = 0.55f;
private int brushHeightmapDiffusionSteps = 20;
private int brushHeightmapDiffusionSteps = 10;

// Upsampling.
// Left: upsample resolution, right: upsample factor.
Expand Down Expand Up @@ -119,15 +119,6 @@ private void GenerateMaskedBrushHeightmap()
Tensor upSampledBrushMaskTensor = barraUpSampler.Execute(brushMaskTensor);
// Consider smoothing upsample brush mask, otherwise it makes heightmap jagged.

/*
RenderTexture rt = BarracudaTextureUtils.TensorToRenderTexture(brushMaskTensor);
brushHeightmapUpSampled = new Texture2D(rt.width, rt.height);
RenderTexture.active = rt;
brushHeightmapUpSampled.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
brushHeightmapUpSampled.Apply();
RenderTexture.active = null;
*/

brushHeightmapMasked = new Texture2D(brushHeightmap.width, brushHeightmap.height);

Color[] brushHeightmapColors = brushHeightmap.GetPixels();
Expand Down Expand Up @@ -277,13 +268,15 @@ private void BrushGUI()
GenerateMaskedBrushHeightmap();
}

// Display brush heightmap and masked heightmap if they exist.
// Hiding these until I can downscale them for the inspector.
/*if(brushHeightmap != null)
GUIStyle style = new GUIStyle(GUI.skin.box);
style.fixedWidth = 256;
style.fixedHeight = 256;
if(brushHeightmap != null)
{
EditorGUILayout.LabelField("Brush Heightmap:");
GUILayout.Box(brushHeightmap);
GUILayout.Box(brushHeightmap, style);
}
/*
if(brushHeightmapMasked != null)
{
EditorGUILayout.LabelField("Masked Brush Heightmap:");
Expand All @@ -293,7 +286,8 @@ private void BrushGUI()
{
EditorGUILayout.LabelField("UpSampled Brush Heightmap:");
GUILayout.Box(brushHeightmapUpSampled);
}*/
}
*/
}
}

Expand Down

0 comments on commit 4548025

Please sign in to comment.