PolyhedralDev / Terra

Voxel world generation modding platform
MIT License
642 stars 85 forks source link

Add cell center offset return to CELLULAR sampler #407

Closed Rearth closed 11 months ago

Rearth commented 11 months ago

Pull Request

Brief description.

Adds a new return type to the cellular sampler, based on the offset of the coordinates relative to the cell center. More about this is in "Goal of the PR"

What Issues Does This Fix?

Currently there is no way to create terrain EQs with cells where the result is based on the position relative to the center. It is possible to do something similar by combining distance and angle samplers, but this will result in worse performance and confusion than this approach.

Licensing

Goal of the PR

Minor addition to the cellular sampler in the noise functions plugin. Adds another return type which also uses the noioseLookup, but instead of sampling at the center of the cell, it passes the offset of the current position to the center of the cell to the sampler. This allows manipulations of a cell relative to the center, e.g. tilting the surface of a cell, or treating the left side of a cell different.

I am not too happy with the naming of the return type, ideas for improvement would be appreciated.

A follow up to the terra-docs repository will be added in a bit.

Affects of the PR

Types of changes

Compatiblity

Contribution Guidelines.

Documentation

Testing