Texture is REALLY messed up

Hello JME3 community,

I have got a huge problem i think.
Im doing a assignment where i have to read in multiple files and generate a texture that can be placed on a heart model.
Reading multiple files to generate a png works.
In blender i created that heart model. i also created a UV map by unwrapping seams and export UV layout in blender so that i got a coordination map where some shapes are starting etc.
So now i have colored some shapes via paint and saved it. Now i try to apply the texture(.png) on the heart model but things look really messed up.

this is how it looks before texture being applied:

This is how it looks after applying the texture:

this is the texture:

The texture got the same name as the model.
My classmate has tried this too with webGL with php same model same texture and on his model it works.
the point is that those color maps are placed on the heart on specific locations. but instead it just becomes white with random lollipop color circles

this is the code how im applying the texture:

[java]
Material mat1 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
submesh = (Geometry) rootNode.getChild(“sub031”);
mat1.setTexture(“ColorMap”, assetManager.loadTexture(“Models/hartfinaledefinitiveafgevlakt/hartfinaledefinitiveafgevlakt.png”));
mat1.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
submesh.setQueueBucket(Bucket.Transparent);
submesh.setMaterial(mat1);[/java]

Best wishes,
Raymond

Try to reverse y on texture. Something like
mat1.setTexture(“ColorMap”, assetManager.loadTexture(new TextureKey(“Models/hartfinaledefinitiveafgevlakt/hartfinaledefinitiveafgevlakt.png”,false)));

Thats the most common error with mapping. Given that you have so much white on your texture, it might be reason for the white textured look.

Thanks for the help but it’s still the same issue. The strangest thing is.
Some weeks before it worked perfectly with same code.
But then i smoothed the heart a little and i imported the smoothed heart again with new texture and since then it looks like this.
Could it be a possibility that the heart is to “thin”?

What is it supposed to look like?

It looks like the smoothing process dropped the uv map from the mesh or messed it up in some way.

@abies said: Try to reverse y on texture. Something like mat1.setTexture(“ColorMap”, assetManager.loadTexture(new TextureKey(“Models/hartfinaledefinitiveafgevlakt/hartfinaledefinitiveafgevlakt.png”,false)));

Thats the most common error with mapping. Given that you have so much white on your texture, it might be reason for the white textured look.

To the OP, also note that if you did try the above and nothing changed then it wasn’t applied correctly. It may not fix the problem but the results would definitely look different. If they don’t look different then you didn’t really make the change properly.

It wasn’t clear from your response.

this how it should look like:

its on my classmates webgl with php

same model same colorlocation.

@ pspeed
after i tried it:
mat1.setTexture(“ColorMap”, assetManager.loadTexture(new TextureKey(“Models/hartfinaledefinitiveafgevlakt/hartfinaledefinitiveafgevlakt.png”,false)));

the color circles still exist except that it was a little more colored compared to without that sentence.

Well thanks for the help all. i fixed the issue. I am using OGRE xml instead of the blend to j3o converter built in. Now it works perfectly with Ogre exporter. Maybe there was kind of a bug in Jmonkey converter i dont know.