mirror of
https://github.com/minetest/minetest.git
synced 2025-01-11 15:57:29 +01:00
Fix more transparency issues with ogles2 driver (#8005)
This commit is contained in:
parent
ba07a8b872
commit
d994f7ca5f
@ -1062,6 +1062,7 @@ void GenericCAO::updateTextures(std::string mod)
|
|||||||
texturestring = m_prop.textures[0];
|
texturestring = m_prop.textures[0];
|
||||||
texturestring += mod;
|
texturestring += mod;
|
||||||
m_spritenode->getMaterial(0).MaterialType = material_type;
|
m_spritenode->getMaterial(0).MaterialType = material_type;
|
||||||
|
m_spritenode->getMaterial(0).MaterialTypeParam = 0.5f;
|
||||||
m_spritenode->setMaterialTexture(0,
|
m_spritenode->setMaterialTexture(0,
|
||||||
tsrc->getTextureForMesh(texturestring));
|
tsrc->getTextureForMesh(texturestring));
|
||||||
|
|
||||||
@ -1097,6 +1098,7 @@ void GenericCAO::updateTextures(std::string mod)
|
|||||||
// Set material flags and texture
|
// Set material flags and texture
|
||||||
video::SMaterial& material = m_animated_meshnode->getMaterial(i);
|
video::SMaterial& material = m_animated_meshnode->getMaterial(i);
|
||||||
material.MaterialType = material_type;
|
material.MaterialType = material_type;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
material.TextureLayer[0].Texture = texture;
|
material.TextureLayer[0].Texture = texture;
|
||||||
material.setFlag(video::EMF_LIGHTING, true);
|
material.setFlag(video::EMF_LIGHTING, true);
|
||||||
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
||||||
@ -1143,6 +1145,7 @@ void GenericCAO::updateTextures(std::string mod)
|
|||||||
// Set material flags and texture
|
// Set material flags and texture
|
||||||
video::SMaterial& material = m_meshnode->getMaterial(i);
|
video::SMaterial& material = m_meshnode->getMaterial(i);
|
||||||
material.MaterialType = material_type;
|
material.MaterialType = material_type;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
material.setFlag(video::EMF_LIGHTING, false);
|
material.setFlag(video::EMF_LIGHTING, false);
|
||||||
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
||||||
material.setTexture(0,
|
material.setTexture(0,
|
||||||
|
@ -282,6 +282,7 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
|
|||||||
material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
|
material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
|
||||||
material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
|
material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
|
||||||
material.MaterialType = m_material_type;
|
material.MaterialType = m_material_type;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
||||||
// Enable bi/trilinear filtering only for high resolution textures
|
// Enable bi/trilinear filtering only for high resolution textures
|
||||||
if (dim.Width > 32) {
|
if (dim.Width > 32) {
|
||||||
@ -426,6 +427,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
|
|||||||
for (u32 i = 0; i < material_count; ++i) {
|
for (u32 i = 0; i < material_count; ++i) {
|
||||||
video::SMaterial &material = m_meshnode->getMaterial(i);
|
video::SMaterial &material = m_meshnode->getMaterial(i);
|
||||||
material.MaterialType = m_material_type;
|
material.MaterialType = m_material_type;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
||||||
material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter);
|
material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter);
|
||||||
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
|
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
|
||||||
@ -569,6 +571,7 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
|
|||||||
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
|
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
|
||||||
video::SMaterial &material = buf->getMaterial();
|
video::SMaterial &material = buf->getMaterial();
|
||||||
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
material.setFlag(video::EMF_BILINEAR_FILTER, false);
|
||||||
material.setFlag(video::EMF_TRILINEAR_FILTER, false);
|
material.setFlag(video::EMF_TRILINEAR_FILTER, false);
|
||||||
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
||||||
@ -619,6 +622,7 @@ scene::SMesh *getExtrudedMesh(ITextureSource *tsrc,
|
|||||||
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
|
||||||
material.setFlag(video::EMF_LIGHTING, false);
|
material.setFlag(video::EMF_LIGHTING, false);
|
||||||
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||||
|
material.MaterialTypeParam = 0.5f;
|
||||||
}
|
}
|
||||||
scaleMesh(mesh, v3f(2.0, 2.0, 2.0));
|
scaleMesh(mesh, v3f(2.0, 2.0, 2.0));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user