SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 12-16-08, 09:25 AM   #1
danlisa
Navy Seal
 
danlisa's Avatar
 
Join Date: Oct 2005
Location: Cornwall, UK
Posts: 5,499
Downloads: 45
Uploads: 1
Default [TUT] Bump mapping for SH4 in GFX Suites

A parting gift!

PDF Version of this - http://files.filefront.com/SH4+Bump+.../fileinfo.html

This is primarily for Imported items.

For the purpose of this write up:

The Colour Map/Base Texture will be referred to as the Normal,
The Bump/Height map will be called Bump and then,
The Light/Shadow Map will be referred to as the Occlusion.

Primarily this document will tackle the creation & editing of SH4’s Bump maps with a view of allowing porting of SH3 vessels.

Firstly, anyone creating Ships, Aircraft & Subs from scratch will benefit from creating their respective maps from within their 3D modelling suite, if you are proficient enough to create models then you should be able to render a full set of maps.

So we know what we’re all talking about, the Normal map is the .dds file that holds all the colour texture. An example of this is NBB_Yamato_T01.dds:



The Bump map for this vessel is NBB_Yamato_N01.dds:



The Occlusion Map for this vessel is NBB_Yamato_O01.dds



While we have the Occlusion Map in our minds, it is worth noting that it holds an Alpha Channel. This Alpha Channel is a duplication of the Normal Map. As shown below:



We’ll talk about how to add this detail in later. Although, currently I am unsure how SH4 uses this. We’ll add it for completeness.

To generate Bump maps for imported SH3 models, we’ll need a Photoshop Plugin from Nvidia. There are various tools available from other software developers but I work & prefer Photoshop, also dang it, I paid for CS4, I want to use it.

You will need to install this plugin from the Nvidia website : http://developer.nvidia.com/object/photoshop_dds_plugins.html

Once you have done this we can begin.

I’ll continue to work with the file set from the Yamato as we will have SH4 Dev created version to compare our to.

Generating the Bump map from the Normal Map:
Open the NBB_Yamato_T01.dds in Photoshop, using ‘Load Default Sizes’ when the popup prompts you.

With the Normal Map at full resolution you can see that it’s actually very ‘dirty’. This presents us a small problem as the method we are about to use will generate a Bump map from the virtual High & Low points on the Normal Map. These High/Low points are decided by their virtual colour depth.

If you compare the Normal Map with the Dev version of the Bump Map, you can see huge differences. Here’s the Dev Bump Map with the Red & Blue Channel highlighted:



You can clearly see that the Normal Maps have been retouched after the generation of the Bump map.

The easiest way to accomplish this ‘clean’ generation of a Bump map is to recreate your Normal map using only Black & White to allow the generation of High & Low points for the Nvidia plugin to use.

Remember, SH4 uses White as the Low Point and black as the High point. Grey can be used for a Neutral height.

For the purpose of this tutorial, I’m not gong to mess about recreating the Normals in Black & White levels but rather demonstrate a way to ‘muddle’ though using Channel Mixers and Negative Filters. It won’t be perfect but if you want perfection, you need to go the long way and start from scratch.

Ok, using the Yamato Normal Map, we need to edit this texture so that the High/Low points are accented so that the Nvidia Plugin can use that information. Remember we are trying to get Low points as White and High points as Black.

Step 1) Either use the Black/White filter adjustment or use the Channel Mixer in the Layers palette. I assume you know how to do this.



With the Channel Mixer active:



Step 2) Now Merge the Visible Layers. We do this because the Bump Map generation will only work with ‘flat’ images.

Step 3) (Optional) Use the Contrast or Exposure adjustments to further accent your Black & White levels. I did:



Now, if we generated a Bump Map from this image, our High/Low point will be reversed. We need to invert our image, I find using the Negative adjustment to accomplish this works best as it allows more control by using the Curves option:



Step 4) Use the Nvidia Filter to generate the Bump map. Filter > Nvidia Tools > NormalMapFilter.

Use these settings:



If memory serves, you must Invert the Y axis during creation otherwise some very strange lighting/shadows will occur when viewing at angles.

Click OK!

Now, you should notice two things.

Firstly, how ‘dirty’ and undefined the Bump map looks. This is where a ‘clean’ Normal Map comes into it’s own. If you take the time to create one you will get much better results.

Secondly, the more observant of you may have noticed that it looks nothing like a SH4 Dev Normal. Ah you say, mines Bluish Purple but theirs is Green, why’s that? Well, I’m unsure as to the reason but the Sh4 Devs swapped the Blue & Green Channels. You must do this as other wise your in game model will display some very strange colour traits.

For completeness, here’s the method to swap the Channels over.

Arrange your workspace so that you can see the Bump Map and the Channels Palette, like so:



Click on the New Channel button at the base of the Palette. This will create a layer called Alpha Channel.

Now click on the Green Channel, the go Select > All. This creates a selection around the Green Channel. Now go to Edit > Copy. The Green Channel is now copied.

Click on the Alpha Channel to make it the active layer and then go Edit > Paste.

Your Bump Map & Channel Palette should now look like this:



Now click on the Blue Channel to make it the Active Layer.

Go Edit > Copy. Then Click the Green Channel and go Edit > Paste.

Your workspace should now look like this:



Now, click on the Alpha Channel to make it the Active layer. Go Edit > Copy.

Click on the Blue Channel and go Edit > Paste.

Now, drag and drop the Alpha Channel to the Bin at the bottom of the Palette.



Your Bump map now resembles the Sh4 Dev version. Well Done! (You may notice that Port Holes are reversed in relation to the Dev versions but this makes little difference ingame. You can achieve the same result if making your Normal Map for Bump generation by hand.

To save your new Bump Map, use these settings:



Using the shown format will result in a more accurate and better defined .dds file after the tool has compressed your finished file.

This ends the Bump Map creation tutorial. You may have to enable the vessels dat & roster cfg files to accept the additional files but I’ll leave that to your or others.

Finally, do you remember that at the beginning of this tutorial I mentioned the Alpha Channel that was embedded within the Occlusion Map. We’ll now discuss how to achieve those results. It’s rather easy as you have already done the basics by doing the Bump Creations.

Open NBB_Yamato_O01.dds & NBB_Yamato_T01.dds in Photoshop. For the purpose of this tutorial I have deleted the Alpha Channel in the Occlusion Map already.

Step 1) On the Yamato Normal map ensure that you have the Channels Palette open.

Step 2) Hold down CTRL and click on the Blue Channel. This creates a selection on the blue channel as so:



Step 3) Go Edit > Copy

Step 4) Make the Occlusion Map the active workspace. If you deleted the existing Alpha Channel as I did, create a new Channel, make it the active channel by clicking on it and then go Edit Paste. Enable all the Channels by clicking on the RGB channel. You should see this:



The same as the one first shown at the beginning of this document.

Step 5) Saving! As this .dds has an Alpha Channel we need to use a different format to save this and retain the information we just added to the Occlusion Map.



Using this format allows for both greater clarity/detail while retaining the Alpha information. Please note that you could use any of the Channels from the Normal map within the Occlusion map, I have noticed no difference ingame.

I hope this helps.

This is a quick and dirty way to generate these files for imported vessels. I don’t propose that this is the best way but it works.

The terminology I have used may not be industry correct but I hope it was easy to understand for everyone.

This document was produced for the betterment of the Sub Sim community. Take it as it was meant.

Goodbye.
__________________
danlisa is offline   Reply With Quote
Old 12-16-08, 10:57 AM   #2
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Hi Danlisa, thanks for the tutorial, good job.

Some remarks:
- the alpha channel of the AO texture is actually a 'specular mask'. You can see evidence of this in the SH4-shaders (I've investigated this for the upcoming S3D icw. texture support). The specular mask however can also be in the alpha channel of the base texture (if this doesn't need the alpha channel!), and this difference is indicated in the UnifiedRenderControler where you have the option UseSpecularFromDiffuse (yes/no), where no implies to use it from the AO-map.

Here's another good specular map tutorial: http://www.wonderhowto.com/how-to/vi...-max-8-196435/

- the green/blue channels are swapped because the game also has two axis swapped (YZ), or at least, that's what I guess. It makes more sense to swap the values in the textures, then do it in the shader at the expense of cpu-cycles.

I think it's a decent way to get bumpmaps for low poly models, but it is not as good as generated normal maps from high poly models (although this may not give the desired result from the get-go either). That said, we don't have access to alot of older (SH3?) high poly models, so it's good to know this method.


[edit] As an aside to those interested in this subject, take a look at this thread I made a year ago:

http://www.subsim.com/radioroom/showthread.php?t=126436

It's not a tutorial, but does describe all the different maps and shows them applied to the Yamato in different stages.

Last edited by skwasjer; 12-16-08 at 11:16 AM.
skwasjer is offline   Reply With Quote
Old 12-17-08, 04:31 AM   #3
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by skwasjer
...
Some remarks:
- the alpha channel of the AO texture is actually a 'specular mask'. You can see evidence of this in the SH4-shaders (I've investigated this for the upcoming S3D icw. texture support). The specular mask however can also be in the alpha channel of the base texture (if this doesn't need the alpha channel!), and this difference is indicated in the UnifiedRenderControler where you have the option UseSpecularFromDiffuse (yes/no), where no implies to use it from the AO-map.
...

...
and skilled modders can create bump map manually (as variant withoit Hi-Low poly) ...
using Photoshop and Emboss filter ... you can create two images with different corners (one of variants!!! ... differ. = 100° (80° ... 100°))
and other parametres of the filter and then copy these two images into Red and Blue channels or in others ...
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 12-18-08 at 07:22 AM.
Anvart is offline   Reply With Quote
Old 12-17-08, 06:02 AM   #4
kriller2
Ace of the Deep
 
Join Date: Apr 2005
Posts: 1,227
Downloads: 19
Uploads: 0
Default

Quote:
Originally Posted by Anvart
Quote:
Originally Posted by skwasjer
...
Some remarks:
- the alpha channel of the AO texture is actually a 'specular mask'. You can see evidence of this in the SH4-shaders (I've investigated this for the upcoming S3D icw. texture support). The specular mask however can also be in the alpha channel of the base texture (if this doesn't need the alpha channel!), and this difference is indicated in the UnifiedRenderControler where you have the option UseSpecularFromDiffuse (yes/no), where no implies to use it from the AO-map.
...

...
and skilled modders can create bump map manually (as variant withoit Hi-Low poly) ...
using Photoshop and Emboss filter ... you can create two images with different corners (one of variants ... differ. = 100°)
and other parametres of the filter and then copy these two images into Red and Blue channels or in others ...
Yep! that was how I made the bumpmaps for the "Warships retextured" and the PE project, it may not be 100% correct but it does the job.

Thanks for the tutorial Danlisa It's nice to see you care about the community and are trying to help the modders in the right direction.

..And Skwasjer your wisdom about these things never stops to amaze me
__________________
Kriller2.
[MODs]

Real Environment mod

and Pacific Enviroments 4 mod

Last edited by kriller2; 12-17-08 at 06:05 AM.
kriller2 is offline   Reply With Quote
Old 12-17-08, 07:14 AM   #5
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

thanks a bunch ! I will now try and make one for my Jyunsen B for starters



Keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 12-18-08, 07:26 AM   #6
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

...
and can try: http://shadermap.renderingsystems.com/
http://crazybump.com/forum/index.php
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 12-18-08 at 07:37 AM.
Anvart is offline   Reply With Quote
Old 12-18-08, 06:50 PM   #7
cheese123
Gunner
 
Join Date: Dec 2007
Location: on some striat
Posts: 96
Downloads: 1
Uploads: 0
Default

I don't understand, I followed the tutorial and I still get this weird result, one side of the ship is normal with bump maps:


And the other side looks like this:

Might be the lightmap.

Any tips appreciated.

Last edited by cheese123; 12-18-08 at 09:18 PM.
cheese123 is offline   Reply With Quote
Old 12-19-08, 03:13 AM   #8
danlisa
Navy Seal
 
danlisa's Avatar
 
Join Date: Oct 2005
Location: Cornwall, UK
Posts: 5,499
Downloads: 45
Uploads: 1
Default

@ Cheese123

Let's see your 3 texture files. You are probably right, the Occlusion map maybe at fault. How did you generate it? 3ds Max? or similar?

The first thing that stands out (and this will be unique to all imported vessels & skins) is that the camo scheme, which is applied to the Normal/Colour map in SH3 is NOT implemented in the same way in SH4. Camo & Colouring must be applied to the Occlusion (light) map, otherwise, as with your screengrab, you'll see that the hull stripe has been bumped. Alternatively, is you think about it before, generating the Bump map from the Normal before a camo/colour scheme is added might also work.

To correctly import SH3 models into SH4 (to an SH4 standard) requires knowledge of either Photoshop texture creation or Max/Maya Bump/Occlusion rendering (to texture) from a lit model. However, in this instance, the only way to create an Occlusion map is to render one from a 3D Suite. Once you nail the process down it's quite easy. For additional added effect, render a Light & Shadow map and then merge them, the final result will be better than each individually.
__________________
danlisa is offline   Reply With Quote
Old 12-19-08, 03:59 AM   #9
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

Quote:
Originally Posted by danlisa
@ Cheese123

Let's see your 3 texture files. You are probably right, the Occlusion map maybe at fault. How did you generate it? 3ds Max? or similar?

The first thing that stands out (and this will be unique to all imported vessels & skins) is that the camo scheme, which is applied to the Normal/Colour map in SH3 is NOT implemented in the same way in SH4. Camo & Colouring must be applied to the Occlusion (light) map, otherwise, as with your screengrab, you'll see that the hull stripe has been bumped. Alternatively, is you think about it before, generating the Bump map from the Normal before a camo/colour scheme is added might also work.

To correctly import SH3 models into SH4 (to an SH4 standard) requires knowledge of either Photoshop texture creation or Max/Maya Bump/Occlusion rendering (to texture) from a lit model. However, in this instance, the only way to create an Occlusion map is to render one from a 3D Suite. Once you nail the process down it's quite easy. For additional added effect, render a Light & Shadow map and then merge them, the final result will be better than each individually.

occlusion map tutorial (requires 3D Studio) :

http://www.subsim.com/radioroom/showthread.php?t=136354
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 12-19-08, 09:18 PM   #10
gimpy117
Ocean Warrior
 
Join Date: Jul 2007
Location: Kalamazoo, MI
Posts: 3,243
Downloads: 108
Uploads: 0
Default

Quote:
Originally Posted by cheese123
I don't understand, I followed the tutorial and I still get this weird result, one side of the ship is normal with bump maps:


And the other side looks like this:

Might be the lightmap.

Any tips appreciated.
okay...who spilled white paint on my beloved Bismark??!!
__________________
Member of the Subsim Zombie Army
gimpy117 is offline   Reply With Quote
Old 06-25-09, 07:31 PM   #11
runningdeer
Frogman
 
Join Date: Mar 2008
Location: Huntley, IL
Posts: 305
Downloads: 142
Uploads: 1
Default

Hi all.

I have no model to import. But...I am working on ways to improve my sub skins.

Could I use this tutorial to clean up one of the stock subs from v1.5?

Because when skinning a stock sub, the original (lightmap?) bleeds through.
I need a clean slate to work with.
Thanx all.
__________________


runningdeer is offline   Reply With Quote
Old 07-10-09, 02:39 PM   #12
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

another need be sticky...

keltos

or can't we make a directory with all the tutorials that help making a sub ?
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 08-14-09, 04:24 AM   #13
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

bump !

fitting term for a bump map
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.