Using a texture state with multiple UV surfaces

Hello everyone. first post :slight_smile:



I have recently come across jME and love it so far! amazing work.



I do however have a question about models and UV surfaces. I have been exporting out .obj tri objects from blender as a base for testing model loading and texture tilling within jME. I have been able to load in .obj files with a single UV map and apply tilling textures without any problems, my question is. What steps would I need to look into for working with multiple UV surface names? And then applying custom materials to them inside jME?



Thanks for any insight.

Hola,



have a look in the jmetest-package. (or in the online-svn-repo:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/renderer/TestMultitexturePass.java

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/renderer/TestMultitexture.java )



Actually the texCoords are copied in this example. For the second texture. If you want to have two different uv-maps have a look deeper into that.



Where  comes the model from? You can export multi uv with HottBJExporter for Blender.





Actually the jmetest-package is in my oppinion the best way to start with jME. Most of the capabilities can be found (somewhere) in that package :smiley:

Thanks for the reference links ttrocha, i'll check them out.



Let me see if I can clear up a little on what i'm requesting.



Say I have a basic mesh loaded in blender, in edit mode I select a strip of faces assign them to a UV surface. And name it UVsurface1.



I then select another group of different faces, and assign them a name  UVsurface2.



The model is being imported into jME with the .mtl file as well.



What i'm not sure how to do, is assign a texture state or texture to a UV surface by name, or if this is possible in jME.



Hope this make a little more sense.

Hmm,…actually I'm not a texcoord-expert as I'm using uv-mapping in the modeller. I'm not sure how the texture-renderer behaves if you only add for certain verteces texcoords…no clue.



for explanation. every model/mesh might have only one texturestate. but this texturestate can have multiple textures. your model have something like uv-layers. (0,1,…n)  when you add your texture to the texturestate you can specify that layer.



(Have a look here again: http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/renderer/TestMultitexture.java )



There is a 2nd way to achieve multiple textures: Mutlipass. While Multitexture (the example before) rendered all of this at once you can think of drawing the model multiple times(passes) and add everytime the new texture. In this case every pass has a texturestate (that might be a multitexture-texture state as well) of its own. For that have a look here:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/renderer/TestMultitexturePass.java



But this are quite advanced techniques you want to use there. Give it a try with the samples.

Thanks again ttrocha for the explanations and links.



I'm more of a modeling person then a programmer, I would think of the multitexture examples as more of a way to layer textures on a surface rather then assigning different textures to different UV maps.



I'm just trying to work out a way to repeat textures in jME when possible rather then have large UV image maps pre made in a 3d application, especially in instances where the object surfaces are quite large. ie: the outside of a building. And without having to break the walls of the object into separate objects and rebuilding the model once imported into jME.

I'm just trying to work out a way to repeat textures in jME


t1.setWrap(Texture.WrapMode.Repeat);
t1.setScale(new Vector3f(....));



Where t1 is a texture. Also have a look at jmetest.terrain.TestTerrainSplatting


Good luck and have a nice weekend,
ToM

I understand the texture repeat, this is an example of what I have:



But for the building I would like to be able to assign multiple UV surfaces and also apply repeat textures to the different walls via a UV surface name, and eliminate texture scaling across different planes. Or maybe I should look into doing this in Blender then export the model. I have just been trying to balance image size vs. performance.



Hope you have a nice weekend to.