mirror of
https://github.com/minetest/minetest.git
synced 2025-07-04 00:40:24 +02:00
Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA
This commit is contained in:
@ -168,6 +168,8 @@ enum MaterialType{
|
||||
// defined by extra parameters
|
||||
#define MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES 0x08
|
||||
#define MATERIAL_FLAG_HIGHLIGHTED 0x10
|
||||
#define MATERIAL_FLAG_TILEABLE_HORIZONTAL 0x20
|
||||
#define MATERIAL_FLAG_TILEABLE_VERTICAL 0x40
|
||||
|
||||
/*
|
||||
This fully defines the looks of a tile.
|
||||
@ -216,7 +218,9 @@ struct TileSpec
|
||||
alpha == other.alpha &&
|
||||
material_type == other.material_type &&
|
||||
material_flags == other.material_flags &&
|
||||
rotation == other.rotation
|
||||
rotation == other.rotation &&
|
||||
(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL) &&
|
||||
(material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)
|
||||
);
|
||||
}
|
||||
|
||||
@ -250,12 +254,26 @@ struct TileSpec
|
||||
}
|
||||
material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
|
||||
? true : false;
|
||||
if (!(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)) {
|
||||
material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
|
||||
}
|
||||
if (!(material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
|
||||
material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
|
||||
}
|
||||
}
|
||||
|
||||
void applyMaterialOptionsWithShaders(video::SMaterial &material) const
|
||||
{
|
||||
material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
|
||||
? true : false;
|
||||
if (!(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)) {
|
||||
material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
|
||||
material.TextureLayer[1].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
|
||||
}
|
||||
if (!(material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL)) {
|
||||
material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
|
||||
material.TextureLayer[1].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
|
||||
}
|
||||
}
|
||||
|
||||
u32 texture_id;
|
||||
|
Reference in New Issue
Block a user