PixelGuys / Cubyz

Voxel sandbox game with a large render distance, procedurally generated content and some cool graphical effects.
GNU General Public License v3.0
441 stars 56 forks source link

Prevent repetitiveness of textures #63

Open IntegratedQuantum opened 1 year ago

IntegratedQuantum commented 1 year ago

Textures are fairly repetitive when seen on a flat surface, so it would be good to have some sort of randomness to them.

(Some) Approaches

Random texture rotation

This can be seen in minecraft, but it is limited to a small number of blocks, like stone(→ flat texture) or grass/sand(→ random texture). Because of that it may be a good start, but doesn't work in all cases.

Random texture variants

This can be seen on the cobblestone texture in the java version. While this definitely helps, the texture still looks somwhat repetitive, due to the fact that the borders of all texture variants need to match.

Random white noise overlay

The idea would be to only apply a layer of white noise to the texture. This would be fairly cheap, but it would only work well for noisy textures like grass/dirt/sand.

Fully procedural Textures (3D)

This approach can be seen in the procedural_attempt branch or in seperate repo I made to experiment. In these I used a few layers of simple noise, and as you can see that worked quite well for some blocks: Screenshot at 2022-12-08 22-07-04 However it ultimately failed due to poor performance (an extra 4ms per frame) and because it was too limited for the crystal block and cobblestone textures which require more detail.

Large 2D textures

Larger textures, such that still only 16×16 are drawn per block, would make it repeat at a larger scale. However these textures would not match at the sides. (which hasn't bothered anyone in minecraft, so it could be a non-problem) Additionally no artist would want to make giant textures by hand, so a procedural system is needed.

ikabod-kee commented 2 months ago

191 could fix this issue using "random" connected textures. This feature is basically a clone of "CTM" (Connected textures mod)

https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/resource-packs/resource-pack-discussion/1256361-ctm-an-outdated-guide#ran