Hedgehog engine 2

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:

Texture types and their common use cases

Type

Primarily used with

Occasionally used with

diffuse

Albedo, Falloff

/

transparency

Albedo

Transparency

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.

Tip

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.

The addon automatically handles those on import (if you specified the NTSP directory), but if you want to handle streamed file data outside of blender, you can use NeedleTextureStreamingUtility.

Kinds of textures

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

Albedo

Reference

File suffix:

_abd

Composition:

RGBA

Recommended encoding:
  • BC1_UNORM when opaque,

  • BC7_UNORM when transparent

../../../_images/guides_material_editing_textures_he2_dif.png

chr_big_fur_abd.dds from Sonic X Shadow Generations

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

Transparency

Reference

File suffix:

_alp

Composition:

Grayscale

Recommended encoding:

BC4_UNORM

../../../_images/guides_material_editing_textures_he2_alp.png

cmnisl_blackstone501_tk1_alp.dds from Sonic X 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

Reference

File suffix:

_fal

Composition:

Color

Recommended encoding:

BC1_UNORM

../../../_images/guides_material_editing_textures_he2_fal.png

chr_big_fur_fal.dds from Sonic X Shadow Generations

../../../_images/guides_material_editing_textures_fal.gif

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

Reference

File suffix:

_ems

Composition:

HDR

Recommended encoding:

BC6H_UF16

../../../_images/guides_material_editing_textures_he2_ems.png

bos_mephiles_body_ems.dds from Sonic X Shadow Generations

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

PRM

Reference

File suffix:

_prm

Composition:

RGBA

Recommended encoding:
  • BC1_UNORM when no alpha channel is needed

  • BC3_UNORM when alpha channel is needed

../../../_images/guides_material_editing_textures_he2_prm.png

chr_big_rod_prm.dds from Sonic X Shadow Generations

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

If you are unfamiliar with Physically based rendering, it is recommended to read up on that before trying to edit materials.

Each channel contains one PBR map:

PRM channels

Channel

Contents

“Default” value

Notes

Example from
chr_big_rod_prm.dds

Red

f0 Specular

0.5

../../../_images/guides_material_editing_textures_he2_prm_r.png

Green

Smoothness

0.8

Blender uses a roughness setup, which is just the inverse of smoothness

../../../_images/guides_material_editing_textures_he2_prm_g.png

Blue

Metallic

0

../../../_images/guides_material_editing_textures_he2_prm_b.png

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.

../../../_images/guides_material_editing_textures_he2_prm_a.png

Important

Older HE2 games, primarily Sonic Forces and Mario & Sonic at the Rio 2016 Olympic Games use a slightly different PRM setup:

PRM channels in older HE2 titles

Channel

Contents

Notes

Red

f0 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 isnt done

Normal map

Reference

File suffix:

_nrm

Composition:

RG

Recommended encoding:

BC5_UNORM

../../../_images/guides_material_editing_textures_he2_nrm.png

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.

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

Reference

File suffix:

_flw

Composition:

RG

Recommended encoding:

BC5_UNORM

../../../_images/guides_material_editing_textures_he2_flw.png

chr_shadow_fur_flw.dds from Sonic X 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

Reference

File suffix:

_fur

Composition:

RGBA

Recommended encoding:

BC3_UNORM

../../../_images/guides_material_editing_textures_he2_fur.png

chr_shadow_fur_fur.dds from Sonic X 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

Reference

File suffix:

_ref

Composition:

Color

Recommended encoding:

BC1_UNORM

../../../_images/guides_material_editing_textures_he2_ref.png

w05_ruins_biometal_ref.dds from Sonic X Shadow Generations

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

Offset map

Reference

File suffix:

_off

Composition:

RG

Recommended encoding:

BC5_UNORM

../../../_images/guides_material_editing_textures_he2_off.png

w09_btl02_poisonswamp_s3_jh1_off.dds from Sonic X 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.