HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Texture Settings for Diffuse and Normals  (Read 2501 times)


  • General Accounts
  • *
  • Posts: 18
    • View Profile
Texture Settings for Diffuse and Normals
« on: May 30, 15, 12:46:41 AM »

Hello fellow devs! 
I have been making a plethora of textures for our game, and there are two issues that I'm seeing overall that I'd like to find out more information about.  [This is after heavy testing, wiki reading, and experience]

First Issue:
In the diffuse channel for materials, you can have Parallax Bumps/Bump Maps in Hero Materials, but I don't see any way to enable them for the terrain textures.  If you put an alpha channel in a diffuse currently (as DXT5), it asks like a gradient "Alpha Mask" property (which is cool, but our game doesn't need Alpha Mask for our terrain).  I would MUCH rather be able to put a true 'heightmapped' bump/parallax map in that Alpha channel.  I know what you're going to say: "norm maps are far superior.. etc." while as this is true, we all know that -normal map + bump map- is in combination, far superior to either alone.

Is there any way to do this?  I've tried pretty much every .dds filetype and setting to try to enable this function, but I'm not sure how to get the terrain shader to comply.

Second Issue:
I see that HE reads DXTnm files as RGBA instead of XY (GA) - but that it does indeed read them as DXT5 files.  Is there a plan in the future to enable this, since it's a normal function of DX?

Both of these issues surmount to this:
Hero Engine currently only lets you use compressed .dds files, which is fine for Diffuse, but when it comes to normals, they come out pixelated and lossy.  I'd like to be able to use DXTnm, but since that doesn't seem possible (especially because the spec being the alpha just gets wacky with the L/R normal channel being the spec in DXTnm) is there a way to get more out of my normals?  I know I can make them double the resolution, but in all honesty, I'd either like to use a non-compressed .dds at 1/2 resolution (or 1/4, whatever) for the normals, use DXTnm, or be able to at least add a parallax/bump to the diffuse.  Maybe there's a filetype i've missed that enables this?

EDIT -- Also, to give the devs more of an idea of what this combo does: 
The effect that I'm going for is good depth at extreme angles.  Parallax Bump + Normal = Good depth at extreme angles.  The normals by themselves do really really poorly at keeping dimension at extreme angles (which, if you're in first person - everything is extreme angles).

Any help would be awesome.  Love this engine!

Odyssey of Ydris

EDIT/UPDATE -- I got ARGB working.  It makes the files much larger, but lowering the resolution and keeping them uncompressed seems to do the trick!  Comparable file size, better normals!

I'm still hoping there's some info on the bump maps for diffuse, so let me know - thanks!
« Last Edit: Jun 14, 15, 11:16:19 AM by McIndus »


  • *****
  • Posts: 2221
    • View Profile
Re: Texture Settings for Diffuse and Normals
« Reply #1 on: Jun 02, 15, 02:02:27 PM »

The diffuse maps in the engine store color information. The normal map, or bump plus spec, hold directional information about the normals of the surface. Hope that helps!


  • General Accounts
  • *
  • Posts: 18
    • View Profile
Re: Texture Settings for Diffuse and Normals
« Reply #2 on: Jun 02, 15, 04:21:21 PM »

The diffuse maps in the engine store color information. The normal map, or bump plus spec, hold directional information about the normals of the surface. Hope that helps!

I know that diffuse store color and that normal maps are the 'bump' map + spec (by default in HE).  That is fundamental texturing, but what I'm asking is more involved and specific.  As it stands, you can also have an Alpha channel in your diffuse texture.  If a file is saved as DXT5 with an alpha channel for the terrain textures, the alpha 'masks', portions of your diffuse texture and they become transparent.  I'm asking if there is a way to alter this performance (through a shader perhaps) to have the Alpha channel of the diffuse be a parallax map for the texture instead.  Hero Materials lets you accomplish this task, but I see no such functionality for the terrain.

If you look into Hero Materials, you can save several different types of "texture maps" into the alpha channel of the diffuse - such as parallax/bump maps for your texture.  This can be used in combination with a 'normal' map (another 'type' of bump map which has it's own set of alpha settings for spec,) which gives excellent results.  I was hoping that someone might help direct me to the shader that controls this, or give me some other information pertinent to my questions.

Here is some more information on the topic, as how it relates to normal mapping and other game engines:

How are normal maps used then?

This depends on the game. Although normal maps have 4 channels available for use; Red, Green, Blue (X, Y, Z) and Alpha, some games tend to use just two of them; the Red and Green ('X' and 'Y') channels (the alpha channel often used as a mask or filter to blend or remove image sections). This means the Blue channel ('Z') may not get used (partially or wholly); if we look back to the information above we find that this is the channel that often corresponds to 'depth / height' ('slope').

So instead of using the blue channel what's done in these instances is to make use of a separate 24 bit gray scale (black to white toned) image which provides a more detailed 'height' (bump) map; it 'replaces' the information that would otherwise be contained in and subsequently read from an images blue channel. This height maps is then combined back in game with the normal map using any extra settings that might be added via the interpretation of 'shaders' (extra calculated depth for instance).

    Design note: There are several advantages to doing this;

        Better control over how the combined textures looks in game - textures can be easily tweaked with just a line or two of text rather than having to reedit the original source files.

        Tonal gray scale' range increases which allows greater 'macro' detail to be shown, especially at the higher texture resolutions. This is due to the separate height map image actually being in 24 bit (RxGxB - 8x8x8 bit) rather than just a single 8 bit colour image; in a 24 bit image each 8 bit channel has 256 shades of gray (in the case of a height map) so when you add them all together you get greater and greater tonal detail and colour range, even with a pure gray scale tonal range.

Very few games actually utilise normal maps in this way now, preferring instead to simply make use of the full range of available channels contained in an image for in game surface texture rendering. This is how Oblivion uses normal maps, it utilise the blue channel.

    Design note: It's important to note here that although other normal mapped games may not use the blue channel, as mentioned above, the channel itself may actually have 'data' in it; this basically means the data is generally being ignored (not used) by other game engines and renderers; the blue channel is rarely completely 'blank' (contains no data other than a flat uniform blue).

    Because Oblivion is using the blue channel it means it won't ignore the data it finds there; it's part of what Oblivion uses for the games 'parallax mapping' - the other part being the alpha channel of the diffuse image, along side the math involved, it's where the method gets it's height information from (as opposed to a separate gray scale images as mentioned above).


Where do Oblivion's parallax maps come from then? ^

So now we know what normal maps are that Oblivion actually uses then in the same way as any other game to add a sense of depth to surfaces in game we can now answer the open question of just where does Oblivion's parallax mapping come from.

The answer is that Oblivion's 'parallax maps' do not physically exist as separate 'maps' in the same way that other physical media does for the game engine (wall_d[iffuse].dds, wall_n[ormal].dds, etc.), its actually a specific utilisation of a texture channel that's present on another image, namely the alpha channel on the diffuse image (the "A" of the "RGBA" mentioned above); effectively the available 256 tones of black/white available in the 8 bit alpha channel are interpreted by the engine in such a way as to 'boost', or 'parallax', the sense of depth already present in the normal map. In layman's terms, that's all parallax mapping is doing in Oblivion, just boosting the sense of depth already present.

    Design note: as mentioned in the above, Oblivion's parallax mapping is not a technically correct implementation of 'true' parallax, it's an approximation of parallax's main feature - additional visual depth.

So Oblivion's parallax system consists of two components;

    Normal maps - actual physical media

    Parallax 'maps' - alpha channel present other media (diffuse image)

Hope this helps!

-- EDIT --
I just remembered... we can also put 'heightmap' parallax bump maps in the Alpha of the Normal in SpeedTree to get the most out of your Caps and leaves normals.  This is slightly different than the above mentioned parallax map in the alpha of the -diffuse-, but it functions the same way.  Your own HE test files have these 'bump' maps in the normal as well for your caps.
« Last Edit: Jun 02, 15, 11:03:54 PM by McIndus »