- fix inverted alpha for non-alpha textures

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9043 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent d5c766cc8b
commit f04654ee20
  1. 3
      engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java
  2. 4
      engine/src/tools/jme3tools/optimize/TextureAtlas.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");

@ -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

Loading…
Cancel
Save