Texture A looping texture

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
I need some looping water textures for some pipes: the texture is water/waterfall. This is what it currently looks like:
loopingtexture.jpg
 

Tuaam

L6: Sharp Member
Jun 26, 2015
376
248
Use Material Proxies

Here's a code snippet of a .vmt file that has code to make a rock texture scroll (as in, give the illusion of moving) that I made years ago. Examine the code below "Proxies". Exact same code / theories are used for ctf_convoy

"WorldVertexTransition"
{
"$basetexture" "coalmines/rockwall012"
"$basetexture2" "coalmines/dirtground004"
"%tooltexture" "Nature/blendgroundtograss003_tooltexture"
// "%detailtype" "tf_grass"
"%keywords" "tf"
"$surfaceprop" "dirt"
"$bumpmap" "Nature/rockwall009_height-ssbump"
"$ssbump" "1"
"Proxies"
{
"TextureScroll"
{
"texturescrollvar" "$basetexturetransform"
"texturescrollrate" -7
"texturescrollangle" -180
}
}
}
 

iiboharz

eternally tired
aa
Nov 5, 2014
857
1,291
Doesn't this already exist like, isn't that actually a texture that exists already?
 

BigfootBeto

Party Time 2.0!
aa
Jun 8, 2016
496
847
I think they just want the texture to be seamless instead of having an obvious split where it loops to the other side. The scrolling isn't the issue.
 

TyeZenneth

L6: Sharp Member
May 31, 2014
340
293
I think they just want the texture to be seamless instead of having an obvious split where it loops to the other side. The scrolling isn't the issue.
Isn't that more of an issue of having the right texture scaling than anything else?
 

BigfootBeto

Party Time 2.0!
aa
Jun 8, 2016
496
847
Isn't that more of an issue of having the right texture scaling than anything else?
Only if the texture is designed to loop seamlessly.
 

Yabayabayaba

L5: Dapper Member
Jun 2, 2016
243
77
cut the texture in half, and mirror one side

idk how to or else I would do it for you
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
cut the texture in half, and mirror one side

idk how to or else I would do it for you
nope. Tried that and it is now more broken than before. Mirroring made the seams appear on both sides
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
I could potentially do a sort of brace on the pipe sides, but I want it to be a completely clear view all around. I'll fall back on this idea if I can't get anything to work
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
Do you have photoshop? What you do is mirroring both sides of the texture around. Then fixing the seam that will be in the middle. The mirroring can be done with the offset tool https://medialoot.com/blog/how-to-make-a-seamless-texture-in-photoshop-redux/

Google how to do it with gimp if you dont have photoshop. Looping textures is really simple and this thread should be in hte mapping discussion forum as you can do it yourself.
I used paint.net. The texture is fine and mirrored in paint.net AND VTFEdit, but as soon as it is in hammer, the seams show up very visibly and it looks even worse ingame
 

Jusa

aa
May 28, 2013
377
618
The thing is, if you are going to texture a cylindrical brush there always tends to be a seam. The texture scale would have to be exactly the size of all the sides of the cylinder combined for it to loop perfectly around the cylinder. Not sure if thats the problem here but thats what it seems to be.

Even with a perfectly seamless texture like this rubble here, theres still a seam.

upload_2017-8-23_13-31-8.png
 

Blade x64

Logical insanity
aa
Sep 3, 2009
239
633
This is a problem that can be solved through the power of math.

Let's assume you're using a displacement cylinder cause those are easier to work with. You can make em by subdividing a group of three like this.

M1NH7Kz.png

0QEQOMx.png


Now each of the four faces is 80u. That makes the entire length around it 320u. This texture fits comfortably on a 128u surface, so let's scale up 256u to fit 320u.

320 / 256 * 0.25=0.3125

Plug it into the X scale (cause that's horizontal), wrap it around using alt+right click on the face edit sheet, and viola! The texture is seamless.

BuaJLwB.png


Bonus: if the size of the brush is something like 192x192 or 128x128, you won't need to do any scaling.

Or if you're dedicated to using an actual cylinder (this one is 64x64), you have a few more steps.

8Z5WAwH.png


To find the length of any side, you have to find the length of all angled surfaces. You can use the Pythagorean theorem for that. For example, sqrt(4^2 + 16^2) = 16.4924225025. The total ends up as 199.821631014. Scale that: 199.821631014 / 256 * 0.25 = 0.19513831153. Align your starting face to face then wrap it around.

cEXIQFb.png


Pay attention in algebra, kids.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Or you can just use the Fit button on the texture application window. Stretches the texture to exactly snap to the corners of whatever faces you have selected. The drawback is that it doesn't work if you select an entire cylinder or anything else that wraps all the way around, so things get complicated when the texture you want to use is too big to fit over just half of it (or a third, or whatever). I might have to make a tutorial about this because it's useful information.
 

Tuaam

L6: Sharp Member
Jun 26, 2015
376
248
Or you can just use the Fit button on the texture application window. Stretches the texture to exactly snap to the corners of whatever faces you have selected. The drawback is that it doesn't work if you select an entire cylinder or anything else that wraps all the way around, so things get complicated when the texture you want to use is too big to fit over just half of it (or a third, or whatever). I might have to make a tutorial about this because it's useful information.

You could also fiddle with the world and face check boxes to get the desired size, which sometimes works for aligning textures correctly on sloped sides.

Interestingly enough, the alt + right click trick doesn't work that well on slanted cylinders