Page 1 of 1

Texture scale / position / rotation offset

PostPosted: Wed Jul 10, 2013 11:02
by MirceaKitsune
I'm thinking of a parameter for node definitions (usable on any drawtype) to offset the scale of textures over the default size. When not set ,1 is assumed and each texture fills the face of one block (current behavior). When 0.5, the texture is twice smaller and fits 4 times over the face of a normal node. When 2, the texture is twice larger and fits across 4 nodes.

Although IMO the urgent necessity is at least a value to change scale, we could allow individual X and Z scale offsets, as well as X and Z coordinate offsets to position the texture. We could also allow 0 / 90 / 180 / 270 rotations... or hell, even full texture rotation if possible!

This was never a necessity for 16 x 16 texture packs. But with HD textures such as grass, stone, wooden planks, etc. it would be fantastic and very needed. Instead of repeating a grass texture for each node which is very limiting, you could map it across 4 / 6 / 8 / etc. nodes. Such would be a huge improvement for anything larger than 128 x 128 px and also allow for interesting new designs and better coordinated node appearance.

PostPosted: Wed Jul 10, 2013 13:22
by Mossmanikin
This could be very useful for bigger, more complex nodes (furniture, machines...)

PostPosted: Fri Jul 19, 2013 14:20
by Casimir
Rotation is already possible. But I haven't seen it documented anywhere.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("default:tree_horizontal", {
    description = "Tree",
    tiles = {
        "default_tree.png",
        "default_tree.png",
        "default_tree.png^[transformR90",
        "default_tree.png^[transformR90",
        "default_tree_top.png",
        "default_tree_top.png"
    },
    paramtype2 = "facedir",
    groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=1},
    sounds = default.node_sound_wood_defaults(),
})

PostPosted: Fri Jul 19, 2013 15:40
by PilzAdam
You can look here what texture modifications are implemented:
https://github.com/minetest/minetest/blob/master/src/tile.cpp#L1035

PostPosted: Fri Jul 19, 2013 16:28
by webdesigner97
And

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
tiles = "mod_texture_1.png^mod_texture_2.png"


and check out the code of default:furnace. There's an example on how to use just a part of a texture ;)

PostPosted: Sun Aug 04, 2013 11:11
by Ragnarok
I don't know if I understood well, but there is no way to shift textures vertically (and horizontally) for now? I have this funny issue with delineators when I displace models vertically:
Image

PostPosted: Sun Aug 04, 2013 20:08
by Ragnarok
Thanks a lot Hybrid :) Works perfect! I noticed the textures are cropped if you shift them too much. Helps combining additional texture with shift in the opposite direction.