Questions about textures and texture coordinates

Hi,



I have a question about textures and texture coordinates.



How many textures can be applied to a material?

Can I add more than one (for example DiffuseMap) to a lighting material?



I can see that there are 8 different TexCoords as a buffer type.

Does it mean that I can set 8 different texture coordinated to a single mesh?

And if I can apply one texture to a material, why would I need 8 buffers holding UV coords ?



Would it be possible to create material definition dedicated for blender importer??

One that could take more than one texture.

And could mix 2D and 3D textures??

Kaelthas said:
How many textures can be applied to a material?
Can I add more than one (for example DiffuseMap) to a lighting material?

you have a hardware limit. on recent hardware it's 16 texture uniforms.
DiffuseMap is one uniform for the lighting shader, so it's one texture.

but diffuseMap, NormalMap, ParallaxMap, SpecularMaps are different textures.

Kaelthas said:
I can see that there are 8 different TexCoords as a buffer type.
Does it mean that I can set 8 different texture coordinated to a single mesh?
And if I can apply one texture to a material, why would I need 8 buffers holding UV coords ?

sometime it's useful to not have the same set of uv for 2 textures. For example the glow map in the lighting or unshaded material could use different texCoord so you could have a glow map at very lower resolution without loosing details. This is still in my todos... :p


Kaelthas said:
Would it be possible to create material definition dedicated for blender importer??
One that could take more than one texture.
And could mix 2D and 3D textures??

I don't think it's a good idea, in the end it would be incredibly bloated i guess.

Mulitple Texcoords,

→ for example a wall with repeating texture and a light/shadowmap calculated in 3dModelprogramm that should of course not repeat.

OK, so can someone give me an example how to use it ? :slight_smile:

How does jme know which coordinates are used by which texture ?

JME doesn’t know. The shader knows. Look at Unshaded.j3md and associated shaders. A single texture is just a uniform like anything else and a single texture coordinate is just another vertex attribute like any other.

jME3 shaders are very specialized in what they do so I don’t think you can customize it much.

Unshaded and Lighting will allow you to specify an additional diffuse map (called LightMap) and you can make it use the TexCoord2 attribute instead of TexCoord by specifying the boolean SeparateTexCoord = true. This is designed to support lightmaps that use a different set of texture coordinates than the ones used for the other maps, so you can have repeating wall textures and such while still having proper lightmaps.