Texture A looping texture

Discussion in 'Request Area' started by DrSquishy, Aug 22, 2017.

  1. DrSquishy

    DrSquishy L10: Glamorous Member

    Messages:
    746
    Positive Ratings:
    256
    I need some looping water textures for some pipes: the texture is water/waterfall. This is what it currently looks like: loopingtexture.jpg
     
  2. Tuaam

    Tuaam L6: Sharp Member

    Messages:
    332
    Positive Ratings:
    194
    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
    }
    }
    }
     
  3. iiboharz

    aa iiboharz Meme Queen

    Messages:
    724
    Positive Ratings:
    1,054
    Doesn't this already exist like, isn't that actually a texture that exists already?
     
  4. BigfootBeto

    aa BigfootBeto Too obsessed with perfection

    Messages:
    404
    Positive Ratings:
    599
    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.
     
  5. TyeZenneth

    TyeZenneth L6: Sharp Member

    Messages:
    340
    Positive Ratings:
    293
    Isn't that more of an issue of having the right texture scaling than anything else?
     
  6. BigfootBeto

    aa BigfootBeto Too obsessed with perfection

    Messages:
    404
    Positive Ratings:
    599
    Only if the texture is designed to loop seamlessly.
     
  7. Yabayabayaba

    Yabayabayaba L5: Dapper Member

    Messages:
    247
    Positive Ratings:
    73
    cut the texture in half, and mirror one side

    idk how to or else I would do it for you
     
    • Thanks Thanks x 1
  8. DrSquishy

    DrSquishy L10: Glamorous Member

    Messages:
    746
    Positive Ratings:
    256
    nope. Tried that and it is now more broken than before. Mirroring made the seams appear on both sides
     
  9. DrSquishy

    DrSquishy L10: Glamorous Member

    Messages:
    746
    Positive Ratings:
    256
    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
     
  10. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    341
    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.
     
  11. DrSquishy

    DrSquishy L10: Glamorous Member

    Messages:
    746
    Positive Ratings:
    256
    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
     
  12. Jusa

    aa Jusa

    Messages:
    339
    Positive Ratings:
    537
    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
     
    • Agree Agree x 2
    • Thanks Thanks x 1
  13. Blade x64

    aa Blade x64 Logical insanity

    Messages:
    217
    Positive Ratings:
    518
    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.

    [​IMG]
    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    Pay attention in algebra, kids.
     
    • Thanks Thanks x 4
    • Like Like x 3
  14. DrSquishy

    DrSquishy L10: Glamorous Member

    Messages:
    746
    Positive Ratings:
    256
    my head hurts
     
    • Agree Agree x 1
    • Funny Funny x 1
  15. iiboharz

    aa iiboharz Meme Queen

    Messages:
    724
    Positive Ratings:
    1,054
    This is why mathematics is important, kids.
     
    • Agree Agree x 2
  16. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,377
    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.
     
  17. Tuaam

    Tuaam L6: Sharp Member

    Messages:
    332
    Positive Ratings:
    194
    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