Jump to content

Hedgehog Engine 2 - Textures: Difference between revisions

From HedgeDocs
Added base page
 
Updated table links
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
|-
|-
|diffuse
|diffuse
|Albedo, Falloff
|[[#Albedo|Albedo]], [[#Falloff|Falloff]]
|/
|/
|-
|-
|transparency
|transparency
|Transparency
|[[#Transparency|Transparency]]
|albedo, mask
|[[#Albedo|Albedo]], Mask
|-
|-
|emission
|emission
|Emission
|[[#Emission|Emission]]
|/
|/
|-
|-
|reflection
|reflection
|Flow map, Fur noise
|[[#Flow map|Flow map]], [[#Fur noise|Fur noise]]
|Iridescence reflection, Offset map
|[[#Iridescence reflection|Iridescence reflection]], [[#Offset map|Offset map]]
|-
|-
|specular
|specular
|PRM
|[[#PRM|PRM]]
|/
|/
|-
|-
|normal
|normal
|Normal map
|[[#Normal map|Normal map]]
|/
|/
|}
|}
Line 63: Line 63:
}}
}}


[[File:HE2 Textures dif.png|thumb|<code>chr_big_fur_abd.dds</code> from Shadow Generations]]
Albedo textures are color-transparency textures that are sampled directly for the base color of a material.
Albedo textures are color-transparency textures that are sampled directly for the base color of a material.


Line 76: Line 77:
| encoding = <code>BC4_UNORM</code>
| encoding = <code>BC4_UNORM</code>
}}
}}
[[File:HE2 Textures transparecy.png|<code>cmnisl_blackstone501_tk1_alp.dds</code> from Shadow Generations|alt=cmnisl_blackstone501_tk1_alp.dds from Shadow Generations|thumb]]


Transparency textures determine the transparency of a material.
Transparency textures determine the transparency of a material.
Line 90: Line 93:
| encoding = <code>BC1_UNORM</code>
| encoding = <code>BC1_UNORM</code>
}}
}}
 
[[File:HE2 Textures fal.png|thumb|<code>chr_big_fur_fal.dds</code> from Shadow Generations]]
[[File:Falloff animation.gif|thumb|A camera rotating around Suzanne with a raw falloff factor. The albedo texture is black, and the falloff texture is white]]
Falloff textures change the color of the albedo texture based on the viewing angle: The greater the angle between the camera and the surface of the model, the greater the influence.
Falloff textures change the color of the albedo texture based on the viewing angle: The greater the angle between the camera and the surface of the model, the greater the influence.


Line 106: Line 110:
| encoding = <code>BC6H_UF16</code>
| encoding = <code>BC6H_UF16</code>
}}
}}
 
[[File:HE2 Texture ems.png|thumb|<code>bos_mephiles_body_ems.dds</code> from Shadow Generations]]
Emission textures make parts of a model emit light. These are usually [https://en.wikipedia.org/wiki/High_dynamic_range HDR] textures.
Emission textures make parts of a model emit light. These are usually [https://en.wikipedia.org/wiki/High_dynamic_range HDR] textures.


Line 121: Line 125:
* <code>BC3_UNORM</code> when alpha channel is needed
* <code>BC3_UNORM</code> when alpha channel is needed
}}
}}
 
[[File:HE2 Textures prm.png|thumb|<code>chr_big_rod_prm.dds</code> from Shadow Generations]]
PRM textures, an abbreviation for “Parameter”, are the defacto PBR textures of Hedgehg Engine 2 games.
PRM textures, an abbreviation for “Parameter”, are the defacto PBR textures of Hedgehog Engine 2 games.


If you are unfamiliar with Physically based rendering, you should look into the [[Hedgehog Engine 2 - Physically Based Rendering (PBR)|Physically Based Rendering]] documentation before trying to edit materials.
If you are unfamiliar with Physically based rendering, you should look into the [[Hedgehog Engine 2 - Physically Based Rendering (PBR)|Physically Based Rendering]] documentation before trying to edit materials.
Line 142: Line 146:
|0.5
|0.5
|The engine multiplies the sampled value by 0.5
|The engine multiplies the sampled value by 0.5
|
|[[File:HE2 Textures prm r.png|thumb]]
|-
|-
|Green
|Green
Line 148: Line 152:
|0.8
|0.8
|Blender uses a roughness setup, which is just the inverse of smoothness
|Blender uses a roughness setup, which is just the inverse of smoothness
|
|[[File:HE2 Textures prm g.png|thumb]]
|-
|-
|Blue
|Blue
Line 154: Line 158:
|0
|0
|
|
|
|[[File:HE2 Textures prm b.png|thumb]]
|-
|-
|Alpha
|Alpha
Line 162: Line 166:


AO gets mixed into the lighting, which is difficult to replicate in render engines like Cycles, but doable in Eevee.
AO gets mixed into the lighting, which is difficult to replicate in render engines like Cycles, but doable in Eevee.
|
|[[File:HE2 Textures prm a.png|thumb]]
|}
|}


{{notice
| type = note
| content = Older HE2 games, primarily Sonic Forces and Mario & Sonic at the Rio 2016 Olympic Games use a slightly different PRM setup:
{{{!}} class="wikitable"
{{!}}+
!Channel
!Contents
!Notes
{{!}}-
{{!}}Red
{{!}}Specular
{{!}}If the value is above 0.9, the material gets treated as completely metallic.
{{!}}-
{{!}}Green
{{!}}Smoothness
{{!}}Same as above
{{!}}-
{{!}}Blue
{{!}}Ambient Occlusion
{{!}}
{{!}}-
{{!}}Alpha
{{!}}Metallic
{{!}}Only used in select shaders like <code>MCommon</code>, where the specular-above-0.9 check isn't done
{{!}}}
}}


=== Normal map ===
=== Normal map ===
Line 173: Line 204:
| encoding = <code>BC5_UNORM</code>
| encoding = <code>BC5_UNORM</code>
}}
}}
 
[[File:HE2 Textures nrm.png|thumb|<code>chr_big_rod_nrm.dds</code> from Sonic X Shadow Generations]]
Normal map textures are used for faking bumps and dents on a model to affect lighting, falloff, environment maps and similar.
Normal map textures are used for faking bumps and dents on a model to affect lighting, falloff, environment maps and similar.


Line 196: Line 227:
| encoding = <code>BC5_UNORM</code>
| encoding = <code>BC5_UNORM</code>
}}
}}
 
[[File:HE2 Textures flw.png|thumb|<code>chr_shadow_fur_flw.dds</code> from Shadow Generations]]
Flow textures are two-component textures that, similar to normal maps, encode a direction. Each pixel determines the direction of “flow” to use when sampling the noise texture.
Flow textures are two-component textures that, similar to normal maps, encode a direction. Each pixel determines the direction of “flow” to use when sampling the noise texture.


Line 213: Line 244:
| encoding = <code>BC3_UNORM</code>
| encoding = <code>BC3_UNORM</code>
}}
}}
 
[[File:HE2 Textures fur.png|thumb|<code>chr_shadow_fur_fur.dds</code> from Shadow Generations]]
Fur noise textures get sampled based on the direction of a flow map to create a “flowing lines” type of pattern.
Fur noise textures get sampled based on the direction of a flow map to create a “flowing lines” type of pattern.


Line 231: Line 262:


Iridescence shaders use these reflection textures to create their effect of the same name.
Iridescence shaders use these reflection textures to create their effect of the same name.
{| class="wikitable" width="128px" style="margin-left: auto; margin-right: 0px;"
|-
| [[File:HE2 Textures ref.png|center]]
<code>w05_ruins_biometal_ref.dds</code> from Sonic X Shadow Generations
|}


<div style="clear: both"/>
<div style="clear: both"/>
Line 241: Line 278:
| encoding = <code>BC5_UNORM</code>
| encoding = <code>BC5_UNORM</code>
}}
}}
 
[[File:HE2 Textures off.png|thumb|<code>w09_btl02_poisonswamp_s3_jh1_off.dds</code> from Shadow Generations]]
Offset maps are basically normal maps that are used to distore another texture by shifting the sample coordinate.
Offset maps are basically normal maps that are used to distore another texture by shifting the sample coordinate.



Latest revision as of 08:38, 12 July 2025

Hedgehog Engine 2 games limit themselves to a few texture types, which can make configuring materials difficult, as many shaders use certain types differently than what their name suggests.

Here is a list of all texture types and how they are most commonly used:

Type Primarily used with Occasionally used with
diffuse Albedo, Falloff /
transparency Transparency Albedo, Mask
emission Emission /
reflection Flow map, Fur noise Iridescence reflection, Offset map
specular PRM /
normal Normal map /

File formats and encodings

Textures are always stored in DDS files.

HE2 is programmed with Direct3D 11 (or newer), which means all DDS encodings are available for use.

More info on DDS block compression can be found here.

Info
HE2 games often use BC7 encoding for its higher image quality. If the recommended encoding does not give satisfying results, you can always use BC7 encoding to increase the quality, but keep in mind that this will also increase file size!


File streaming

Many textures in Frontiers and onwards make use of file streaming to reduce texture-load-time and reuse the same texture between multiple archives.

You can pack/unpack/view info of streamed texture packages using NeedleTextureStreamingUtility.

Kinds of textures

The majority of textures used by materials are one of the following kind of textures.

Albedo

Texture overview
File Suffix _abd
Composition RGBA
Recommended encoding
  • BC1_UNORM when opaque,
  • BC7_UNORM when transparent


chr_big_fur_abd.dds from Shadow Generations

Albedo textures are color-transparency textures that are sampled directly for the base color of a material.

See albedo for reference.

Transparency

Texture overview
File Suffix _alp
Composition Grayscale
Recommended encoding

BC4_UNORM


cmnisl_blackstone501_tk1_alp.dds from Shadow Generations
cmnisl_blackstone501_tk1_alp.dds from Shadow Generations

Transparency textures determine the transparency of a material.

Usually transparency is relayed to Albedo textures, and actual opacity textures are only used when special alpha compositing happens.

Falloff

Texture overview
File Suffix _fal
Composition Color
Recommended encoding

BC1_UNORM

chr_big_fur_fal.dds from Shadow Generations
A camera rotating around Suzanne with a raw falloff factor. The albedo texture is black, and the falloff texture is white

Falloff textures change the color of the albedo texture based on the viewing angle: The greater the angle between the camera and the surface of the model, the greater the influence.

Depending on the shader, the falloff color either gets mixed with the albedo color or added to it.

Additionally, shaders with falloff colors or textures basically always come with a parameter that controls how the falloff factor gets calculated.

Emission

Texture overview
File Suffix _ems
Composition HDR
Recommended encoding

BC6H_UF16

bos_mephiles_body_ems.dds from Shadow Generations

Emission textures make parts of a model emit light. These are usually HDR textures.

See emission for reference.

PRM

Texture overview
File Suffix _prm
Composition RGBA
Recommended encoding
  • BC1_UNORM when no alpha channel is needed,
  • BC3_UNORM when alpha channel is needed
chr_big_rod_prm.dds from Shadow Generations

PRM textures, an abbreviation for “Parameter”, are the defacto PBR textures of Hedgehog Engine 2 games.

If you are unfamiliar with Physically based rendering, you should look into the Physically Based Rendering documentation before trying to edit materials.

Each channel contains one PBR map:

Channel Contents "Default" value Notes Example from chr_big_rod_prm.dds
Red Specular 0.5 The engine multiplies the sampled value by 0.5
Green Smoothness 0.8 Blender uses a roughness setup, which is just the inverse of smoothness
Blue Metallic 0
Alpha Ambient Occlusion 1 Many tutorials claim that AO is just multiplied into the albedo channel, which is not true.

AO gets mixed into the lighting, which is difficult to replicate in render engines like Cycles, but doable in Eevee.

Note
Older HE2 games, primarily Sonic Forces and Mario & Sonic at the Rio 2016 Olympic Games use a slightly different PRM setup:
Channel Contents Notes
Red Specular If the value is above 0.9, the material gets treated as completely metallic.
Green Smoothness Same as above
Blue Ambient Occlusion
Alpha Metallic Only used in select shaders like MCommon, where the specular-above-0.9 check isn't done


Normal map

Texture overview
File Suffix _nrm
Composition RG
Recommended encoding

BC5_UNORM

chr_big_rod_nrm.dds from Sonic X Shadow Generations

Normal map textures are used for faking bumps and dents on a model to affect lighting, falloff, environment maps and similar.

See normal mapping for reference.

Note
HE2 always automatically calculates the blue / Z channel for normal maps. That means, when using a three-component texture for a normal map, the blue channel gets ignored.


Other

Flow Map

Texture overview
File Suffix _flw
Composition RG
Recommended encoding

BC5_UNORM

chr_shadow_fur_flw.dds from Shadow Generations

Flow textures are two-component textures that, similar to normal maps, encode a direction. Each pixel determines the direction of “flow” to use when sampling the noise texture.

Note
Older flow texture have a blue channel, which went unused.


Fur Noise

Texture overview
File Suffix _fur
Composition RGBA
Recommended encoding

BC3_UNORM

chr_shadow_fur_fur.dds from Shadow Generations

Fur noise textures get sampled based on the direction of a flow map to create a “flowing lines” type of pattern.

The color channel gets multiplied into the albedo color, while the alpha channel determine the specularity.

This allows for characters to have fine details without needing huge textures.

Iridescence reflection

Texture overview
File Suffix _ref
Composition Color
Recommended encoding

BC1_UNORM


Iridescence shaders use these reflection textures to create their effect of the same name.

w05_ruins_biometal_ref.dds from Sonic X Shadow Generations

Offset map

Texture overview
File Suffix _off
Composition RG
Recommended encoding

BC5_UNORM

w09_btl02_poisonswamp_s3_jh1_off.dds from Shadow Generations

Offset maps are basically normal maps that are used to distore another texture by shifting the sample coordinate.

These are often used with things like water or wind.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.