setTexture

Hello ,

I was trying to modify the tutorial TestCustomMesh and I wanted to add a texture to a Quad node created.

Everything is ok if I run put as a texture the Monkey.png, but for example if I change to a different texture for example x.png it doesn’t work.

The path is ok, the file exists.

This is the error that I receive:



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

com.jme3.asset.AssetNotFoundException: Textures/ColoredTex/background.png (Flipped) (Mipmaped)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:236)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:290)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:309)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:321)

at coco.TestCustomMesh.simpleInitApp(TestCustomMesh.java:63)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:223)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:124)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:200)

at java.lang.Thread.run(Thread.java:619)



Also I am pretty sure it has to do with the .png file.

In the expresion: mat.setTexture(“ColorMap”, assetManager.loadTexture(“Textures/ColoredTex/background.png”)); the first argument I have no idea what it means.

Thanks in advance

ColorMap refers to the shader. This, as the error says, is a “File not found” error.



Double and triple-check the file name. :slight_smile:

Also make sure the path the texture is in is in the Assetlocators

I am 100% sure they the name of the file is ok also the path because if I change like this mat.setTexture(“ColorMap”, assetManager.loadTexture(“Textures/ColoredTex/Monkey.png”) it works. Both of them are in the same folder so have no ideea what it’s wrong.

Thanks for replys guys

Did you put the picture in the following path :

…/My Documents/jMonkeyProjects/JmeProject/assets/Textures/ColoredTex/background.png

1 Like

I found out what was wrong. It was the path…of course Thanks to all for the answers