[Mod] Rotated textures [rot_texture]

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

[Mod] Rotated textures [rot_texture]

by Casimir » Sat Dec 27, 2014 22:59

This mod rotated some nodes with mapgen (only on the surface) and when they get placed. This gives the game a much better visual appearance, eliminates the gird and slows down mapgen.
This is just a proof of concept and quite hacky, so don't use this on existing worlds without making a backup.
depends: default
license: GPL v2 or later
download: see attachment
Image
Attachments
rot_texture.tar.gz
(684 Bytes) Downloaded 147 times
Last edited by Casimir on Mon Apr 06, 2015 18:38, edited 1 time in total.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Rotated textures [rot_texture]

by 4aiman » Fri Apr 03, 2015 06:18

Uhmm.. where's the picture? :)

Also, you shouldn't override nodes without making it possible to call the previous after_place (if it exists).
Just copy it to some var and then make a call:
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
for _, node_name in ipairs(nodes) do
   minetest.override_item(node_name, {paramtype2 = "facedir"})
   local old_after_place = minetest.registered_nodes[node_name].after_place
   minetest.override_item(node_name, {after_place_node =
      function(pos)
         local facedir = math.random(0,3)
         minetest.set_node(pos, {name=node_name, param2 = facedir})
         if old_after_place then old_after_place(pos) end
      end
   })
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Rotated textures [rot_texture]

by Napiophelios » Sun Apr 05, 2015 18:52

Wow this is pretty nice effect.
It doesnt look so good with all texture packs/nodes,
but just changing the few nodes you have as defaults makes a real visual impact.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: [Mod] Rotated textures [rot_texture]

by Linuxdirk » Sun Apr 05, 2015 20:42

I hope this would make it into the engine! It looks so much better!
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Rotated textures [rot_texture]

by 4aiman » Mon Apr 06, 2015 05:15

Wow :)
Pretty nice!
As an option this may be a good idea.

But I think that there should be some other way to "mark" a node than a table.
I'd make that using groups. So, how about a group "no_grid" (or whatever you like) and some code in C++ that would do the same? (like wallmounted and facedir, but random). That would be awesome!
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Rotated textures [rot_texture]

by 12Me21 » Mon Apr 06, 2015 13:24

It would be nice if there was a shader for this, though that would require changing some stuff in the engine (I think).
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Rotated textures [rot_texture]

by 4aiman » Mon Apr 06, 2015 13:30

I'm against shaders as the primary way to do it. There won't be any shaders with anything than OpenGL...

I'd like to see a full support of shaders on all renderers, but that ain't just "gonna happen". That would be tremendous amount of work.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Rotated textures [rot_texture]

by 12Me21 » Mon Apr 06, 2015 13:33

Yeah, I guess the current way is probably the best, even if it's a little hacky.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Rotated textures [rot_texture]

by Kilarin » Tue Apr 14, 2015 14:19

Hello, I don't want to hijack the thread, but I've got a question about 4aiman's code above. A question that probably exposes my ignorance of how lua handles scope. :)

old_after_place is local to the for loop. But then you use it when defining a function that will run long after the for loop is gone. So am I correct in assuming that when lua creates the individual function, it replaces old_after_place with the actual value of old_after_place at that time? And then when you move to the next node, a NEW function will be created with a DIFFERENT static value for old_after_place.

With the result being that each node has a different function with a different value of old_after_place (obviously what we WANT it to do) We will NOT have a situation where every time any of these functions are called old_after_place has the same value of whatever it was at the end of the for loop. (NOT what we want)

Correct? And thank you VERY much for your patience in explaining things to a lua idiot. :)
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: [Mod] Rotated textures [rot_texture]

by Kilarin » Wed Apr 15, 2015 00:21

I believe I confirmed the answer myself:
http://lua-users.org/wiki/ScopeTutorial
even if the outer scope has passed, the function will still hold on to the variable.
loops create a new scope on each iteration:

Not at all what I was expecting, but VERY handy for creating "stacks" of functions!

thanks!
 

User avatar
texmex
Member
 
Posts: 226
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Rotated textures [rot_texture]

by texmex » Fri Jan 20, 2017 10:18

Casimir, did you ever continue to work on this? It's such a visual quality improvement.
I spend all my days going down to the mines. Under the ground where the sun never shines. Breaking my back I put heat in your house. I’ve got the roar of a digtron, the breath of a mouse.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Rotated textures [rot_texture]

by burli » Fri Jan 20, 2017 10:49

 

User avatar
texmex
Member
 
Posts: 226
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Rotated textures [rot_texture]

by texmex » Fri Jan 20, 2017 12:09

Thank you. It seems greatly debated, but no outcome yet.
I spend all my days going down to the mines. Under the ground where the sun never shines. Breaking my back I put heat in your house. I’ve got the roar of a digtron, the breath of a mouse.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: [Mod] Rotated textures [rot_texture]

by Linuxdirk » Sat Jan 21, 2017 11:12

texmex wrote:… but no outcome yet.

This is the conclusion for more or less any idea one particular person (yes, I noticed the deletion of forum posts) from the development team personally disagrees with.

It’s a pity that Minetest’s growth in features and visual improvement gets blocked so often because “no-one needs/wants that” gets confused with “I disagree with that” and “it is hard to implement” is used as replacement for “I dont have the time/patience to implement it by myself”.
 

User avatar
Melkor
Member
 
Posts: 285
Joined: Sat Sep 24, 2011 01:03

Re: [Mod] Rotated textures [rot_texture]

by Melkor » Wed Jan 25, 2017 00:55

This is a MUST BE in the engine, i love to see more organic stuff instead a predictable pattern on floor/walls, plus viewtopic.php?f=5&t=10921 (Texture related requests). This mixed with THIS https://www.youtube.com/watch?v=qWuI664krsI (random position/rotation of plantlike nodes)
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Rotated textures [rot_texture]

by azekill_DIABLO » Wed Jan 25, 2017 10:27

Casimir, you say it can't be used in created worlds, that we need a backup, that it's quite slowish and hacky or even hecky, but your false! it's pretty fast, only slows the FIRST time you create the world, then goes like charm! i never got problem looks very nice and it's pretty simple. It never created any mapgen bug or world corrupt :) It really needs to be in Minetest by default!
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: [Mod] Rotated textures [rot_texture]

by TumeniNodes » Wed Jan 25, 2017 14:58

I would love to see this.

But, if there were a way to set a node to use a few variable textures, which could be selected at random intervals, automatically, while being placed.
default_brick, could have 4 or 5 variable textures, and as you placed them, 4-5 is selected randomly via code. And the same could be done with the base nodes such as grass, dirt, stone during map loading.

Such a feature as this though, would be a good candidate for on/off settings..., and/or even the ability for it to be called from mods where it could be set to specific nodes my the mod creator, with yet another means to set it on or off within the mod as well and per node it is assigned to.

Maybe it could be called "RP" (random placement) so..., RP textures.

I don't know how feasible any of that is but, it would be nice.
Flick?... Flick who?
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Rotated textures [rot_texture]

by azekill_DIABLO » Wed Jan 25, 2017 16:50

yes but we would have TumeniNodes :D
(i waited for years placing this... years!!!)
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 13 guests

cron