New Texture state method
This commit is contained in:
parent
3c49eda28f
commit
7a4d7242c5
1 changed files with 22 additions and 0 deletions
|
|
@ -7,13 +7,17 @@ import java.io.IOException;
|
|||
import java.net.URISyntaxException;
|
||||
|
||||
import com.jme.bounding.BoundingBox;
|
||||
import com.jme.image.Image;
|
||||
import com.jme.image.Texture;
|
||||
import com.jme.scene.Node;
|
||||
import com.jme.scene.Spatial;
|
||||
import com.jme.scene.state.TextureState;
|
||||
import com.jme.system.DisplaySystem;
|
||||
import com.jme.util.TextureManager;
|
||||
import com.jme.util.export.binary.BinaryImporter;
|
||||
import com.jme.util.resource.ResourceLocatorTool;
|
||||
import com.jme.util.resource.SimpleResourceLocator;
|
||||
import com.jmex.effects.LensFlare;
|
||||
import com.jmex.model.converters.AseToJme;
|
||||
import com.jmex.model.converters.MaxToJme;
|
||||
import com.jmex.model.converters.Md2ToJme;
|
||||
|
|
@ -93,8 +97,26 @@ public class SGUtil {
|
|||
FileFinder.findURL(url),
|
||||
Texture.MinificationFilter.BilinearNearestMipMap,
|
||||
Texture.MagnificationFilter.Bilinear);
|
||||
/*
|
||||
return TextureManager.loadTexture(
|
||||
FileFinder.findURL(url),
|
||||
Texture.MinificationFilter.Trilinear, Texture.MagnificationFilter.Bilinear, Image.Format.RGBA8,
|
||||
0.0f, true);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JME TextureState whit the given texture
|
||||
*
|
||||
* @param url is the path to the texture
|
||||
* @return an TextureState
|
||||
*/
|
||||
public static TextureState getTextureState(String url){
|
||||
TextureState tstate = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
|
||||
tstate.setTexture(loadTexture(url));
|
||||
tstate.setEnabled(true);
|
||||
return tstate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to apply a ZBufferState to a node.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue