Bugfix: fixed a bug that caused some models to be half-transparent when
it was not needed.
This commit is contained in:
parent
334cad4657
commit
93080f506a
@ -46,6 +46,8 @@ public final class MaterialContext implements Savable {
|
|||||||
public static final int MTEX_ALPHA = 0x80;
|
public static final int MTEX_ALPHA = 0x80;
|
||||||
public static final int MTEX_AMB = 0x800;
|
public static final int MTEX_AMB = 0x800;
|
||||||
|
|
||||||
|
public static final int FLAG_TRANSPARENT = 0x10000;
|
||||||
|
|
||||||
/* package */final String name;
|
/* package */final String name;
|
||||||
/* package */final List<CombinedTexture> loadedTextures;
|
/* package */final List<CombinedTexture> loadedTextures;
|
||||||
|
|
||||||
@ -96,20 +98,25 @@ public final class MaterialContext implements Savable {
|
|||||||
TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class);
|
TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class);
|
||||||
loadedTextures = textureHelper.readTextureData(structure, new float[] { diffuseColor.r, diffuseColor.g, diffuseColor.b, diffuseColor.a }, false);
|
loadedTextures = textureHelper.readTextureData(structure, new float[] { diffuseColor.r, diffuseColor.g, diffuseColor.b, diffuseColor.a }, false);
|
||||||
|
|
||||||
// veryfying if the transparency is present
|
long flag = ((Number)structure.getFieldValue("flag")).longValue();
|
||||||
// (in blender transparent mask is 0x10000 but its better to verify it because blender can indicate transparency when
|
if((flag & FLAG_TRANSPARENT) != 0) {
|
||||||
// it is not required
|
// veryfying if the transparency is present
|
||||||
boolean transparent = false;
|
// (in blender transparent mask is 0x10000 but its better to verify it because blender can indicate transparency when
|
||||||
if (diffuseColor != null) {
|
// it is not required
|
||||||
transparent = diffuseColor.a < 1.0f;
|
boolean transparent = false;
|
||||||
if (loadedTextures.size() > 0) {// texutre covers the material color
|
if (diffuseColor != null) {
|
||||||
diffuseColor.set(1, 1, 1, 1);
|
transparent = diffuseColor.a < 1.0f;
|
||||||
|
if (loadedTextures.size() > 0) {// texutre covers the material color
|
||||||
|
diffuseColor.set(1, 1, 1, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (specularColor != null) {
|
||||||
|
transparent = transparent || specularColor.a < 1.0f;
|
||||||
|
}
|
||||||
|
this.transparent = transparent;
|
||||||
|
} else {
|
||||||
|
transparent = false;
|
||||||
}
|
}
|
||||||
if (specularColor != null) {
|
|
||||||
transparent = transparent || specularColor.a < 1.0f;
|
|
||||||
}
|
|
||||||
this.transparent = transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,7 +209,6 @@ public class SubdivisionSurfaceModifier extends Modifier {
|
|||||||
* @param temporalMesh
|
* @param temporalMesh
|
||||||
* the mesh to be subdivided
|
* the mesh to be subdivided
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void subdivideSimple(TemporalMesh temporalMesh) {
|
private void subdivideSimple(TemporalMesh temporalMesh) {
|
||||||
Map<Edge, Integer> edgePoints = new HashMap<Edge, Integer>();
|
Map<Edge, Integer> edgePoints = new HashMap<Edge, Integer>();
|
||||||
Map<Face, Integer> facePoints = new HashMap<Face, Integer>();
|
Map<Face, Integer> facePoints = new HashMap<Face, Integer>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user