Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualTiagoCosta

Posted 14 November 2012 - 04:41 AM

It depends on the texture coordinates of the terrain vertices. Wrapping mode will repeat the texture every integer junction. So if the texture coordinates of the vertices only go from 0.0f to 1.0f (or they are continuous along the terrain) it wont tile the texture.

So you're left with two options:
-You can manually change the texture coordinates of your terrain vertices which will give you the best results and most freedom;
-In the vertex shader before outputting the texture coordinates multiply them by the number of tiles you want, so if you multiply by 2 in both axis, if you had a plane with texture coordinates from 0.0 to 1.0 you would end up with 4 tiles of the texture.

I'm guessing you terrain is a big plane made of rows/columns of triangles, if so you're probably setting the texture coordinates of one of the corners (0.0f, 0.0f) and the opposite corner (1.0f, 1.0f) and interpolating the coordinates of the other vertices, if so you just have to change the coordinates of the last corner to (2.0f, 2.0f) and you will end of with 4 tiles.

#4TiagoCosta

Posted 14 November 2012 - 04:41 AM

It depends on the texture coordinates of the terrain vertices. Wrapping mode will repeat the texture every integer junction. So if the texture coordinates of the vertices only go from 0.0f to 1.0f (or they are continuous along the terrain) it wont tile the texture.

So you're left with two options:
-You can manually change the texture coordinates of your terrain vertices which will give you the best results and most freedom;
-In the vertex shader before outputting the texture coordinates multiply them by the number of tiles you want, so if you multiply by 2 in both axis, if you had a plane with texture coordinates from 0.0 to 1.0 you would end up with 4 tiles of the texture.

I'm guessing you terrain is a big plane made of rows/columns of triangles, if so you're probably setting the texture coordinates of one of the corners (0.0f, 0.0f) and the opposite corner (1.0f, 1.0f) and interpolating the coordinates of the other vertices, if so you just have to change the coordinates of the last corner to (2.0f, 2.0f) and you will end of with 4 tiles.

#3TiagoCosta

Posted 14 November 2012 - 04:38 AM

It depends on the texture coordinates of the terrain vertices. Wrapping mode will repeat the texture every integer junction. So if the texture coordinates of the vertices only go from 0.0f to 1.0f (or they are continuous along the terrain) it wont tile the texture.

So you're left with two options:
-You can manually change the texture coordinates of your terrain vertices which will give you the best results and most freedom;
-In the vertex shader before outputting the texture coordinates multiply them by the number of tiles you want, so if you multiply by 2 in both axis, if you had a plane with texture coordinates from 0.0 to 1.0 you would end up with 4 tiles of the texture.

#2TiagoCosta

Posted 14 November 2012 - 04:38 AM

It depends on the texture coordinates of the terrain vertices. Wrapping mode will repeat the texture every integer junction. So if the texture coordinates of the vertices only go from 0.0f to 1.0f (or they are continuous along the terrain) it wont tile the texture.

So you're left with two options:
-You can manually change the texture coordinates of your terrain vertices which will give you the best results and most freedom;
-In the vertex shader before outputting the texture coordinates multiply them by the number of tiles you want, so if you multiply by 2 in both axis, if you had a plane with texture coordinates from 0.0 to 1.0 you would end up with 4 tiles of the texture.

#1TiagoCosta

Posted 14 November 2012 - 04:36 AM

It depends on the texture coordinates of the terrain vertices. Wrapping mode will repeat the texture every integer junction. So if the texture coordinates of the vertices only go from 0.0f to 1.0f it wont tile the texture.

So you're left with two options:
-You can manually change the texture coordinates of your terrain vertices which will give you the best results and most freedom;
-In the vertex shader before outputting the texture coordinates multiply them by the number of tiles you want, so if you multiply by 2 in both axis, if you had a plane with texture coordinates from 0.0 to 1.0 you would end up with 4 tiles of the texture.

PARTNERS