Skip to content

Commit d994f7c

Browse files
stujones11nerzhul
authored andcommittedDec 20, 2018
Fix more transparency issues with ogles2 driver (#8005)
1 parent ba07a8b commit d994f7c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

Diff for: ‎src/client/content_cao.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ void GenericCAO::updateTextures(std::string mod)
10621062
texturestring = m_prop.textures[0];
10631063
texturestring += mod;
10641064
m_spritenode->getMaterial(0).MaterialType = material_type;
1065+
m_spritenode->getMaterial(0).MaterialTypeParam = 0.5f;
10651066
m_spritenode->setMaterialTexture(0,
10661067
tsrc->getTextureForMesh(texturestring));
10671068

@@ -1097,6 +1098,7 @@ void GenericCAO::updateTextures(std::string mod)
10971098
// Set material flags and texture
10981099
video::SMaterial& material = m_animated_meshnode->getMaterial(i);
10991100
material.MaterialType = material_type;
1101+
material.MaterialTypeParam = 0.5f;
11001102
material.TextureLayer[0].Texture = texture;
11011103
material.setFlag(video::EMF_LIGHTING, true);
11021104
material.setFlag(video::EMF_BILINEAR_FILTER, false);
@@ -1143,6 +1145,7 @@ void GenericCAO::updateTextures(std::string mod)
11431145
// Set material flags and texture
11441146
video::SMaterial& material = m_meshnode->getMaterial(i);
11451147
material.MaterialType = material_type;
1148+
material.MaterialTypeParam = 0.5f;
11461149
material.setFlag(video::EMF_LIGHTING, false);
11471150
material.setFlag(video::EMF_BILINEAR_FILTER, false);
11481151
material.setTexture(0,

Diff for: ‎src/client/wieldmesh.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ void WieldMeshSceneNode::setExtruded(const std::string &imagename,
282282
material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
283283
material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
284284
material.MaterialType = m_material_type;
285+
material.MaterialTypeParam = 0.5f;
285286
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
286287
// Enable bi/trilinear filtering only for high resolution textures
287288
if (dim.Width > 32) {
@@ -426,6 +427,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
426427
for (u32 i = 0; i < material_count; ++i) {
427428
video::SMaterial &material = m_meshnode->getMaterial(i);
428429
material.MaterialType = m_material_type;
430+
material.MaterialTypeParam = 0.5f;
429431
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
430432
material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter);
431433
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
@@ -569,6 +571,7 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
569571
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
570572
video::SMaterial &material = buf->getMaterial();
571573
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
574+
material.MaterialTypeParam = 0.5f;
572575
material.setFlag(video::EMF_BILINEAR_FILTER, false);
573576
material.setFlag(video::EMF_TRILINEAR_FILTER, false);
574577
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
@@ -619,6 +622,7 @@ scene::SMesh *getExtrudedMesh(ITextureSource *tsrc,
619622
material.setFlag(video::EMF_BACK_FACE_CULLING, true);
620623
material.setFlag(video::EMF_LIGHTING, false);
621624
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
625+
material.MaterialTypeParam = 0.5f;
622626
}
623627
scaleMesh(mesh, v3f(2.0, 2.0, 2.0));
624628

0 commit comments

Comments
 (0)