Blending displacement = no bump mapping?

Discussion in 'Mapping Questions & Discussion' started by psihomir, Jun 2, 2008.

  1. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    Ok, so, for my map, I decided to go with blending for the snowy tops on the cliffs, since I can control the snow better that way. The problem is, the blending texture does not preserve the bump-mapping of the rock texture, as you can see in the screenshots in that thread (they're all with BM enabled). Any hints on how to fix that? Or am I going to have to go through the pain of creating an actual rock/snow texture and replacing it everywhere?
     
  2. Arhurt

    Arhurt L6: Sharp Member

    Messages:
    316
    Positive Ratings:
    142
    You need to edit the VMF of the blend and add the Normalmap texture from the rock to the second blend material as well.
     
  3. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    If this works, I'll kiss you. Well, not literally, but, you know...

    Edit: did you mean VMT by the way?

    Edit 2: Ok, in the rock's original VMT, I found this:

    "$bumpmap" "Nature/rockwall003_height-ssbump"
    "$ssbump" "1"

    I reckon I should change something before adding it to the blend texture's VMT, but what? In the blending texture, the rock is the first texture, and the snow is the second one (so the rock is $basetexture and the snow is $basetexture2).
     
    Last edited: Jun 2, 2008
  4. Arhurt

    Arhurt L6: Sharp Member

    Messages:
    316
    Positive Ratings:
    142
    Try this:

    "$bumpmap" "Nature/rockwall003_height-ssbump"
    "$bumpmap2" "Nature/rockwall003_height-ssbump"
     
    • Thanks Thanks x 1
  5. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    But won't that apply bump-mapping to the snow as well? Sorry for posting idiotic questions, but I can't test it for myself right now. I guess I'll try with just $bumpmap at first, $bumpmap2 if that fails, and both if that fails too :) Again, thanks for your help mate, appreciated.
     
  6. Arhurt

    Arhurt L6: Sharp Member

    Messages:
    316
    Positive Ratings:
    142
    Oh, Ithought that you wanted the rocks shape to follow as if a thin coat of snow covered it, yes that will apply the bumpmap to the snow as well.

    Try looking at the valve wiki for $ssbump and see what it is.
     
  7. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    Hm, I just had a look through TF2's stock blending textures, and it appears most of them use bump mapping as well:

    "WorldVertexTransition"
    {
    "$basetexture" "Nature/dirtground001"
    "$basetexture2" "Nature/dirtground002"
    "%tooltexture" "Nature/blendgroundtogravel001_tooltexture"
    "$bumpmap" "Nature/dirtground001_height-ssbump"
    "$bumpmap2" "Nature/dirtground002_height-ssbump"
    "$blendmodulatetexture" "Nature/dirtground002_blendmask"
    "%keywords" "tf"
    "$ssbump" "1"
    "$surfaceprop" "dirt"


    }

    I'll have to give that a go, it seems it should work fine like you said.

    Edit: bleh, it didn't work. Here's what I did:

    "WorldVertexTransition"

    {

    "$basetexture" "nature/rockwall003"
    "$basetexture2" "snowvalley/snowground001"

    "$bumpmap" "Nature/rockwall003_height-ssbump"
    "$ssbump" "1"

    "%tooltexture" "snowvalley/snowground001"

    "%keywords" "blend"
    }

    I'm getting annoyed by this bloody thing... :)

    Edit 2: Examining the texture from the line "$blendmodulatetexture" "Nature/dirtground002_blendmask", I'm starting to think it needs such a mask to blend bumpmapped textures... sigh.

    Edit 3: Aaaaand I finally discovered that blending bump mapped textures requires DX9. Bummer.

    Edit 4: DX9, no dice. This is becoming one hell of an issue. I need to sleep on it.
     
    Last edited: Jun 2, 2008
  8. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    Bump after all the edits and just getting up :)
     
  9. TheDarkerSideofYourShadow

    TheDarkerSideofYourShadow L10: Glamorous Member

    Messages:
    792
    Positive Ratings:
    144
    Heres what I would do. Create a new .vtf file for your texture, copying an existing blend's .vtf and then just changing the names in some things.

    "WorldVertexTransition"
    {
    "$basetexture" "Nature/rockwall003"
    "$basetexture2" "Snowvalley/snowground001"
    "%tooltexture" "Nature/blendgroundtogravel001_tooltexture"
    "$bumpmap" "Nature/rockwall003_height-ssbump"
    "$bumpmap2" "(Whatever your snow bumpmap is, just find a smooth one already in game)"
    "$blendmodulatetexture" "Nature/dirtground002_blendmask" *****Not sure about this line, goes with your rock texture
    "%keywords" "tf"
    "$surfaceprop" "dirt"


    }
     
    • Thanks Thanks x 1
  10. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    I finally got it to work!

    I did some testing and found out that even on most of Valve's own blending textures, bumpmapping doesn't work! So I compared the ones that work to the ones that don't and quickly found the cause of the problem - apparently, the game doesn't like ssbump on blending displacements. All of the working textures used a normal map - that is, "texturename_normal". So, I removed the $ssbump parameter from my blending textures, I replaced the bumpmap with a "normal" one (since the rock I'm using doesn't have one, I just used the one from some other rock), and it worked like a charm! Now all I have to do is create my own normal map for the rock I'm using, but that's a piece of cake now that I've gotten this issue out of my way.

    Thanks to everyone who helped!