I am currently using Blender to create a simple model for which I apply a texture (it is a single image representing a metal floor). Still under Blender, I play with the “Image Mapping->Repeat” parameters to have my texture repeated several times over both X and Y directions.
This appears fine in Blender when I render it.
Then, I export to Urho3D using the Urho3D exporter which also works fine. I get no errors and the texture is exported along with the material.
Here is the content of my material XML file that references the texture to be used.
It clearly appears that there are no “tiling” or “repeating” information coming from Blender. When I run my Urho3D app that displays the model, the texture is not repeated.
In such a case, I assume that it is useless to try to configure texture repetition in Blender since it is not exported. Is my assumption correct ?
In any cases, how can I proceed to be able to get a texture repetition in my XML file ? Or do I have to do thing in another way ?
Thanks for your answers.
For the moment, I overscaled my UVs in Blender and kept repetition parameters to 1 (as Mike suggested). However, I will also give a try to the solution given by Alex-Doc.
Thank you again for your help !
If you are talking about having a model automatically repeat a texture as it is scaled during runtime, I don’t know if there is currently a way to do this in engine. With that said, if the scalings are predetermined before runtime, you could adjust the UV mappings in Blender. Otherwise, a runtime effect for tiling could be done without too much trouble in shaders. Hope this helps.
So maybe like the UV coords will be scaled by 1f/model.scale ? I don’t even need to dynamically change - I just want to set up a road plane and then repeat the road texture instead of stretching it no matter how “long” the road section is.
I don’t actually know how to write such a shader - but when I do, that’s where I’ll start. I’m currently going through the edx class on shader(s). It’ll take a while…