I noticed that something odd is going on with door/trapdoor textures. Whenever you open or close them, the textures may get flipped incorrectly.
Just look at the following screenshots:
(FIXED) Closed trapdoors with equal facedir stacked above each other. The texture is flipped on the opposite side.

(FIXED) Two trapdoors, same facedir, one closed, one opened. Again, the texture is flipped incorrectly for the open one:

(FIXED) The sides of the trapdoors get flipped when opening, too: Note the yellow/blue stripe should be at the right for the open trapdoor (However, I am not sure about that one. Maybe this works when I change the “side” texture):

(LOW PRIORITY, NON-TRIVIAL) For doors, the inner and outer “sides” get flipped, too, when opening them:


I am not sure if these are all issues. Try the test textures for yourselves and test a bit with the doors and trap doors.
Here you can use the test textures I used:



I have added several “markers” on the test textures to make them easily distinguishable. The dotted line on the front textures mark the “hinge”. The colors on the sides are for orientation. The yellow square on the door marks the top left of the door image (not the physical “left”). The letters on the trapdoor mean “up”, “down”, “left” and “right”.
This is probably fixable for doors, since those are mesh nodes now.
The problem with trapdoors is that they're nodeboxes. I need to see if we can play with transforms to get this right :/
Can you map different textures on 2 opposite sides (e.g. top and bottom) of a nodebox? If yes, it should be fixable. If not, then we are indeed in trouble. xD
The open trapdoor is already using per-side tiles, we can transformfx them to the right angle.
I think this was fixed with #1202.
@Wuzzy2 usually uses the stable version, where this fix isn't included yet.
See #1202 perhaps Wuzzy2's more detailed test textures are showing a bug missed with simpler textures?
Oops, sorry. I wasn't using the dev version this time, I guess. Usually I use the dev version when bug hunting but this time I have just forgotten it. So sorry. :-(
I have tested everything again with https://github.com/minetest/minetest_game/commit/56d6eaed85fb959c2c5e6145038d408d795b262f.
Trapdoor top and bottom images are OK now. :-)
The following problems remain:
And finally, there is a bug so obvious with the test textures we all have overlooked it in plain sight:
Notice the door front turns from I to II when opening/closing? This should not be the case, the door texture should stay the same.
What this means is, you cannot currently use two different textured door sides because the texture will change whenever you open or close the door.
This bug has of course been invisible because texture drawers usually just worked around this (intentional or not) by using basically the same texture on both sides, just flipped on the other side.
Since the pictures are of the old version, they show both old bugs and new bugs. I think it would be best to make a few new screenshots since I can't seem to reproduce the trapdoor side issue myself (it all looked ok to me when I tried yesterday, but maybe I'm not seeing it right).
The issue with doors is that there's essentially no "inside" or "outside", since it would require more nodes make the textures all entirely consistent. There's essentially only a left-hinged door and a right-hinged door. When you open (1)a left-hinged door, (2)the node is replaced with a right-hinged door (and (3) rotated 90 degrees). When you close it again, it's again replaced with a left-hinged door (and rotated back).
Because of this, the "inside" of the door is essentially flipped every time.
edit: graph to illustrate:
1) (front of door(outside) is on the bottom)
....
....
....
hvvv
2) (front of door(outside) is on the bottom!)
....
....
....
vvvh
3) (front of door(outside) is on the inside!)
<...
<...
<...
h...
In order to get the "full set" of doors, we'd need these:
hvvv
h^^^
^^^h
vvvh
Which means 4 nodes, not 2, since we can't change any of these to another one through rotation alone.
In that case i think doors are ok as they are, the simplicity is more important than the ability to use different textures for the sides, which would be very rarely done anyway.
@sofar What about making the left-hinged door have the outside in the side in which the right-hinged door has the inside?
I don't know if this allows textures that are clearly the outside / inside, but at least it would be possible to make each side different without the texture switching in an unexpected way when the door opens/closes.
1) left-hinged door
....
....
....
hvvv
2) right-hinged door
....
....
....
^^^h
3) right-hinged door rotated = left-hinged door open
>...
>...
>...
h...
4) left-hinged door rotated = right-hinged door open
...>
...>
...>
...h
@ferk what you drew is the existing nodes (it's 2 nodes, you can go from your 1 to 4 by rotation, and from your 2 to 3)
Perhaps there's a UV map mirror issue here where I need to flip a texture or something - I'll need to look in blender for that.
@sofar yes, I know there are those two nodes, I actually meant changing the UV map to use different texture order in left-hinged and right-hinged (that's why I wrote ^^^h instead of the vvvh you wrote for the right-hinged door).
The outside face of one mesh should have the same texture as the inside face of the other. Instead of both meshes using the same inside and outside faces (maybe one of the meshes having them mirrored).
Note: I just updated the issue and marked the fixed parts of this issue.
@ferk it is using a different texture for each side.
https://github.com/minetest/minetest_game/blob/master/mods/doors/textures/doors_door_wood.png
@sofar What I mean is that both left-hinged and right-hinged use the same texture in the same side:
Both of them are (I)-front (II)-back.
FRONT:

BACK:

If one of them was instead (II)-front (I)-back (ie. the outside face of one mesh had the same texture as the inside face of the other), then the opened door would be in the right orientation as I was trying to explain in the previous comments.
The texture is already mirrored, what I mean is that you can make the rotation work fine if instead of mirroring you switched the UV mapping, using different faces.
Maybe the current UV mapping was done intentionally like this to have double doors that use the same texture, mirrored. But then a decision has to be made: either double doors with same texture or consistent door-opening for inside-outside textures. We can't have both in only 2 nodes.
One curious detail: the upper border of the doors is actually different, as can be seen in the "BACK" screenshot, so if you look at the doors from above and don't look at the sides it actually looks as if they rotated correctly when you open them. The same would happen if the texture on their sides were different.
Yes, the idea was to use 1 texture for all models.
I need to load up the model and UV map in blender to see if I haven't made any mistakes, which there seem to be according to the screenshots. But, I've got other things I'm working on as well, and this isn't necessarily high priority (it's a visual problem, and it took 5 months to get spotted).
Having spent some time looking at the issue again, I think I want to leave it as is. It exposes a painful miscalculation on my side - we should have either gone for a simpler UV map or with 4 nodes.
I have no solution and I don't feel like making one. Perhaps once we have meta set nodedef this could be solved easily, or we redo doors after 0.4.16 and fix this issue with 4 nodes instead of 2.
@sofar
Not trying to be rude, but Is there a reason that more than a year later, this is still an open issue? Is it due to lack of volunteers, or low priority, etc.?
I'm using v5.0.1
b3u the usual issue, lack of core dev time, also it is low priority.
I'm fine with leaving doors as they are, for now at least, it just may mean some care when creating textures for them.
The remaining problem is:
Sides of trapdoors flipped when opening/closing (see above)
Wuzzy2's test texture should be used to recheck the bug, then it may be possible to fix this easily using texture transforms.
I still have the issue with normal doors. It's not clear to me how to fix this. It means that the back of my door becomes the front when open. My door texture is that of a picture frame.
See https://github.com/minetest/minetest_game/issues/1361#issuecomment-298146842 non-trivial to fix. Best for now to have matching textures.
The sides of the trapdoors get flipped when opening, too: Note the yellow/blue stripe should be at the right for the open trapdoor (However, I am not sure about that one. Maybe this works when I change the “side” texture):
Retested trapdoors with latest code.
After much experimenting, it seems the 'side' texture has to be of the following form:


The lowest 2 rows are the sides when closed.
The highest 2 rows are the sides when open, they are drawn upright , not inverted.
Wuzzy2's test side texture didn't work because the top 2 rows were inverted.
//////////////
The form of side textures in MTG master is (only the highest 2 rows and lowest 2 rows are used):

The highest 2 rows are inverted.
The only texture transforms we can use are flipping and rotation, so it is actually impossible for a texture of this form to work properly.
///////////////
I altered the tiles to (only 2nd texture changed):
def_opened.tiles = {
def.tile_side,
def.tile_side .. '^[transform2',
def.tile_side .. '^[transform3',
def.tile_side .. '^[transform1',
def.tile_front .. '^[transform46',
def.tile_front .. '^[transform6'
}
Behaviour is confirmed fixed in testing:




The side textures in the doors mod would need altering if we make this change.
WIll test this further.
Testing MTG master, both trapdoors flip their side textures when opened:




So the side textures do need editing anyway.
I can make a PR for new side textures and new tiles definition, it won't break any mods as the same pixel rows are used.
Much attention has been given to trapdoors. Remember that normal doors are still an issue.
b3u, we know.
You seem to have ignored https://github.com/minetest/minetest_game/issues/1361#issuecomment-488143372 and https://github.com/minetest/minetest_game/issues/1361#issuecomment-488373348
Fixing this is difficult because all doors in worlds would need automatically replacing with the new system.
Please stop ignoring what has been written, repeating the obvious and repeatedly complaining, it won't make a fix happen any sooner. You're being irritating.
You've made an unnecessary fuss in another issue too.
PR #2361
I think the only real way to fix it is to use 2 mesh nodes and do proper
UV wrapping based on 2 separate 16x16 textures (top and side). This
would be the easiest solution and would correctly work with rotating the
trapdoor without any special magic. This would ultimately also work for
the normal doors.
Paramat: I apologize for being irritating. I didn't intend to cause a fuss. I know I can be obsessive about things. I'm sorry.
Ok =) sorry i got annoyed.
sofar, i have a simple fix for trapdoors. After the hell we went through moving to meshnode doors i disapprove of doing the same for trapdoors unless it becomes essential to do so. Let's keep them simple if possible.
For the same reason i disapprove of fixing the door issue if it involves an LBM to replace existing doors with a new system. Being able to have door sides different is, i think, not important enough or used enough to justify it.
sofar, i have a simple fix for trapdoors. After the hell we went through moving to meshnode doors i disapprove of doing the same for trapdoors unless it becomes essential to do so. Let's keep them simple if possible.
I think you may have broken texture packs with that change. It's probably not a big deal.
Why is this issue still open; the trapdoor sides seem to be fixed?
See text of first post, this issue is now only for the door issue.
Closed by #2372 or no?