- fix inverted alpha for non-alpha textures
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9043 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
d5c766cc8b
commit
f04654ee20
engine/src/tools/jme3tools/optimize
@ -15,12 +15,10 @@ import com.jme3.scene.mesh.IndexBuffer;
|
|||||||
import com.jme3.texture.Texture;
|
import com.jme3.texture.Texture;
|
||||||
import com.jme3.util.BufferUtils;
|
import com.jme3.util.BufferUtils;
|
||||||
import com.jme3.util.IntMap.Entry;
|
import com.jme3.util.IntMap.Entry;
|
||||||
import com.jme3.util.TangentBinormalGenerator;
|
|
||||||
import java.nio.Buffer;
|
import java.nio.Buffer;
|
||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
import java.nio.ShortBuffer;
|
import java.nio.ShortBuffer;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import jme3tools.optimize.TextureAtlas.TextureAtlasTile;
|
import jme3tools.optimize.TextureAtlas.TextureAtlasTile;
|
||||||
|
|
||||||
@ -358,6 +356,7 @@ public class GeometryBatchFactory {
|
|||||||
geom.setMesh(mesh);
|
geom.setMesh(mesh);
|
||||||
|
|
||||||
Material mat = new Material(mgr, "Common/MatDefs/Light/Lighting.j3md");
|
Material mat = new Material(mgr, "Common/MatDefs/Light/Lighting.j3md");
|
||||||
|
mat.getAdditionalRenderState().setAlphaTest(true);
|
||||||
Texture diffuseMap = atlas.getAtlasTexture("DiffuseMap");
|
Texture diffuseMap = atlas.getAtlasTexture("DiffuseMap");
|
||||||
Texture normalMap = atlas.getAtlasTexture("NormalMap");
|
Texture normalMap = atlas.getAtlasTexture("NormalMap");
|
||||||
Texture specularMap = atlas.getAtlasTexture("SpecularMap");
|
Texture specularMap = atlas.getAtlasTexture("SpecularMap");
|
||||||
|
@ -183,13 +183,13 @@ public class TextureAtlas {
|
|||||||
image[i + 3] = sourceData.get(j + 3); //r
|
image[i + 3] = sourceData.get(j + 3); //r
|
||||||
} else if (source.getFormat() == Format.BGR8) {
|
} else if (source.getFormat() == Format.BGR8) {
|
||||||
int j = (xPos + yPos * width) * 3;
|
int j = (xPos + yPos * width) * 3;
|
||||||
image[i] = 0; //a
|
image[i] = 1; //a
|
||||||
image[i + 1] = sourceData.get(j); //b
|
image[i + 1] = sourceData.get(j); //b
|
||||||
image[i + 2] = sourceData.get(j + 1); //g
|
image[i + 2] = sourceData.get(j + 1); //g
|
||||||
image[i + 3] = sourceData.get(j + 2); //r
|
image[i + 3] = sourceData.get(j + 2); //r
|
||||||
} else if (source.getFormat() == Format.RGB8) {
|
} else if (source.getFormat() == Format.RGB8) {
|
||||||
int j = (xPos + yPos * width) * 3;
|
int j = (xPos + yPos * width) * 3;
|
||||||
image[i] = 0; //a
|
image[i] = 1; //a
|
||||||
image[i + 1] = sourceData.get(j + 2); //b
|
image[i + 1] = sourceData.get(j + 2); //b
|
||||||
image[i + 2] = sourceData.get(j + 1); //g
|
image[i + 2] = sourceData.get(j + 1); //g
|
||||||
image[i + 3] = sourceData.get(j); //r
|
image[i + 3] = sourceData.get(j); //r
|
||||||
|
Loading…
x
Reference in New Issue
Block a user