News for hackers. Stuff that matters.
Re:Practical Real-Time Hex Tiling by teej on Monday July 18, 2022 @01:23PM (#32140787)
You may also enjoy this post originally from The Witness game dev blog: The Nebraska Problem. It’s about how to arrange a series of sprites to avoid visible seam patterns in between them.

https://news.ycombinator.com/item?id=7692332

Re:Practical Real-Time Hex Tiling by max_ on Monday July 18, 2022 @01:04PM (#32140579)
Also, a relevant project Wave Function Collapse[0] [0]: https://github.com/mxgmn/WaveFunctionCollapse
Re:Practical Real-Time Hex Tiling by Llamamoe on Tuesday July 19, 2022 @01:33AM (#32147887)
The author has a newer project, too, MarkovJunior[0], which generalizes to the combination of WFC with arbitrary cellular automata and grammar-substitution-like types of rules, with probabilistic inference robust enough to be able to e.g. solve sokoban levels in addition to generating stunning random results.

[0]: https://github.com/mxgmn/MarkovJunior

Re:Practical Real-Time Hex Tiling by jstanley on Monday July 18, 2022 @12:40PM (#32140287)
Wow, this looks incredibly good considering that the solution for hiding the seams is just to blend things together with a noisy gradient. (EDIT: Or I've misunderstood how it works!)

I assume it works a lot less well on more isotropic textures (e.g. what does wood grain look like?) than on the examples presented here.

What do pathological cases look like?

Re:Practical Real-Time Hex Tiling by Pxtl on Monday July 18, 2022 @04:57PM (#32143575)
I'm also curious how this would work with a regular grid instead of hex-tiled. That is, if you blended the seams and randomly rotated each square as they do with hex-tiling, would it still look good?

And are they splatting a random hexagonal sample from a repeating tiled plane, or are they splatting the exact same image, but arbitrarily rotated? That is, are they using the fact that the image tiles cleanly or does this technique completely obviate the need to use a tiled image?

Re:Practical Real-Time Hex Tiling by lattalayta on Monday July 18, 2022 @01:31PM (#32140871)
Here are some of the original papers for the technique. Although I believe there have been some updates and improvements since.

https://hal.inria.fr/hal-01824773/file/HPN2018.pdf https://www.jcgt.org/published/0008/04/02/paper.pdf

Re:Practical Real-Time Hex Tiling by billconan on Monday July 18, 2022 @12:53PM (#32140442)
> Using hex-tiling allows us to hide the repetition but requires a solution to hide the seams between adjacent hex tiles.

I don't understand this part. If I use square tiles and hide the seams between adjacent tiles, will it look OK? What's the benefit of using hex tiles?

Re:Practical Real-Time Hex Tiling by rootlocus on Monday July 18, 2022 @01:03PM (#32140571)
> If I use square tiles and hide the seams between adjacent tiles, will it look OK?

Square tiling is very obvious, as you can see from the first example [0]. Hex tiling shifts tiles to a less obvious pattern. Also, as I can see from the video, tiles can be rotated while hiding the seams perfectly, which eliminates repetition altogether.

0. https://github.com/mmikk/mmikk.github.io/blob/master/picture...

Re:Practical Real-Time Hex Tiling by BeeOnRope on Monday July 18, 2022 @04:38PM (#32143338)
Is that first example comparing squaring filing with the same _fixed_ rotation for each tile versus hex-tiling with random or otherwise varying rotation?
Re:Practical Real-Time Hex Tiling by pugworthy on Monday July 18, 2022 @01:03PM (#32140565)
You don't get the typical visual repetition of features along X/Y lines
Re:Practical Real-Time Hex Tiling by jayd16 on Monday July 18, 2022 @01:07PM (#32140618)
You could use world position (or just some non-uniform sampling) to offset the UVs and get a similar effect, no? Is hex significant or is it just one of any number of ways to break up the uniformity?
Re:Practical Real-Time Hex Tiling by carbadtraingood on Monday July 18, 2022 @01:13PM (#32140692)
In practice, yes, it's very common to use a shader to sample the texture with some rotation and noise. Most games have a shader level implementation to address this, and we've done that for a decade at least.

See: https://iquilezles.org/articles/texture repetition/ for a good breakdown on some techniques.

Re:Practical Real-Time Hex Tiling by adamrezich on Monday July 18, 2022 @05:06PM (#32143713)
the URL should have been https://iquilezles.org/articles/texturerepetition but this is indeed a great resource
Re:Practical Real-Time Hex Tiling by ajuc on Monday July 18, 2022 @01:40PM (#32140984)
Nice, but the example is unfair, you can make rect tiling look just as good.
Re:Practical Real-Time Hex Tiling by capableweb on Monday July 18, 2022 @03:05PM (#32142160)
With a single texture and without wasting a bunch of performance modifying/filtering it on the fly? How exactly? Would make a great addition to this discussion :)
Re:Practical Real-Time Hex Tiling by agweber on Monday July 18, 2022 @03:34PM (#32142520)
I wonder if having a single texture and randomly rotation it with blending the edges on a square grid would look just as good or not. The texture would just have to be larger than the tile it covers
Re:Practical Real-Time Hex Tiling by hypertele-Xii on Monday July 18, 2022 @05:32PM (#32144120)
In another comment this was linked: https://iquilezles.org/articles/texturerepetition/

It does waste performance, that's unavoidable.

Re:Practical Real-Time Hex Tiling by l0b0 on Monday July 18, 2022 @04:49PM (#32143484)
Are there any popular game mods implementing hex tiling in originally square-tiled games? A lot of classics, like Skyrim, should look a lot better when viewing tiled surfaces at a distance.
Re:Practical Real-Time Hex Tiling by andybak on Monday July 18, 2022 @07:01PM (#32145227)
Same dev responsible for http://www.mikktspace.com/ I believe.

Do they still work for Unity?

Re:Practical Real-Time Hex Tiling by username256 on Monday July 25, 2022 @12:39PM (#32226893)
They still do, yes.
Re:Practical Real-Time Hex Tiling by jayd16 on Monday July 18, 2022 @01:27PM (#32140831)
Anyone have an elevator pitch of the dithering technique? Is it consistent across mip levels and camera angles? Does it take samples or is it just math?
Re:Practical Real-Time Hex Tiling by pornel on Tuesday July 19, 2022 @03:44PM (#32156940)
The key improvement here is not in the tile shape, but from random rotation of the textures and blending of tile edges.
Re:Practical Real-Time Hex Tiling by kibwen on Monday July 18, 2022 @04:35PM (#32143305)
Hex grids are the dual of triangle grids, right? Does the approach here also apply to triangle grids?
Re:Practical Real-Time Hex Tiling by adamrezich on Monday July 18, 2022 @05:05PM (#32143702)
I think the "gradient around the edges" of the tiles might work better with hexagons than triangles