Texture scale / position / rotation offset

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Texture scale / position / rotation offset

by MirceaKitsune » Wed Jul 10, 2013 11:02

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.
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Wed Jul 10, 2013 13:22

This could be very useful for bigger, more complex nodes (furniture, machines...)

Noob 4 life!
My stuff
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Fri Jul 19, 2013 14:20

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(),
})
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 19, 2013 15:40

You can look here what texture modifications are implemented:
https://github.com/minetest/minetest/blob/master/src/tile.cpp#L1035
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Fri Jul 19, 2013 16:28

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 ;)
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Sun Aug 04, 2013 11:11

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
Last edited by Ragnarok on Sun Aug 04, 2013 11:12, edited 1 time in total.
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Sun Aug 04, 2013 20:08

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.
 


Return to Minetest Features

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron