$detail: Difference between revisions
(→Parameters and Effects: reworded the limitations so it makes more sense. I had to read the original a dozen times until I finally understood it. If it is still wrong, please reword it in a way that is not "0-9 without, but 0-7 with".) |
SirYodaJedi (talk | contribs) (→Parameters and Effects: mention ill-documented "mipblend" feature from vtex, as well as how to save space on $detailblendmode 7 textures.) |
||
Line 63: | Line 63: | ||
| {{td| 0 |dark=1}} | | {{td| 0 |dark=1}} | ||
{{td| DecalModulate }} | {{td| DecalModulate }} | ||
{{td| This functions the same as the {{ent|DecalModulate}} shader—colors below 128 darken the image, colors above lighten the image. }} | {{td| This functions the same as the {{ent|DecalModulate}} shader—colors below 128 darken the image, colors above lighten the image. | ||
{{tip|Use {{vtex|2}}'s {{mono|mipblend}} option to have detail textures which use this blend mode "fade out" when at a distance, reducing aliasing.}} }} | |||
}} | }} | ||
{{tr | {{tr | ||
Line 98: | Line 99: | ||
| {{td| 7 |dark=1}} | | {{td| 7 |dark=1}} | ||
{{td| Two-Pattern DecalModulate }} | {{td| Two-Pattern DecalModulate }} | ||
{{td| Only the red and alpha channels of the detail texture are used. This operates like the {{ent|DecalModulate}} shader or blend mode 0, but the base alpha channel fades between using the red (0) or alpha (255) detail channel as the modulation source. This effectively allows two detail materials, although both are greyscale. }} | {{td| Only the red and alpha channels of the detail texture are used. This operates like the {{ent|DecalModulate}} shader or blend mode 0, but the base alpha channel fades between using the red (0) or alpha (255) detail channel as the modulation source. This effectively allows two detail materials, although both are greyscale. | ||
{{tip|If this a detail texture using this blend mode should need to be stored in an uncompressed format, consider using [[VTF_(Valve_Texture_Format)#Image_data_formats|IA88 instead of BGRA8888]], for half the file size at no quality loss.}} }} | |||
}} | }} | ||
{{tr | {{tr |
Revision as of 07:14, 10 January 2024

Template:Shaderparam It specifies a texture which Source will use to add high-resolution detail to a material when it is viewed up close, by darkening or lightening the albedo appropriately, depending on the $detailblendmode. You can also use a full color (as opposed to grayscale) image and blend it using $detailblendmode 2. It is very effective for increasing the apparent resolution of a texture, and was used extensively in Half-Life 2: Episode Two, as well as
Portal 2 for the white tile textures's bumps.

- In
on LightmappedGeneric, Does not work with $seamless_scale.
- In
on VertexLitGeneric. Does not work with $selfillumfresnel, if $bumpmap is used.
- In
on LightmappedGeneric, Does not work with $lightwarptexture
Note:
- In
, LightmappedGeneric does not appear to even have $lightwarptexture as a parameter... So it 'cannot not' work.
- In
on VertexLitGeneric, Does not work with $desaturatewithbasealpha
- In
, Does not work with $blendmodulatetexture and $bumpmap
- In
- Todo: Document issues from other branches of source.
Note: Using $detail with $blendmodulatetexture will cause a graphical issue (stripes over the surface), only works correctly in
.
Syntax
$detail <texture>
You will probably want to use at least $detailscale
(see below) as well.
Parameters and Effects
$detailframe
$detail_alpha_mask_base_texture
WorldVertexTransition Parameters
$detailscale2
$detailblendfactor2
$detailframe2
$detailtint2

SolidEnergy Parameters




$detail
has very similar parameter names, but they are not the same! $detail1
$detail1blendmode
$detail1scale
$detail1blendfactor
$detail1frame
$detail2
$detail2blendmode
$detail2scale
$detail2blendfactor
$detail2frame
Valve's Detail Textures
Valve's stock detail textures (available in OB only) are best used with the following pre-configured values:
$detail detail\noise_detail_01 // e.g. for brickwork, concrete... $detailscale 7.74 $detailblendfactor 0.8 $detailblendmode 0
$detail detail\metal_detail_01 $detailscale 4.283 $detailblendfactor .65 $detailblendmode 0
$detail detail\rock_detail_01 $detailscale 11 $detailblendfactor 1 $detailblendmode 0
$detail detail\plaster_detail_01 $detailscale 6.783 $detailblendfactor .8 $detailblendmode 0
The below parameters come from models\props_forest\LadderWood.vmt. It is the only Valve Stock texture VMT file to use this particular detail texture. Because the detail texture (detail\wood_detail_01) is a high resolution (1024×1024), the $detailscale
is lower than the others, with the exception of rock_detail_01.
$detail detail\wood_detail_01 $detailscale 2.563 $detailblendfactor .8 $detailblendmode 0
Additionally, there are 2 other stock detail textures. detail\detailash001a and detail\detaildirt001a. These files were used in the "leaked" version of Half-Life 2 and in
Half-Life 2: Episode One using the following parameters.
Concrete/concretefloor009a in Episode One materials:
$detail detail/detaildirt001a $detailscale 0.27
Metal/metalfloor005a in Episode One materials:
$detail detail/detailash001a $detailscale 0.50
See also
Hiding large-scale tiling with detail textures - How to make texture repeating less noticeable using $detail