[TUTORIAL] How to make LoG2 Normal Maps

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

[TUTORIAL] How to make LoG2 Normal Maps

Post by Leki »

Here is a short tutorial, how to make valid normal maps for your custom models:

After several tests with custom models, I concluded that LoG 2 engine uses FS2_Open Shader. It means, you have to change your normal maps making pipeline to get propper results.
Following tutorial is reposted important part from here, by Herra Tohtori.

FS2_Open shader system uses a set-up where it reads the green channel and alpha channel of an image for u/v co-ordinate normals data. Red and blue channels are completely ignored. This is called normal map-style DDS file, and the most common format is dxt5nm since it takes advantage of the awesome dxt5 compression. However you shouldn't be too confused by the -nm suffix in the file type; the file is a normal DXT5 file with some channel management to take care of the normals information being in the correct channels.

When you save into FS2_Open-usable normal map, you have two options.

First way, which I prefer:
step 1 - manually copy red channel to alpha channel (in Photoshop go to Channels, add new chanel (it's Alpha), CTRL+click on Red channel, then select alpha channel and paste)
step 2 - manually fill red and blue channels with black, which reduces the amount of information that the DXT compression needs to store, to some extent.
step 3 - save as DDS file that has full alpha channel --> DXT5, (not DXT5nm since it will just ruin your channel management with it's own and you end up with bad file).


GIMP Tutorial is here.


Second (untested) way is to save the purplish normal map into DXT5nm compressed file with a DDS plugin, which does the trick in the sense that FS2_Open should be able to read the file. This file will indeed look like a grayscale (with some transparency) since most DXT5nm saving procedures move the red channel into alpha channel and copy green channel to red and blue channels to make an uniform RGB image. If you're just starting, it might be easiest to just use this method at least while you're getting your normalmapping technique itself sorted out. To be honnest I'm not 100% sure if saving in DXT5nm works in right way.

And one more important note: You may be frustrated as I was, until you find that Editor must be fully restarted (forget CTRL+R) to load new textures. I spent a lot of time making different normal maps filles, including object space versions etc, without ingame effect, until I found this 'great editor feature' (glosines material definition without ingame effect helped me to find this bug)

For more info, you can read this article: http://www.bencloward.com/tutorials_normal_maps9.shtml
Or if you are making normalmaps from diffuse textures, do it in right way: http://www.katsbits.com/tutorials/textu ... images.php


Last edited by Leki on Thu Nov 13, 2014 10:19 am, edited 2 times in total.
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Doridion »

Wonderfull, as usual ! Sticked in the superthread !
User avatar
Lark
Posts: 178
Joined: Wed Sep 19, 2012 4:23 pm
Location: Springfield, MO USA

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Lark »

I'm pulling my hair out again. Can someone assist with making a normal map in Gimp or other free software? I've never done 3D modeling before, but I think I have everything working except for the normal map. I have one made with Gimp but I think I need to swap the red channel into the alpha channel (and likely fill the red and blue channels with black as advised to save space), but I can't find a way to do that. I've read everything I can find that appears pertinent, and I'm stuck. Thanks, -Lark
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Doridion »

Lark wrote:Can someone assist with making a normal map in Gimp or other free software? Thanks,-Lark
Tsss, tsss, tsss .. Lark, I though you'd have read better leki's post ^^ This part is really interesting :
Leki wrote:For more info, you can read this article: http://www.bencloward.com/tutorials_normal_maps9.shtml
And in this interesting link, you got the "PART II - page 3: Methods for Creating Normal Maps" :p

Yep, assets definition's also tear my hairs out .... but I made a break and strangely, my brain came back :D
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Leki »


Actually it's easy to google it if you know what you are looking for.

Making normalmap in GIMP:

SpoilerShow

Following FS2_Open Normalmap GIMP tutorial is important part of this article:

GIMP offers a pretty nice way to do this. As you have your purple normal map in sight, you will need to first add an alpha channel to the image [Layer -> Transparency -> Add Alpha channel], then Decompose the image to RGBA colourspace components:

SpoilerShow
Image

Remember to select RGBA from the dialogue that opens, and it will split your normal map into four grayscale layers, one for each channel.
Copy Red channel information and paste it to Alpha channel. After that, select black colour and fill both Red and Blue channels with it. Then, Compose the image [Colors -> Components -> Compose], remember to select RGBA for the color model again, and you should be seeing something like this:

SpoilerShow
Image

Now, when you are seeing this kind of result, you should be able to simply save it to any alpha-channel inclusive format, and FS2_Open should be able to use it as normal map.

Last edited by Leki on Thu Nov 13, 2014 11:14 am, edited 1 time in total.
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Phitt »

I'm not sure if the GIMP plugin creates different normal maps by default than the nVidia Photoshop plugin, but with the nVidia plugin using default settings you need to invert the green channel (or export with y inverted), then copy the green channel into the alpha channel, copy the red channel into the green channel and do the rest as you described. Otherwise the lighting on the normal map is off (tested that using a one color diffuse texture and a bumpy normal map with a single light source coming from one direction to see if the shading was correct).
User avatar
Lark
Posts: 178
Joined: Wed Sep 19, 2012 4:23 pm
Location: Springfield, MO USA

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Lark »

Leki wrote:
Then, Compose the image [Colors -> Components -> Compose], remember to select RGBA for the color model again, and you should be seeing something like this:
Thanks everyone for the help, and chastisement (Doridion :)). I'd figured out everything except I missed the above: I kept trying to Google swapping channels in Gimp and never found the Decompose/Compose features. I finally took my brain out of the cellophane (and got more sleep) and now I have a good normal map! Hey, I've learned a lot in less than a week! 8-)

Thanks Everyone! -Lark
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Batty »

Very helpful thread, thank you Leki & Phitt. :)

I compared the altar in LoG1 and the same altar imported into LoG2 with different normal map treatment. This was done in GIMP.

#1: The altar as it appears in LoG1.
#2: Same altar but in LoG2 with normal map exported as DXT5nm. OK, but look at the cracks and relief, they appear flattened and indented. I also tried the first method of copying the red channel to alpha channel and filling red & blue channels with black then exporting as DXT5 and the altar looked the same as this one (I was sure to restart not reload).
#3: Phitt's method, I inverted the green channel, copied the green channel to alpha channel then copied red channel to green channel and exported DXT5. Now look at the cracks and relief, they are correct as in the LoG1 example.

These were setup in the exact same scenes, a 3x3 with one torch on the wall and one torch in hand. The altar in LoG1 example appears smaller than the two LoG2 examples because the viewing angle is different between the two games.
SpoilerShow
Image
Image
Image
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by AdrTru »

I found simple way to recreating normal maps for LOG2.
I use MindTex program ( in steam library ) - this soft isnt free but I have it.
In this soft is setting for saving image and I set it this way: RGBA - 0;N.g;0;N.r

For me is coversion dividet to two steps : open normal map and save normal map :)

EDIT:
but textures created in Mindtex have big size. I use Paint.net for size reduction after.
Last edited by AdrTru on Tue Mar 17, 2015 6:57 pm, edited 1 time in total.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: [TUTORIAL] How to make LoG2 Normal Maps

Post by Eleven Warrior »

AdrTru wrote:I found simple way to recreating normal maps for LOG2.
I use MindTex program ( in steam library ) - this soft isnt free but I have it.
In this soft is setting for saving image and I set it this way: RGBA - 0;N.g;0;N.r

For me is coversion dividet to two steps : open normal map and save normal map :)
Dammmmm wish I found this software I would not have hassled Batty as much, but in saying that Batty was a huge help for me and I want to continue working with him on other conversions :)
Post Reply