MD Package Technical & APi Documentation
MDM_MeshNoise :: MD_ModifierBase
Namespace: MDPackage.Modifiers
Physically-based Perlin noise generator with vertical and spatial features.
Read more here (Online documentation slide)
Public Methods
// Process vertical noise manually
public void MeshNoise_UpdateVerticalNoise()
// Process spatial noise manually
public void MeshNoise_UpdateSpatialNoise()
// Change overall noise intensity
public void MeshNoise_ChangeIntensity(float entry)
Public Fields
public NoiseType noiseType = NoiseType.SpatialNoise; // SpatialNoise, VerticalNoise

public float noiseAmount = 1;
public float noiseSpeed = 0.5f;
public float noiseIntensity = 0.5f;
Examples
The following paragraphs contain Mesh Noise modifier used in a practical example.
using UnityEngine;
using MDPackage.Modifiers;

[RequireComponent(typeof(MeshFilter))]
public class SampleScript : MonoBehaviour
{
private MDM_MeshNoise noise;

private void Start()
 {
  // Add/Create a noise modifier to this object right after start
  noise = gameObject.AddComponent<MDM_MeshNoise>();
  // Update current modifier every frame
  noise.updateEveryFrame = true;
  // Otherwise it can be updated manually by calling...
  // noise.MDModifier_ProcessModifier();
 }

private void Update()
 {
  // Sample noise
  noise.noiseIntensity = Mathf.Sin(Time.time * 2.0f) * 0.75f;
  // Sample extension - if space is pressed, increase the vertex count if possible
  if (Input.GetKeyDown(KeyCode.Space))
   noise.MDModifier_SubdivideMesh();
  // Sample extension - if R is pressed, restore mesh to its original state
  if (Input.GetKeyDown(KeyCode.R))
   noise.MDModifier_RestoreMesh();
 }
}