Thread: How to use detailtextures in a professional manner

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    trigger_delay & func_lazy TrEmPlEr's Avatar  
    Artist
    Join Date
    Jul 2002
    Location
    Valve Hammer Editor 3.5 beta
    Posts
    2,279

    How to use detailtextures in a professional manner

    Hello everyone and welcome to my first tutorial.

    Let me start with the basics:

    If you don't know what a detail texture is, I shall explain.
    Basically you have a normal texture on a brush, like a wall texture or ground tiles. A detail texture is an additional layer for a defined texture.

    You could add dirt and small stones to a ground texture by using a detail texture or use scratches on a metal floor.

    But this is nothing I really need because I can draw/edit textures with such details. So why am I writing this tutorial then? Because there is another technique to use them!

    So welcome to my real detail technique.

    You can use 512x512 textures in your map with this unique technique!

    Uhh... But can't you do that already? You are right, but:
    - 512x512 textures have to be downscaled in Hammer a lot to be usefull.
    - 512x512 textures have big load times if you create a wad with like 100 of them.
    - 512x512 textures when downscaled in Hammer will fill up your allocblock limit pretty fast!
    - 512x512 textures scaled down also increase the wpolys a lot!

    So time to show you some magic:


    This is a 512x512 normal texture, downloaded from cgtextures and edited by myself.

    As you can see, it looks pretty sharp for halflife 1.
    The texture is downscaled to 0.125 x 0.125 on the brush to look like that.
    So we already have 112 wpolys only for this room.


    This is a 64x64 normal texture scaled 1x1 ( I resized the 512x512 texture down to 64x64 )
    Look, only 34 wpolys, but an awful texture...

    So what we want is the best quality and also low wpolys.
    You think thats not possible? It is!

    Now we start to use detail textures.
    We need a 512x512 texture saved as 24 bit in .tga format.
    In my example I named it: cg_textures_example_trempler.tga
    Also we need a 64x64 texture in your .wad that looks the same as your 512x512 ( A resized version of it )
    And we also need a 64x64 texture that is filled with grey color.


    Here I used a 64x64 grey only texture. Also 34 wpolys

    So the next step is, create a mapname_detail.txt (yourmapname than _detail)
    Now it should look like this:

    cgtextex_tr_sma detail/example/cg_textures_example_trempler 1.0 1.0

    The first information is the texture in my wad.
    The second information is the path where my detailtexture is stored and named.
    The last information is the size of it, 1.0 x 1.0 you also can use -1.0 x 1.0 if you want to flip it.

    If you did everything and start your map again, check if r_detailtextures is set to 1 and also supported.

    If so, we have this fantastic result:



    I think you understand now, why I love this technique.
    Someone asked me to share it, and here it is

    Also you can do a lot of stuff, make the detailtexture smaller like 0.1 0.1 to have super high detailed floor tiles as example.

    Oh. One last hint, all these grey textures could make you mad in Hammer. Create 2 wad files, one with the downsized 64x64 textures or what you need ( size doesnt matter much ) and one wad with the same textures but just all in blank-grey ! ( dont change names of them ) than you can swap before compiling the map to not work with grey textures

    Here is the download:

    https://drive.google.com/file/d/0B1m...ew?usp=sharing
    Or use
    http://www.filedropper.com/tremplersdetailtexturesguide

    Thanks a lot
    Comments, Feedback, Questions are welcome !


    -Trempler

    here
    Modstatus: Unknown

  2. #2
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,458

    Re: How to use detailtextures in a professional manner

    +1 Trempler, Excellent method and a well explained/clear tutorial.
    Regards
    Wolf-3D

  3. #3
    Super moderator GeckonCZ's Avatar  
    Programmer
    Join Date
    May 2014
    Location
    Great Moravia
    Posts
    262

    Re: How to use detailtextures in a professional manner

    Good tut and result is really nice.

    Keep it coming.

  4. #4
    Registered User Kachitos's Avatar
    Join Date
    Jun 2014
    Posts
    2

    Re: How to use detailtextures in a professional manner

    I remember using 0.5 scaled 512px detail textures on brushes with the 256px version of the detail tex. It looked really good, sharper than most source games but the fps hit was there so i gave up. Definitely going to try your method out someday, thanks!

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    522

    Re: How to use detailtextures in a professional manner

    Detail textures have far too many cons to their use than benefits.

    1) Maps with detail textures are very easy to cheat on. A couple edits to the texture definition file = white walls galore.
    2) Detail textures can cause severe performance hits, on top of the already abysmal performance issues of AMD/Intel GPUs and styles lights.
    3) Adding dozens of 512x512 targa images to likely an already pretty big resource dependency list of the map = long download times.
    4) Detail textures are rarely used correctly. Often a face with a detail texture is placed next to a normal face which results in the face "popping" out. This can cause eye strain if done in large areas.
    5) Additional complexity in the mapping process of maintaining multiple sets of textures AND a definition list.

    Over the decade or so that detail textures have existed, I've only seen a tiny handful of maps that used them correctly. The majority of them were on CS:CZ, which is what detail textures were designed for. I think I've only seen two community maps that were bearable to look at with detail textures.

    In my opinion, detail textures are just another one of those ugly bolted on hacks that Valve so frequently likes doing. The implementation is poor and the feature is almost entirely useless.

  6. #6
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,458

    Re: How to use detailtextures in a professional manner

    While I cannot disagree with you GiGaBiTe because you are fundamentally correct,
    the tutorial is both clear/easy to understand and the knowledge passed on is valuable to current mappers.

    We all have to remember that even a "standard box room" textured using only the halflife.wad can either be bland or look good. (Artistic/colour coordination skills vary, just like programming/logic skills or the amount of pre-design work a mapper may do before they open Hammer.)

    So where possible lets keep things critical but with a positive and helpful slant. (If you cannot think of a positive slant, still post but just head it "Warnings/things to be aware of from my own personal experience".

    ---

    If you are a "newbie mapper", this technique falls towards the end of your map building process, get your "overall" map theme on paper[i.e. Type of map/gameplay ideas etc], build your maps layout [walls, door, windows with design textures if possible], test map for problems [lack of viz blocking, choke/spawn spam points], replace design textures with final textures, then :
    Think about particular areas where gameplay is both slow and where players may spend a Lot of time [e.g. a Puzzle room, where several players need to co-operate to solve something.]
    This would be the ideal area to try out "Detailed Textures".
    [ EDIT: Forgot Lighting, remember there is no real reason for using "Detailed Textures" in dark or unlit areas, because most players will never see them.]
    If you like the results (given the amount of time and effort it took you to detail the textures), repeat in other areas where players may pause and look.
    Last edited by wolf-3d; 19-06-2015 at 07:39 AM.
    Regards
    Wolf-3D

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

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by GiGaBiTe View Post
    Detail textures have far too many cons to their use than benefits.

    1) Maps with detail textures are very easy to cheat on. A couple edits to the texture definition file = white walls galore.
    2) Detail textures can cause severe performance hits, on top of the already abysmal performance issues of AMD/Intel GPUs and styles lights.
    3) Adding dozens of 512x512 targa images to likely an already pretty big resource dependency list of the map = long download times.
    4) Detail textures are rarely used correctly. Often a face with a detail texture is placed next to a normal face which results in the face "popping" out. This can cause eye strain if done in large areas.
    5) Additional complexity in the mapping process of maintaining multiple sets of textures AND a definition list.

    Over the decade or so that detail textures have existed, I've only seen a tiny handful of maps that used them correctly. The majority of them were on CS:CZ, which is what detail textures were designed for. I think I've only seen two community maps that were bearable to look at with detail textures.

    In my opinion, detail textures are just another one of those ugly bolted on hacks that Valve so frequently likes doing. The implementation is poor and the feature is almost entirely useless.
    Let me answer on this
    1. Yes you are right you can "cheat" with them, like when r_Detailtextutes 0 the map is blank, there are also console commands that render the map blank, so this can be done with .wad´s also.
    2. Detailtextures cant cause server performance hits, this is not correct. Who said that? Same to light styles, these are allways expensive in use. About AMD/Intel not sure, my Radeon 4870 and also my gtx970 have no drops.
    3. Yeah this is correctly the size can be big.
    4. Mapper fault. You have to know how to use this technique. I found a way for myself to make this usefully.
    5. Yeah it is more work but if used well the result is great.

    http://cs.gamebanana.com/maps/184750 <- Here my cs 1.6 map with a lot of 512x512 DetailTextures.

    And thank you for writing If I´m wrong with something you wrote there, I´m sry but so far I havent found a "No-Go" to use them.

    here
    Modstatus: Unknown

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

    Re: How to use detailtextures in a professional manner

    Nice tut.! I at least want to use this method to texture my dynamic skybox. I didn't even know detail textures could fully replace normal textures. I always thought they were monochrome overlays or something.

    Quote Originally Posted by TrEmPlEr View Post
    2. Detailtextures cant cause server performance hits, this is not correct. Who said that?
    Nobody did . He said it causes severe performance hits. This is good to know because I was beginning to think a map made out of detail textures would have better performance because of the lower wpoly.
    Love,
    w00tguy

  9. #9
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,458

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by w00tguy123 View Post
    ...
    Nobody did . He said it causes severe performance hits. This is good to know because I was beginning to think a map made out of detail textures would have better performance because of the lower wpoly.
    Oops, now I am confused, I thought Gigabyte was referring to the General Use of "Detailed Textures" as seen in most maps. (Here I have noticed the same problems and thus agree.)

    But I don't think this implementation is the same, I thought people where building those maps by using a "High Res/Sharp Texture" and then overlaying it with an "Effects/Transparent" Texture.

    Whereas Trempler is suggesting using the Same Method with a "grey only texture" (Instead of a Transparent Texture with blemishes, scratches, dirt etc.)

    I would assume the GPU/render code, needs to do 2 times pass for a "transparent texture" (like it does for water.) whereas here it actually just renders the "High Res/Sharp Texture" (and possibly ignores/does not render the Grey Texture? - IDK).

    Have I got this wrong?
    (I have not tried using Detailed Textures for many years.)
    Regards
    Wolf-3D

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

    Re: How to use detailtextures in a professional manner

    As I understand it, the grey texture will be rendered in addition to the detailed one. On most systems I would expect the performance hit to be negligible, but apparently some of them choke on "special effects" like this.

    If HL implements detail textures using the CPU (combining textures and then sending them to the GPU to render in one pass, on demand), then it would make sense that using them would hurt performance just as much as lighting styles.
    Love,
    w00tguy

  11. #11
    Registered User
    Join Date
    Mar 2012
    Posts
    522

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by wolf-3d View Post
    I would assume the GPU/render code, needs to do 2 times pass for a "transparent texture" (like it does for water.) whereas here it actually just renders the "High Res/Sharp Texture" (and possibly ignores/does not render the Grey Texture? - IDK).

    Have I got this wrong?
    (I have not tried using Detailed Textures for many years.)
    The base texture will always be rendered, no matter what you set the base texture to. If this wasn't the case, every detail textured face would look like a hall of mirrors to people with detail textures disabled.

    Using solid colors for base textures under the detail texture is bad because it will alter radiosity lighting calculations. If you have let's say an orange base texture and a grey detail texture, the bounced light will still be orange and look very strange. The same goes with using low resolution base textures; Since the lightmap grid is tied to texture and face size, you can end up with horrible staircase lighting if the texture is expanded too much or eating too much lighting data if it's too small.

    Quote Originally Posted by w00tguy123 View Post
    If HL implements detail textures using the CPU (combining textures and then sending them to the GPU to render in one pass, on demand), then it would make sense that using them would hurt performance just as much as lighting styles.
    The HL engine has no concept of advanced rendering techniques like this. It basically blasts everything to the GPU in immediate mode as the engine gets data in the frame ready. Valve today still doesn't have any concept of proper rendering techniques, which is why CS:GO has the horrible bolted on "dynamic lighting" system that needs a GTX980 to run at any respectable frame rate.

  12. #12
    Registered User Lymphoid's Avatar
    Join Date
    Mar 2002
    Location
    Norway
    Posts
    1,176

    Re: How to use detailtextures in a professional manner

    What exactly is happening here? There is a text file that tells the map to replace with high res image? Why does this make the game smoother? Can I do this will all my textures in game? Was this used in HL? Thanks.

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

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by Lymphoid View Post
    What exactly is happening here? There is a text file that tells the map to replace with high res image?
    That's not how detail textures work.

    The detail texture definition list tells the engine which TGA image to overlay on top of an existing texture and what scale the TGA image should be rendered at. The base texture will always be rendered regardless of what detail texture is used.

    Quote Originally Posted by Lymphoid View Post
    Why does this make the game smoother?
    Detail textures don't make the game run better, they make the game run worse.

    Quote Originally Posted by Lymphoid View Post
    Can I do this will all my textures in game?
    Yes, you can use detail textures on pretty much all texture types. I think the only exception are special textures like water and scrolling textures (textures prefixed with ! and SCROLL respectively.)

    [/QUOTE]Was this used in HL? Thanks.[/QUOTE]

    No. Detail textures were added to the HL engine for Counter-Strike: Condition Zero, which was released in 2004. You could technically add detail textures to the HL campaign now, but the maps are so poorly made and lacking in detail that it'd be a pointless effort. You'd get better results by remaking all of the HL maps and fixing the massive amount of problems they have.

  14. #14
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,950

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by TrEmPlEr View Post
    Hello everyone and welcome to my first tutorial.
    ...
    -Trempler
    Share your mapping expertise by writing a tutorial!
    http://scmapdb.com/contribute:tutorial

    You can copy images and files.

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

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by GiGaBiTe View Post
    Detail textures don't make the game run better, they make the game run worse.
    You are 100% wrong at this point, use it as I wrote and you can make the map even smoother
    I have a huge testmap for this if you dont trust me.

    And Spy-Warrior I maybe do that soon was a bit lazy

    here
    Modstatus: Unknown

  16. #16
    Registered User
    Join Date
    Mar 2012
    Posts
    522

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by TrEmPlEr View Post
    You are 100% wrong at this point, use it as I wrote and you can make the map even smoother
    I have a huge testmap for this if you dont trust me.
    Here's a real world example that isn't a box with 6 walls.

    CPU: i5-2400
    RAM: 8 GB
    GPU: R9 280x
    Res: 1600x1200

    de_aztec_cz:

    Without detail textures: 153 FPS


    With Detail textures: 113 FPS


    That's a 26% reduction in frame rate.

    What was that about it not affecting performance again?

    I also ran the tests on two other of my machines (A8-6500 and Pentium D 805) and the performance hit is still there.
    Last edited by GiGaBiTe; 21-08-2015 at 02:13 AM.

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

    Re: How to use detailtextures in a professional manner

    as I told you before, you havent used my methode.


    Taken on my old pc that can play hl2 on medium settings.
    *edit* Fullscreen links
    http://i.imgur.com/bweMYHj.jpg
    http://i.imgur.com/UnOLKs3.jpg

    here
    Modstatus: Unknown

  18. #18
    Registered User
    Join Date
    Mar 2012
    Posts
    522

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by TrEmPlEr View Post
    as I told you before, you havent used my methode.
    I've already proven my point that detail textures cause performance problems.

    The only thing you do differently is use solid fill textures. Other than that, there's no difference in your method vs. how they're used by default.

    Quote Originally Posted by TrEmPlEr View Post


    Taken on my old pc that can play hl2 on medium settings.
    I find it very interesting that both screenshots don't register even 1 frame of difference. Even in an empty room, there is a small variation on frame rendering times.

    If that doesn't say the screenshots are rigged, then being cryptic about the PC specs the map is running on gives more reason to believe they're rigged.

    You're going to have to post the map for scrutiny for "your methods" to be believed. I don't need to post mine since you can grab the BSP from CS:CZ

  19. #19
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: How to use detailtextures in a professional manner

    Different computers may produce different results due to GoldSource's renderer not being designed for modern systems. I suggest you tone down the accusations.

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

    Re: How to use detailtextures in a professional manner

    http://cs.gamebanana.com/maps/184750 take a look, it may can slower down some computers but so far I never noticed something.

    here
    Modstatus: Unknown

  21. #21
    Registered User
    Join Date
    Mar 2012
    Posts
    522

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by Solokiller View Post
    Different computers may produce different results due to GoldSource's renderer not being designed for modern systems. I suggest you tone down the accusations.
    Except in his own words:

    "You are 100% wrong at this point, use it as I wrote and you can make the map even smoother "

    IE. being an ass and then posting rigged screencaps to try and make me look like I don't know what I'm talking about.

    Quote Originally Posted by TrEmPlEr View Post
    take a look, it may can slower down some computers but so far I never noticed something.
    No, you don't get to change your story to try and save face from your earlier comment. According to you, detail textures should never cause performance issues in any situation.

    Here's your map:

    Detail textures disabled:

    149 fps


    116 fps

    Detail textures cause a 22% performance hit in this area. I don't see "your method" making any difference.

    The reason that your screenshots didn't register any frame differences is because you have gl_vsync 1 and a frame rate less when detail textures are enabled and disabled.

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

    Re: How to use detailtextures in a professional manner

    I'd be interested to see how fast that area renders with normal 512x512 textures scaled down. Even if detail textures perform worse, there's still a reason to use them - the flashlight beam won't be tiny. There doesn't seem to be a way to change the flashlight scale via compiler options (I've tried -dscale, -scale, and -notexscale).

    That said, using detail textures this way may be going a bit too far. If someone has a crappy framerate because of detail textures, then it would be nice to let them turn it off without seeing a completely white map.
    Love,
    w00tguy

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

    Re: How to use detailtextures in a professional manner

    Quote Originally Posted by GiGaBiTe View Post
    IE. being an ass and then posting rigged screencaps to try and make me look like I don't know what I'm talking about.
    No, you don't get to change your story to try and save face from your earlier comment. According to you, detail textures should never cause performance issues in any situation.
    The reason that your screenshots didn't register any frame differences is because you have gl_vsync 1 and a frame rate less when detail textures are enabled and disabled.
    Actually I was wrong about performance than, but tbh I never had a drop like you there.
    Tested on my 3,0 Duocore Intel + 8 gb ddr + radeon 9800 pro and I have only a difference of 4-5 fps
    And on my main pc 4,0 ghz Intel quadcore i7 + 16 gb ddr + gtx970 none.
    ( I made the screenshots with my girlfriends computer: 3,0 Quadcore Intel, 8 gb ddr , gtx 660. )

    And call me using rigged picture is just a bitchmove, why should I ? were are my benefits of doing that?
    Actually I cant see such a huge drop on my machines, maybe it has something to do with windowed mode or resulution or some other settings.
    After talking with a good friend of mine the only possible fps eating could be the generating of mipmaps for the detailtextures and the performance loss might be because they are not generated by HL.
    Last edited by TrEmPlEr; 22-08-2015 at 03:54 AM.

    here
    Modstatus: Unknown

  24. #24
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,458

    Re: How to use detailtextures in a professional manner

    I find this very interesting and like w00tguy, would like to actually find out (if possible) the Pros and Cons of what is happening:

    "The reason that your screenshots didn't register any frame differences is because you have gl_vsync 1 and a frame rate less when detail textures are enabled and disabled."

    Gigabyte: "gl_vsync 1" Because I had no idea what it was/does, I did a quick search, does it force your GPU/Video card to sync(hronize) refresh rates with your monitor. (i.e. Cause your GPU to slow down but theoretically "smooth" out video playback.)
    Also if "video playback" is what I think it is, why would it cause changes here. (or is SC general gameplay treated like video due to the old openGL draw code SC employs.)

    And likewise Trempler for:
    "After talking with a good friend of mine the only possible fps eating could be the generating of mipmaps for the detailtextures and the performance loss might be because they are not generated by HL."

    Is there a possibility then what we could make some minor openGL code additions ? (or will adding mipmap generation/correcting the code be a hugh task.)


    PS: Please don't let this degrade into a personal conflict over "who is right or who is wrong", "name calling etc", this thread may end up giving us some sort of road map when it comes to improving gameplay, maps and/or our code base.
    Regards
    Wolf-3D

  25. #25
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: How to use detailtextures in a professional manner

    Once we've switched to shaders detail textures should be much more performant. They're basically highly detailed decals, so rendering them is a matter of drawing alpha multiplied RGB data. A shader can do that in a very efficient way.

Page 1 of 2 12 LastLast

Posting Permissions

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