From f04654ee20efd2e91e568675538d6d91a4784d25 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 15 Jan 2012 02:27:35 +0000 Subject: [PATCH] - fix inverted alpha for non-alpha textures git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9043 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java | 3 +-- engine/src/tools/jme3tools/optimize/TextureAtlas.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java index cc8bd2834..a0573c2f8 100644 --- a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java +++ b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java @@ -15,12 +15,10 @@ import com.jme3.scene.mesh.IndexBuffer; import com.jme3.texture.Texture; import com.jme3.util.BufferUtils; import com.jme3.util.IntMap.Entry; -import com.jme3.util.TangentBinormalGenerator; import java.nio.Buffer; import java.nio.FloatBuffer; import java.nio.ShortBuffer; import java.util.*; -import java.util.logging.Level; import java.util.logging.Logger; import jme3tools.optimize.TextureAtlas.TextureAtlasTile; @@ -358,6 +356,7 @@ public class GeometryBatchFactory { geom.setMesh(mesh); Material mat = new Material(mgr, "Common/MatDefs/Light/Lighting.j3md"); + mat.getAdditionalRenderState().setAlphaTest(true); Texture diffuseMap = atlas.getAtlasTexture("DiffuseMap"); Texture normalMap = atlas.getAtlasTexture("NormalMap"); Texture specularMap = atlas.getAtlasTexture("SpecularMap"); diff --git a/engine/src/tools/jme3tools/optimize/TextureAtlas.java b/engine/src/tools/jme3tools/optimize/TextureAtlas.java index 880c2ad34..6c3567235 100644 --- a/engine/src/tools/jme3tools/optimize/TextureAtlas.java +++ b/engine/src/tools/jme3tools/optimize/TextureAtlas.java @@ -183,13 +183,13 @@ public class TextureAtlas { image[i + 3] = sourceData.get(j + 3); //r } else if (source.getFormat() == Format.BGR8) { int j = (xPos + yPos * width) * 3; - image[i] = 0; //a + image[i] = 1; //a image[i + 1] = sourceData.get(j); //b image[i + 2] = sourceData.get(j + 1); //g image[i + 3] = sourceData.get(j + 2); //r } else if (source.getFormat() == Format.RGB8) { int j = (xPos + yPos * width) * 3; - image[i] = 0; //a + image[i] = 1; //a image[i + 1] = sourceData.get(j + 2); //b image[i + 2] = sourceData.get(j + 1); //g image[i + 3] = sourceData.get(j); //r