mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA
This commit is contained in:
parent
7a6e4dc54a
commit
3295f3c401
4 changed files with 35 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue