-
Notifications
You must be signed in to change notification settings - Fork 2.1k
WIP: Position-based texture variants proof-of-concept #16027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
What's the difference between this and world-aligned textures? (looks useful, I'd just like to know the difference though) |
It is similar to the I like this feature, but would prefer it to be implemented as part of the (TurkeyMcMac will not receive your ping https://forum.luanti.org/viewtopic.php?t=29161) |
They do not repeat "exactly" after every 8 nodes, either. I think the difference is most noticeable if you have a large, flat surface of one node. This implementation does combine with param2 coloring, for example! The grass above has param2 color. |
Well, world-aligned textures still do repeat even if they're seamless. |
@kromka-chleba actually @HybridDog has worked on something much more advanced, Stochastic texture sampling: |
I meant the variants param2 feature. |
I think my code currently may actually break the param2 variants, by simply not checking that It would be possible to combine both, but you'd need to specify how the two values interact. So |
…nd needed logic around it to allow game to set variant_offset
Nice work! Considering this is concept approved I will use it instead of the param2 solution for rotated blocks in Mineclonia. It feels so much cleaner without the LBMs and clients will also be able to predict the orientation of placed nodes. |
Implementing #15319 sounds like a good alternative to this for me. |
Honestly, I prefer position-based texture randomization to any param2 hacking by 100x, so much easier to use, and no version compatibility issues. |
This comment was marked as resolved.
This comment was marked as resolved.
I may have trimmed down the randomization code to much - can you try uncommenting some of the lines in Lines 63 to 64 in fa62c59
(and above) if this increases randomness. I tried to make it as cheap as possible. I won't have time the next days. |
This comment was marked as resolved.
This comment was marked as resolved.
Thank you! Makes sense: maybe the position used at that codepath is within a chunk, and hence 0-15. luanti/src/client/mapblock_mesh.cpp Line 347 in fa62c59
|
What's the difference of this PR to world-aligned textures? It seems to me that both attempt to bring texture into the world. Lines 9639 to 9644 in 1c5776d
Added by: #6105 (includes some nice screenshots) |
The crucial difference to world-aligned textures is that it doesn't repeat every 16 nodes, thus more randomness and no repeating patterns. However, in its current implementation this is not the case, and for me to support this feature it would have to be implemented in |
@SmallJoker: non-repeating patterns by randomization. world-aligned textures repeat if you have larger flat surfaces. luanti/src/client/mapblock_mesh.cpp Line 347 in 4e59ce5
|
This PR is based on #13811, add node texture variants.
The majority of the changes comes from the branch!
But instead of using
param2
, it useshash(pos) % variants_count
to choose the texture variant.Before, note the alignment pattern in the grass left of the birch tree:

After, grass textures randomly rotated:

It is possible to use completely different textures as variants. These examples simply used
^[transformR90
etc.It depends on the textures how well this works. Dirt looks okay, but for example these stone textures have a direction to them:
before:

Doing just two variants (

^[transformR180
) works better for these textures:So looking forward to having multiple texture variants for brick walls, mossy brick walls, etc.!