Thread: Skewing textures in Hammer

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    13

    Standard Crate Skewing textures in Hammer

    If you’ve ever been in a situation like for example having to skew a wall in a particular direction so that it follows an elevation in the floor, you’d probably have to rotate the wall texture and end up with something like this:



    This can be okay for some occasions, but doesn't really look that good. What do you do if you want the wall texture to run parallel (either vertically or horizontally) with the wall textures next to the skewed brush? You might think it's impossible, which it practically has been, but I’ve discovered a rather simple trick to achieve this using a couple of tools found in Hammer that I suspect are mostly overlooked: Align To View and the Camera tool.

    What you need to do is select the Camera tool (Shift+C) and in the 2D Top viewport (in this particular example, if the brush is oriented differently, e.g. with the face you want to manipulate facing upwards, you might have to use another viewport) and place the camera itself along one edge of the brush and as many units away as the brush is long (which in this case is 256 units) and have the camera point 45 degrees towards the opposite edge (check the Top view in the screenshot if you don’t understand what I mean). It is a good idea to downsize the grid to 1 and zoom in and check that the camera is aligned correctly, as it snaps to grid 1. Then, in the 2D Side viewport (again, in this particular example), you will have to place the part of the camera tool that “points” (the red line) at the middle point of one edge of the brush, and the camera itself between the middle point and the lower point of the opposite edge (i.e. a quarter of the total length). The easiest way to find these points is to enter vertex manipulation (Shift+V) with the brush selected, then while in vertex manipulation you select the Camera tool again. Confirm that the camera is placed exactly correct by downsizing the grid to size 1 and zooming in.



    The next step is to go into the 3D viewport (careful not to move the camera around), enter Texture Manipulation (Shift+A), select “Align To View” from the lowermost drop-down list, and then click on the face you wish to skew. You should get something like this, with the texture being upside down:



    This is easily fixed by flipping the texture 180 degrees and hitting “Fit”.



    You can also (if you look very carefully) notice that the skewed texture is actually flipped the wrong way horizontally - this can be a problem in certain cases, like if you use a texture similar to the one I’ve used in the following screenshot:



    This can actually look quite cool, but if the effect is undesirable and you want to avoid having to flip all the adjacent walls horizontally so that they match the texture of the skewed wall, you will have to, before going through the technique I’ve now described, flip the skewed wall horizontally, then just do everything from the opposite direction:



    Then you should end up with a correct perspective (obviously you need to flip it back once you're done).



    And that’s it! Now, don’t ask me why you have to have the camera tool pointing in a steeper angle than the brush is skewed to get a correct angle on the texture, as common sense might suggest that the camera should point at the same exact angle, but this technique does require a bit of trial and error; it’s not always obvious where or at what angle you will have to place the camera and the red line “pointer” (if you have a steeper angle on the skewed brush, for instance, you will also have to have a much steeper angle on the camera than in the example in this tutorial), but with persistence you can achieve greatness the likes of which has been previously unknown to mankind (or something along those lines), like the handrails on this spiral staircase I created:



    Thanks for reading, hopefully someone will find this useful.

  2. #2
    I'm in your Sven Co-op, coding stuff Protector's Avatar  
    Programmer
    Join Date
    Sep 2003
    Location
    Basel, Switzerland
    Posts
    679

    Re: Skewing textures in Hammer

    You Sir, are a genius.

  3. #3
    Administrator JPolito's Avatar  
    Manager
    Join Date
    Apr 2004
    Posts
    7,555

    Re: Skewing textures in Hammer

    This is pretty damn useful.

  4. #4
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,082

    Re: Skewing textures in Hammer

    The simplest things need the most insane workarounds in Hammer. Great tutorial!

  5. #5
    :D cold_blood3d_killa's Avatar  
    Contributor
    Join Date
    Jun 2004
    Location
    United States
    Posts
    482

    Re: Skewing textures in Hammer

    Great discovery and thanks for the detailed guide. It always bugged me how certain textures, such as walls with stains that had dripped down due to gravity, or other structural features within the texture didn't make sense when rotated.

  6. #6
    Craazy! the-middleman's Avatar  
    Artist
    Join Date
    Sep 2012
    Location
    Entity-Guide
    Posts
    514

    Re: Skewing textures in Hammer

    That is pretty amazing! I knew of this "align to view" tool but I allways found it very useless.
    ZN progress:

  7. #7
    Registered User
    Join Date
    Mar 2012
    Posts
    13

    Re: Skewing textures in Hammer

    Quote Originally Posted by the-middleman View Post
    That is pretty amazing! I knew of this "align to view" tool but I allways found it very useless.

    Yes I thought so as well, but as you can see it can actually be quite powerful. I also found a way to create neat curved pipes (not by myself but thanks to another tutorial), and to texture them properly you pretty much have to use align to view and the camera tool. I'll probably make a tutorial on this as well someday soon.

  8. #8
    trigger_delay & func_lazy TrEmPlEr's Avatar  
    Artist
    Join Date
    Jul 2002
    Location
    Valve Hammer Editor 3.5 beta
    Posts
    2,283

    Re: Skewing textures in Hammer

    Really stunning work Kaffikopp yeah i´m up for seeing more of this tutorials !
    ITs damn Candy.

    here
    Modstatus: Unknown

  9. #9
    Donated 15NS$ for Sven's Holiday at the Bahamas Puchi's Avatar  
    Artist
    Join Date
    Nov 2002
    Location
    Akihabara, Bochum or Sailune
    Posts
    5,618

    Re: Skewing textures in Hammer

    awesome.
    Do it with passion, or not at all.
    Do not say everything you know. Know everything you say.
    [ MarySP ][ nacl-h2o ][ The next SC Version ♥♥♥♥ing pwns! ][Puchis Maps ]

  10. #10
    Registered User
    Join Date
    Nov 2004
    Location
    Europe
    Posts
    2,827

    Re: Skewing textures in Hammer

    Nice find. Works excellent!

  11. #11
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Re: Skewing textures in Hammer

    I'm happy to hear that this is possible, but I'm sad to think of all the textures I need to fix now.
    Love,
    w00tguy

  12. #12
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,054

    Re: Skewing textures in Hammer

    That's a nice trick you've discovered there!

    There should be guide to all super secret Hammer features and tricks..

  13. #13
    Advanced Leveldesigner SourceSkyBoxer's Avatar
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    803

    Re: Skewing textures in Hammer

    Awesome tutorial - I knew some like Strg + Alt + Mouse Click right. Thanks for handsome tutorial
    Hello guys, Svencoop. I am sorry Please respect me! I am deaf. Thanks, Sven-Coop Forum!

    Please do not share to shit dropbox! Please share only Mega.nz!
    Muhahaha, Facebook crashed!

  14. #14
    snarks snarks snarks snarks snarks snarks snarks snarks Green Astronauts's Avatar
    Join Date
    Mar 2013
    Location
    Nijmegen, the Netherlands
    Posts
    210

    Re: Skewing textures in Hammer

    Excuse my threadbump but I'd like to add something to this tutorial that I haven't seen mentioned elsewhere.
    Quote Originally Posted by Kaffikopp
    it’s not always obvious where or at what angle you will have to place the camera and the red line “pointer”
    The slope the 'camera line' makes in the side view must be exactly double the slope of the brush. If you look very closely at (the side view of) this pic, you can see that the slope of the brush is 1/4 and the slope of the camera line is 1/2, which is double of 1/4.

    Amazing tutorial. I could barely believe it until I tried it and when I figured out the slope thing it just got even better. No more trial-and-error for me

    Edit: Also see this crappy explanation pic I whipped up (click to enlarge)


    Edit 2: The flawless result with a differently sloped brush: click
    Last edited by Green Astronauts; 08-02-2015 at 09:23 AM.

  15. #15
    Registered User
    Join Date
    Mar 2012
    Posts
    13

    Re: Skewing textures in Hammer

    Yeah I figured that out eventually too, but probably forgot (or couldn't be bothered) to update the tutorial.
    Glad to see people are still finding it useful, even though I guess the technique might be a bit redundant now that Jackhammer has an integrated UV texture lock feature that gives the same result. Still, some people that prefer to use standard Hammer (like myself) could make use of this technique instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •