aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJürgen Doser <jurgen.doser@gmail.com>2013-01-25 15:52:53 +0100
committerPilzAdam <PilzAdam@gmx.de>2013-02-10 12:45:25 +0100
commit6b1420a58af7472880bebb9d0f89be987bc25da1 (patch)
treea7c5e05f198868c011e419942235ccce952a9529 /src
parent1cda39d5bb1da90116ec9fb3da913634312b62fa (diff)
downloadminetest-6b1420a58af7472880bebb9d0f89be987bc25da1.tar.gz
minetest-6b1420a58af7472880bebb9d0f89be987bc25da1.tar.bz2
minetest-6b1420a58af7472880bebb9d0f89be987bc25da1.zip
Disable backface culling for drawtype plantlike and only draw 2 faces instead of 4
This way, plants actually show the real backface on their back side, i.e., the front face mirrored around the vertical axis, instead of showing the front face on both sides. This looked weird when the texture was not symmetrical around the vertical axis.
Diffstat (limited to 'src')
-rw-r--r--src/content_mapblock.cpp12
-rw-r--r--src/nodedef.cpp5
2 files changed, 5 insertions, 12 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index aa3c061d6..290890490 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -733,7 +733,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
- for(u32 j=0; j<4; j++)
+ for(u32 j=0; j<2; j++)
{
video::S3DVertex vertices[4] =
{
@@ -759,16 +759,6 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
for(u16 i=0; i<4; i++)
vertices[i].Pos.rotateXZBy(-45);
}
- else if(j == 2)
- {
- for(u16 i=0; i<4; i++)
- vertices[i].Pos.rotateXZBy(135);
- }
- else if(j == 3)
- {
- for(u16 i=0; i<4; i++)
- vertices[i].Pos.rotateXZBy(-135);
- }
for(u16 i=0; i<4; i++)
{
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 560c6090d..729c69c92 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -604,9 +604,12 @@ public:
}
}
break;
+ case NDT_PLANTLIKE:
+ f->solidness = 0;
+ f->backface_culling = false;
+ break;
case NDT_TORCHLIKE:
case NDT_SIGNLIKE:
- case NDT_PLANTLIKE:
case NDT_FENCELIKE:
case NDT_RAILLIKE:
case NDT_NODEBOX: