Scripting - Tiling textures

Fabio Guedes
Non-Commercial Std Edition
Joined 20 April 2009
20 February 2010 22:58:38
It's me again.

Sorry if this has been asked before, I've seen some posts about tiling but they're from 2007 so I decided to open a new one.

I'm building a quick beta-prototype of my game just so people can test out the features and game mechanics, but I'm having problems creating a small room. I created a box mesh (wall) and then applied some texture, thing is, the textures is supposed to be tiling so it won't get all stretched but it is not doing this. Is there anyway to do this?

Thanks in advance.
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
20 February 2010 23:09:33
AFAIK you can't change that in DX Studio but in your 3D-Editor by editing the UV-Map.
Fabio Guedes
Non-Commercial Std Edition
Joined 20 April 2009
20 February 2010 23:23:34
Damn :\ I know next-to-nothing about 3D modeling (a friend of mine is going to teach me the basics in the next few weeks so i can start modeling) so I'm stuck lol. Thanks anyway!
Cardek
Commercial Pro Edition
Joined 01 June 2008
20 February 2010 23:42:19
It depends on what you want to achieve, but, for example, to have 4 tiles in the texture, you can use (it works better if your texture is seamless):
object.subgroups.yourSubgroup.textureScale.x*=4;
object.subgroups.yourSubgroup.textureScale.y*=4;
textureTiling.dxstudio
Fabio Guedes
Non-Commercial Std Edition
Joined 20 April 2009
21 February 2010 00:33:47
@Cardek Thank you! That is exactly what I needed!
Cardek
Commercial Pro Edition
Joined 01 June 2008
21 February 2010 00:54:12
You're welcome. Thanks for the star!
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
21 February 2010 18:50:33
I found another solution :

1. Expand the Mesh in the mesh-tab by clicking on the +
2. Rightclick on the "root"
3. Select "Tools"->"Generate Texture Coordinates"
4. Insert the texture channel (by default 0)
5. Insert the number of tiles you wish
6. Hit OK
7. *tadaa*




Fabio Guedes
Non-Commercial Std Edition
Joined 20 April 2009
22 February 2010 03:28:49
Thank you too JimmDaBimm! This actualy makes it easier as you can see the final texture on the editor without having to run the scene.

Thanks to both!
Cardek
Commercial Pro Edition
Joined 01 June 2008
22 February 2010 10:19:30
Hey JimmDaBimm, if I recall correctly, you're a C4D user. Do you reach to make your method to work with meshes created with C4D?
All my attempts failed miserably. I change the values, but nothing happens, and if retry to change the values again, they're reset at the original "1" value.
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
22 February 2010 12:09:34
The Values are always set to 1 when reopening the window but yeah, my brother (who makes all the 3d Stuff) also doesn't get it to work. I tryed it today (exported with the X-Port Plugin) but the result looks quite ugly when trying to tile the texture:

Before:


After:


Seems to be a problem with the UV map? Don't know...
Cardek
Commercial Pro Edition
Joined 01 June 2008
22 February 2010 12:24:27
Don't know either. Thanks anyway. At least, I feel less alone.
David Shute
Non-Commercial Pro Edition
Joined 16 October 2008
22 February 2010 12:33:16
The 'generate texture coords' option generates a UV map according to the x and z coordinates of each vertex - It doesn't take the y into account at all. It's intended to be used on terrains, so only really works for large flat objects.

Think of it like it's 'projecting' the texture from the sky, downwards on to the mesh.
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
22 February 2010 12:36:35
Thanks David, sounds plausible.
matt smith2
Commercial Pro Edition
Joined 03 December 2008
25 February 2010 09:28:24
I don't know which modelling package you use but I use 3DS Max and it does export tiled textures but you have to remember that the material needs to be tiled through a uvw map. It wont export properly if you tile the texture directly in the material (not like you'd really want to anyway).

If you'd like to post to this forum, just create an account on the website, or login with your existing details.

When posting to a forum, you can use limited HTML tags:- 'a' for links, 'b' for bold, 'i' for italic and 'script' to encase a block of DX Studio script.  All tags must be properly closed. e.g. <script>var i=1;</script>

Note: If there are any offensive comments in this topic, please let us know straight away at . Always follow the forum rules.