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 05-06-08, 04:15 AM   #1
rodan54
Navy Dude
 
Join Date: Oct 2006
Location: California, USA
Posts: 176
Downloads: 4
Uploads: 0
Default [TEC] Ambient Occlusion Tutorial

This, hopefully easy to understand, tutorial is meant to allow prospective and current SH4 modelers a means to create those tricky Ambient Occlusion texture maps for their future shipping releases.

Anyhoo, before getting started I just want to make a few notes.

1. This was all done in 3dsmax 9, so methods in other modeling suites may vary.
2. This is done using a completely original Mesh, so don't assume that it works in the same way for modded/kitbashed stock ships although I'd imagine it'd be pretty similar.
3. I haven't spent too much time adjusting the various parameters mentioned throughout this tutorial, so feel free to experiment.
4. Finally, I don't claim to be literate with 3dsmax in anyway shape or form, and am still slowly learning; therefore, if there are any errors, ommissions, or perhaps better methods than what is desribed here, then please do say so.

----------

Lets begin.

1. First of course you'll need to load up your model into max. Once that is done then navigate along the top menu bar to 'Rendering', and click on 'Render' in the roll down menu. This will bring up the 'Render Scene Dialog'. Now under the 'Common' tab navigate all the way down to the bottom and expand out the menu with the header 'Assign Renderer', click on the box next to 'Production' and select Mental Ray as the rederer. Click "Ok" and close out the 'Render Scene Dialog'.



2. Alright now with your ship selected, go back to the 'Rendering' menu list and select 'Render to Texture' which will open a new menu. For this perticular example my Tone model was not uv mapped, so in the 'Mapping Coordinates' section I have 'use automatic unwrap' checked which will generate new uv coordinates to be used by the Ambient occlusion map.



3. Just below the 'Mapping Coordinates' section is the 'Output' roll out in which you'll want to add an 'Ambient Occlusion (MR)' from the list of available options that opens up.



4. Once that's done then scroll down a bit more, and set the maps size for 1024x1024. In addition set the number of samples to 80 and spread to 1.0 in the 'Selected Element Unique Settings' section. Also under 'Automatic Unwrap Mapping' set the spacing to 0. Leave everything else as is and click 'Render'.



5. It might take a little while for max to compute all the numbers, so go get a cup of coffee while you wait. Once max is done rendering, and if you followed the tutorial properly then there will be a texture at the location specified previously under 'General Settings' in the 'Render to Texture' menu that should look something similar to this.



Hmm, not too bad.
Here's the Tone with ^ applied. And yes she is a WIP just in case anyone felt like pointing out her missing anchors.



----------

Last edited by rodan54; 05-06-08 at 03:36 PM.
rodan54 is offline   Reply With Quote
Old 05-06-08, 04:33 AM   #2
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default waow

just what I was missing ! will post image when my Jyunsen B is rendered

damn ! I have to redo the conning tower now

thanks a lot

there goes what I've done :


is it normal that the option "ambiant occlusion mR" disappears from the menu when it's rendered to file ?

here applied to the mesh :

[url=http://imageshack.us]
__________________
"Honorable Builder of Sinking Ships"


Last edited by keltos01; 05-06-08 at 08:56 AM.
keltos01 is offline   Reply With Quote
Old 05-06-08, 04:54 PM   #3
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Does the 2nd map channel in S3D show you the correct uv map in the preview window? It sounds like the uv coordinates aren't right. If they are right though, then I'd like to have a look at the .dat.

Oh, and you may want to check if SelfOccEnable is true in the UnifiedRenderControler.
skwasjer is offline   Reply With Quote
Old 05-06-08, 06:40 PM   #4
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

The model is fine. But the problem you are having may be the key to some hidden data in the material chunk. I will want to investigate this further, but to do this I will need a ready to use mod with this dat-file. Do you have a testmod available for me, or can I just pick your current public release with this dat? I have been guessing for a long time about the remaining few bytes of materials (and am almost sure about some, just not 100%), and would like to find out.

One other thing I do notice is the node order. The 2nd material splits the first material. You may want to first try if moving the label and illum chunk directly after the parent material does anything.
skwasjer is offline   Reply With Quote
Old 05-07-08, 11:05 AM   #5
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Hi Mikhayl, I've taken a look, and it's not a problem at all in the .dat. It's a problem with the texture. The artifacts you see in game are in fact not the ambient occlusion map itself (the AO map is rendered OK!), but the specular map that is rendered. I noticed this immediately because I only saw the artifacts when I moved the cam (iow. the angle vs the sun changed).

Then I looked at the O01 DDS, and there I saw indeed the AO map was also in the alpha channel of the texture, which is wrong. The alpha channel is reserved for the specular map. So, I copied a grayscale version of the T01 map (which is quick-n-dirty, you'd want to make a true specular map) into the alpha channel, and she rendered fine. This is the texture I used:

http://sh4.skwas.net/temp/NSS_Uboat2b_O01.rar

PS: You should also provide the extra mipmaps. You can choose this as an option when saving to DDS.
PS2: The AO map could use a little more detail.
PS3: The specmap uses the same uv-data as the diffuse map.

Last edited by skwasjer; 05-07-08 at 12:58 PM.
skwasjer is offline   Reply With Quote
Old 12-11-08, 02:50 PM   #6
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Punt for info.

Let's say you take an object from one ship (a carried boat, for example) and put it on another.

The occlusion map fouls up the way it looks where it is now. Do you need to export the ship plus the boat, then make a new o-map?
tater 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 07:25 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.