1 using Microsoft.Xna.Framework;
8 [
Serialize(0.0f,
IsPropertySaveable.Yes, description:
"The frequency of the noise."),
Editable(MinValueFloat = 0.0f, MaxValueFloat = 100.0f, DecimalCount = 2, ValueStep = 1f)]
11 [
Serialize(1.0f,
IsPropertySaveable.Yes, description:
"How much the noise distorts the sprite."),
Editable(MinValueFloat = 0.0f, MaxValueFloat = 10.0f, DecimalCount = 2, ValueStep = 0.01f)]
14 [
Serialize(0.0f,
IsPropertySaveable.Yes, description:
"How fast the noise changes."),
Editable(MinValueFloat = 0.0f, MaxValueFloat = 10.0f, DecimalCount = 2, ValueStep = 0.01f)]
30 phase = Rand.Range(0.0f, 255.0f);
34 private void UpdateNoise()
44 PerlinNoise.GetPerlin(normalizedX + phase, normalizedY + phase) - 0.5f,
45 PerlinNoise.GetPerlin(normalizedY - phase, normalizedX - phase) - 0.5f);
50 protected override void GetDeformation(out Vector2[,] deformation, out
float multiplier,
bool inverse)
56 public override void Update(
float deltaTime)