Terra icon indicating copy to clipboard operation
Terra copied to clipboard

[Feature] DISTANCE sampler

Open astrsh opened this issue 3 years ago • 0 comments

Pre-Request Checklist

  • [x] I have checked that I am on the latest version of Terra.
  • [x] I have searched github for similar features requests, including closed ones, and found none.
  • [x] I believe this is within the scope of Terra.
  • [x] This feature request is for all of Terra, and isn't something that should be implemented by a pack or addon.

Feature Description

New sampler type that returns the distance from the specified coordinates.

What Problem Does This Solve?

User Ark#0069 on discord was requesting a way to generate a singular volcano within biome distribution - this is possible via expression samplers by writing the math by hand - however this approach was less accessible, especially for those not as versed in Terra configuration.

A distance sampler would allow for easily placing things like a singular volcano, or singular island, etc while not requiring much math to be written.

A Solution You'd Like

type: DISTANCE
center:
  x: 300 # Translates x coordinates
  #y: 32 #  Translates y coordinates, only for 3D
  z: 750 # Translates z coordinates

return: DistanceNormalized
  # How the distance should be distributed
  #
  # DistanceNormalized (Default) = Linearly redistribute distance radius.inner & radius.outer to -1 and 1 respectively
  #                                                     Technically could be done with LINEAR type, but this is a training-wheel sampler
  # Distance = raw distance from center

radius: # Only relevant for return=DistanceNormalized
  inner: 30 # Optional, defaults to 0
  outer: 500 # Not optional

astrsh avatar Jun 15 '22 01:06 astrsh