Star Destroyers? Star Destroyers. And bump maps.

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Phraggah
Posts: 29
Joined: Fri, 30. Mar 12, 05:54
x3ap

Star Destroyers? Star Destroyers. And bump maps.

Post by Phraggah » Mon, 7. May 12, 01:50

So after seeing like, thirty "Are there Star Wars ships :? " threads I decided to take a go at it.

I'm starting off with a Star Destroyer rolling through a fleet of Xenon ships with it would be flippin' awesome.


Anyway, I'm not an expert at Max by any stretch of the word, I do have a good amount of experience working in a 3d environment and creating content for other game engines.

(Thumbnails)
[ external image ]

I think it looks pretty good all things considered.

[ external image ]

I was thinking I must have been reaching the polycap of not-laggyness but then I opened up the Colossus and found out that it had like 30k polys so I'm probably going to add more detail to the mesh.



I do have a few questions for more veteran modders, though.


I've got the thing in game, but it looked a little flat so I made a bump map.

[ external image ]

I know Photoshop like the back of my hand so it wasn't hard. Not bragging or anything. :sceptic:

But I put it in game and it did nothing. Literally nothing. So I say to myself "Great..."

I open up some of the bumpmaps from the game to see whats up, and they don't use nvidia's texture filter. I'm a little confused so I just take off the filter.

[ external image ]

Wow, that was easy. I'm so good at this already I've only been modding for like two weeks and I'm alr--







[ external image ]


Oh god what's going on I'm no good with computer... @_@


So there are a few things going on here:

1. What the deal with normal maps in this game?
2. See how some of those lights are so blindingly bright? What's the deal with that! When the face has light reflecting on it, it shines worse than looking at the bloom effects in a modern-gen FPS game in a room with no light. Is there a different shader/property I can use to tone it down?

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Mon, 7. May 12, 03:41

First off that bump map isn't so bad, you need to rename it to *_low_bump.dds though.

The game uses 4-5 common textures per actual texture.

Example textures to explain below better. Normal size of textures is between 512x512 and 2048x2048, I reduced to 256x256 to reduce file size.
Images for Tutorial

First obviously is the "*_diff.dds" texture, but I'm sure that's ok. It doesn't need full detail, but sometimes a combined texture gives a better result for diff than the usual flattish texture. No alpha channel is used.
[ external image ]

Second is the "*_bump.dds" texture which is different from a usual bump map. It has a single angle of the normal map from the DDS normal map filter (the Red channel) in the position of R, G and B. It has the G channel of the Normal map as the Alpha channel (saved as either RGBA 8888 or DXT5 for compressed).
RGB:
[ external image ]
Alpha:
[ external image ]

Third is the "*.low_bump.dds". This is basically a toned down normal map. Usually the blue channel is either deleted or reduced heavily in intensity. However to get the right balance you'll have to play about with it. I use Crazybump to get the blue channel sometimes as it creates a lower intensity than the DDS filter does, allowing the high intensity R and G channels with a lower B channel. There is NO Alpha channel on the low bump.
[ external image ]

Fourth is the "*_spec.dds". This helps with reflected light and from the images above looks very similar to the greyscale bump map you made. It has a high black/white contrast with no alpha channel denoting how light will be handled.
[ external image ]

Fifth is the "*_light.dds". This is the second texture with an alpha channel. The alpha is used to denote the intensity of the light with the RGB denoting the colour.
RGB:
[ external image ]
Alpha:
[ external image ]


There are a couple of other textures used but those are the main ones for ships.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

Phraggah
Posts: 29
Joined: Fri, 30. Mar 12, 05:54
x3ap

Post by Phraggah » Mon, 7. May 12, 07:09

TrixX wrote:words
Welp, that definetly answered my questions. Thanks for the awesome explanation.

One thing: does X3's engine use filenames to differentiate between different maps and not the modeling program's material settings? I realize all games have different ways of handling materials and most don't export them from the host modeler, but then what's all the MAT6 junk in the bod files then?

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Mon, 7. May 12, 08:03

Yes, hence the ending being "*_<texture type>.dds" (without quotes of course).

I dunno if anyone ever posted up the info about textures so I thought it would be good to have it for all :)
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Mon, 7. May 12, 16:17

you can name your different maps however you want, the paths for each map is entered in the material seperately.

If you use the Photoshop Nvidia Plugin you just have to save your normalmap as DDS DXT5 NM and it will automatically generate the file with R-Channel as Pic and G as Alpha.

About the low_bump - no idea what this is supposed to, but i have never seen a direct path to it and bumpmaps work fine without low_bump. After all there is no reason to use a normal without blue channel if you already have the same information with the standard bump map.
I advice you to use a power-by-2 map in both directions (512², 1024² etc), otherwise Mipmaps ("texture lod") might not work so well.
I was thinking I must have been reaching the polycap of not-laggyness but then I opened up the Colossus and found out that it had like 30k polys so I'm probably going to add more detail to the mesh.
Colossus is a X3R ship, they are very optimized. Other M2 ships /models in X3TC have up to 80k - and it's not a big deal. Just make sure you don't actually waste polygons on something that doesn't need so many. 50k is a good level for a M2 sized ship.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Tue, 8. May 12, 00:58

Thanks for the clarification on the naming KJ. I was also kinda confused why there is a bump and a low bump when the essentially hold the same information :lol:
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

Phraggah
Posts: 29
Joined: Fri, 30. Mar 12, 05:54
x3ap

Post by Phraggah » Wed, 9. May 12, 02:52

TrixX wrote: It has a single angle of the normal map from the DDS normal map filter (the Red channel) in the position of R, G and B. It has the G channel of the Normal map as the Alpha channel (saved as either RGBA 8888 or DXT5 for compressed).

After trying a few times I'm getting confused here again. You're saying that X3's engine interprets the R channel as depth, right? Then G is alpha? Alpha of what, the normal map? Why would it need an alpha if it already has depth? Then is B not used?

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Wed, 9. May 12, 07:14

Basically you start with a normal map. You take the R channel it has and copy that to the main RGB channels on a new canvas. On that new canvas you create an alpha channel (sometimes you'll need to import a DDS with one already in it to allow it to be saved as DDS, just clear the image already in both the RGB and Alpha channels). From the normal map just select the G (Green) channel and copy only that channel's data over to the Alpha channel of the new canvas.

This should leave you with the correct setting for the bump map for X3.

KJ's method is faster though :D
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Wed, 9. May 12, 11:50

You're saying that X3's engine interprets the R channel as depth, right? Then G is alpha? Alpha of what, the normal map? Why would it need an alpha if it already has depth? Then is B not used?
The alpha off this bumpmap is not an alphamap that is used for transparency. The base image is used to determine the "highlights" from left to right iirc. The information in the alpha is used for getting the top to bottom highlights. So in combination you have a standard normalmap. Don't ask me why they used this way.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”