Tooltexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(26 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{todo|find out what else this parameter is also used for}}
{{DISPLAYTITLE:%tooltexture}}
Used for blend [[texture]] previews in [[Hammer]]'s texture browser.


When using a preview tooltexture in a material, the material is scaled up or down to the size of the tooltexture. If the material is a blend of two 1024x1024 textures but your tooltexture is only 256x256, the 1024x1024 textures will be scaled down to the much lower quality of 256x256. Unfortunately, this means that the tooltexture cannot be made smaller to save space (since nobody will see it in-game). You'll need a preview tooltexture as large as you want the texture to display within the engine.
{{clarify|When using a smaller tooltexture, does the basetexture actually get downscaled, or does it just result in a denser texture scale? The latter could actually be useful in some situations.}}


[[File:Blend texture preview01.jpg|The texture to the left|thumb|190px]]


Used for blend texture previews in hammer.
<syntaxhighlight lang=text highlight=5>
WorldVertexTransition
{
    $basetexture    dirt/blend1_mountain_dirt_a1
    $basetexture2  dirt/blend2_mountain_dirt_a1
    %tooltexture    preview/blend_mountain_dirt_a1
    $bumpmap        dirt/blend_mountain_dirt_a1-ssbump
    $ssbump        1
    %detailtype    desert1
    $detail        dirt/blend_mountain_dirt_a1_DM
    $surfaceprop    dirt
    $surfaceprop2  rock
}
</syntaxhighlight>


When using a tooltexture in a material, the material is scaled up or down to the size of the tooltexture. If the material is a blend of two 1024x1024 textures but your tool texture is only 256x256, the 1024x1024 textures will be scaled down to the much lower quality 256x256. Unfortunately, this means that the tooltexture cannot be made smaller to save space (since nobody will see it in-game) - you'll need a tool texture as large as you want the texture to display within the engine.
Without a tooltexture, Hammer will only show your first [[$basetexture]], making it impossible to see the blend in the texture browser.  
 
{{bug|hidetested=1|VTF files without mipmaps will not display correctly in the texture preview, regardless of resolution). Fixed in {{hammer++|1}} build 8866.}}
== VMT syntax example ==
{{ModernImportant|{{hammer++|1}} build 8866 (and newer) do not use {{code|%tooltexture}} on '''[[WorldVertexTransition]]''', as it renders the blends in real time. {{modernConfirm|Is the resolution of the %tooltexture still read? The scale of the %tooltexture takes priority over the scale of the $basetexture in-game.}}
<pre>
}}
"WorldVertexTransition"
[[Category:Shader parameters]]
{
"$basetexture"    "dirt/blend1_mountain_dirt_a1"
"$basetexture2"  "dirt/blend2_mountain_dirt_a1"
"%tooltexture"      "preview/blend_mountain_dirt_a1"
 
$bumpmap          "dirt/blend_mountain_dirt_a1-ssbump"
                "$ssbump"  "1"
%detailtype desert1
"$detail"    "dirt/blend_mountain_dirt_a1_DM"
 
$surfaceprop      dirt
$surfaceprop2    rock
}
</pre>
'''The texture in preview/'''
[[Image:Blend texture preview01.jpg]]
 
This is useful for showing what the 2 blend textures are in a single image, without this it will just show your basetexture on it's own thus not showing it's second blend.

Latest revision as of 07:14, 20 May 2025

Used for blend texture previews in Hammer's texture browser.

When using a preview tooltexture in a material, the material is scaled up or down to the size of the tooltexture. If the material is a blend of two 1024x1024 textures but your tooltexture is only 256x256, the 1024x1024 textures will be scaled down to the much lower quality of 256x256. Unfortunately, this means that the tooltexture cannot be made smaller to save space (since nobody will see it in-game). You'll need a preview tooltexture as large as you want the texture to display within the engine.

Clarify: When using a smaller tooltexture, does the basetexture actually get downscaled, or does it just result in a denser texture scale? The latter could actually be useful in some situations.
The texture to the left
 WorldVertexTransition
 {
     $basetexture    dirt/blend1_mountain_dirt_a1
     $basetexture2   dirt/blend2_mountain_dirt_a1
     %tooltexture    preview/blend_mountain_dirt_a1
     $bumpmap        dirt/blend_mountain_dirt_a1-ssbump
     $ssbump         1
     %detailtype     desert1
     $detail         dirt/blend_mountain_dirt_a1_DM
     $surfaceprop    dirt
     $surfaceprop2   rock
 }

Without a tooltexture, Hammer will only show your first $basetexture, making it impossible to see the blend in the texture browser.

Icon-Bug.pngBug:VTF files without mipmaps will not display correctly in the texture preview, regardless of resolution). Fixed in Hammer++ build 8866.
Icon-Important.pngImportant:Hammer++ build 8866 (and newer) do not use %tooltexture on WorldVertexTransition, as it renders the blends in real time.
Confirm:Is the resolution of the %tooltexture still read? The scale of the %tooltexture takes priority over the scale of the $basetexture in-game.