mattkimber / gorender

Go implementation of Transrender sprite renderer
MIT License
9 stars 2 forks source link

Implement different tiling modes #11

Closed ahyangyi closed 1 month ago

ahyangyi commented 1 month ago

Hi,

A problem I have been encountering when working on my modular station set is the limitation in the existing TiledNormals option: if a tile is designed to connect with other tiles in ways other than repeating itself, TiledNormals often cannot help, and I have to resort in using process colors to control the normals. Which becomes unmanageable with voxel models with lots of moving parts.

So this PR is my attempt to improve the situation. Included in are "tiling modes" that are well-defined in various image processing libraries (such as OpenCV): repeat is to assume the outermost elements gets infinitely repeated, reflect is to assume that the current tile connects to a mirror image of itself, and reflect101 is similar but without repeating the border element.

ahyangyi commented 1 month ago

This PR is quite straightforward so I opened it first. However, I'm still testing this patch, so it's a draft for now.

ahyangyi commented 1 month ago

Wow, it made some immediate difference for me. I'm now in a rush to remove as much process colour hack as I can... I think that's an excuse to say it's ready.