fix: Improve mesh transparency identification
This fixes certain visual artifacts, e.g. in danm16.
This commit is contained in:
parent
164aaed883
commit
34eebd3de4
1 changed files with 8 additions and 3 deletions
|
@ -88,12 +88,17 @@ bool ModelMesh::shouldRender() const {
|
|||
}
|
||||
|
||||
bool ModelMesh::isTransparent() const {
|
||||
if (!_diffuse || _envmap) return false;
|
||||
if (_transparency > 0) return true;
|
||||
|
||||
TextureFeatures features = _diffuse->features();
|
||||
if (features.blending == TextureBlending::Additive) return true;
|
||||
|
||||
if (_envmap || _bumpyShiny || _bumpmap) return false;
|
||||
|
||||
PixelFormat format = _diffuse->pixelFormat();
|
||||
TextureFeatures features = _diffuse->features();
|
||||
if (format == PixelFormat::RGB || format == PixelFormat::BGR || format == PixelFormat::DXT1) return false;
|
||||
|
||||
return features.blending == TextureBlending::Additive || format == PixelFormat::DXT5 || format == PixelFormat::BGRA;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModelMesh::hasDiffuseTexture() const {
|
||||
|
|
Loading…
Reference in a new issue