Malkior

Bump Mapping Research

Recommended Posts

@Darth Sapiens

 

Could you tell me what mode/filter in Photoshop to use in order to change it into a valid bumpmap, or is there a specific process? I would like to do some experiments, but can't connect to the internet with my home computer to compare your files.

Share this post


Link to post
Share on other sites

@Darth Sapiens

 

Could you tell me what mode/filter in Photoshop to use in order to change it into a valid bumpmap, or is there a specific process? I would like to do some experiments, but can't connect to the internet with my home computer to compare your files.

 

it only works on certain textures on certain models like the twilek head, the selkath, the rakghoul etc. but it needs to be greyscale / 8 bit with no alpha, if you look at the channels tab there should only be 1 channel (greyscale) as opposed to R G B and alpha it's called changing the color mode in photoshop. if you see my screenshots from my first "breakthrough post" it shows what i'm talking about. were trying to see how to make it available for all models, but it might be a while

Share this post


Link to post
Share on other sites

it only works on certain textures on certain models like the twilek head, the selkath, the rakghoul etc. but it needs to be greyscale / 8 bit with no alpha, if you look at the channels tab there should only be 1 channel (greyscale) as opposed to R G B and alpha it's called changing the color mode in photoshop. if you see my screenshots from my first "breakthrough post" it shows what i'm talking about. were trying to see how to make it available for all models, but it might be a while

Ah so I see. I was actually stuck on how I'd make my own normal map to work with the engine. I only have a very basic understanding of making bumpmaps (IE make a texture with black for lower areas and white for higher areas, then run the "normal map" filter over it) I just don't know if that's the right way to do it, or if it'll work.

 

Also I can't state enough how astounding this work is that everyone in this thread is doing. I'm confident that soon we will be able to add a feature into Kotor that was in early development when it first came out :)

 

Next up is ray-trace lighting and ambient occlusion ;p

Share this post


Link to post
Share on other sites

Ah so I see. I was actually stuck on how I'd make my own normal map to work with the engine. I only have a very basic understanding of making bumpmaps (IE make a texture with black for lower areas and white for higher areas, then run the "normal map" filter over it) I just don't know if that's the right way to do it, or if it'll work.

Also I can't state enough how astounding this work is that everyone in this thread is doing. I'm confident that soon we will be able to add a feature into Kotor that was in early development when it first came out :)

Next up is ray-trace lighting and ambient occlusion ;p

I can't wait til we decipher the remaining parts of the MDL, there are a few things we'll probably find. Right now, were stuck to redoing bump maps for already bumpmapped textures on certain models. Also our bump maps need to be greyscale to be valid, that means after you run the nvidia filter, you need to make it greyscale. As I said, we are unfortunately limited right now, but there is hope on the horizon. :)

Share this post


Link to post
Share on other sites

Funny, I've been learning to 3D model and how to create materials and the textures they require, and a while back, I finally realised the difference between (proper) bump maps and normal maps -- didn't realise that the pink normal maps were just interim ones though. Was going to test out a simple greyscale map to test it out in TSL but never quite did to due to work.

 

I think you will find that there is no need to run any kind of normal map filter first on the diffuse (color) map before changing it to greyscale -- of the few bumpmap greyscale textures in the game files, you will see that they are for the most part greyscale version of their diffuse counterparts. The game should generate a normal map from the diffuse. It's a similar thing with some 3D modelling applications and game engines like Unreal Engine 4. You can set it up so that a material will take a greyscale version of your diffuse texture, and from that, calculate the normal map from it.

 

Results aren't perfect, as really, you want to be able to have more power/influence on how the final normal map is generated; but still a lot quicker and easier if you don't have the tools to do so. Also as far as K1/TSL, using a greyscale image that has not been "normalized" prior to being made greyscale, means that you can then tweak other aspects of it like: brightness/contrast, shadows/highlights. These should then affect the end RGB normal map generated -- though, I'm guessing that there are limitations on what you can achieve, especially as it's not an RGBA normal map.

 

Cool to see the progress made to do with this -- one of the less understood parts of the game engine along with the model format. Interesting to see what else you guys uncover ;).

Share this post


Link to post
Share on other sites

@SelfInducedComa

 

Excellent!

 

I will test a few contrast tweaks and report my results. I currently have Kotor up, but with no way to run normal map filters ATM, so this is great news. :D

Share this post


Link to post
Share on other sites

Hmm, I can't get it to work with the Quarren for TSL.

 

Tried using a normal map filter -- not NVIDIA's, should make no difference as far as my knowledge of normal map filters go -- too before converting it to grayscale and it still would not work for me. Either it appears to have no effect or a prompt appears stating the bump map is invalid. Tried a bunch of TXI variants as well.

 

Have you guys mostly been testing with K1 or have you actually done this in TSL as well?

 

I ask in that the engine's aren't exactly the same in that one is OpenGL and the other is DirectX/OpenGL.

 

EDIT: oh, and not sure my previous statement about there being bump maps in the game files of either game that are simply greyscale images of the color diffuse maps; I recall coming across the odd one, perhaps in K1, but I can't find them so perhaps I am mistaken :/

Share this post


Link to post
Share on other sites

Hmm, I can't get it to work with the Quarren for TSL.

 

Tried using a normal map filter -- not NVIDIA's, should make no difference as far as my knowledge of normal map filters go -- too before converting it to grayscale and it still would not work for me. Either it appears to have no effect or a prompt appears stating the bump map is invalid. Tried a bunch of TXI variants as well.

 

Have you guys mostly been testing with K1 or have you actually done this in TSL as well?

 

I ask in that the engine's aren't exactly the same in that one is OpenGL and the other is DirectX/OpenGL.

 

EDIT: oh, and not sure my previous statement about there being bump maps in the game files of either game that are simply greyscale images of the color diffuse maps; I recall coming across the odd one, perhaps in K1, but I can't find them so perhaps I am mistaken :/

the water bump maps are gray scale, for both games iirc. Personally I've only been testing tsl but I did find an interesting bump map, that wasn't like the normal maps or grey scale maps, it's the bump map for the frozen acid effect from naga shadows tomb, when I get on my PC I'll post the texture, which is present in both games. I think that directx is used for sound functionality iirc. Opengl does the rendering. A good easy to tell way to test the bump mapping is on the male twilek head, try making the diffuse texture's alpha all black, then replace the bump map texture with greyscale, or don't call it at all in the diffuse' txi. The difference is really noticible. With no bump map its super apparent.

Share this post


Link to post
Share on other sites

the water bump maps are gray scale, for both games iirc. Personally I've only been testing tsl but I did find an interesting bump map, that wasn't like the normal maps or grey scale maps, it's the bump map for the frozen acid effect from naga shadows tomb, when I get on my PC I'll post the texture, which is present in both games. I think that directx is used for sound functionality iirc. Opengl does the rendering. A good easy to tell way to test the bump mapping is on the male twilek head, try making the diffuse texture's alpha all black, then replace the bump map texture with greyscale, or don't call it at all in the diffuse' txi. The difference is really noticible. With no bump map its super apparent.

 

Yeah, my comment about DirectX/OpenGL was more to do with Obsidian having made "improvements" to the engine; things like shaders. 

 

Anyway, I realised what my issue was, I had created a test folder within another folder inside of Override. Forgot that TSL will look within folders found in the Override folder, but, won't actually look at any folders nested within those.  :wallbash:

 

Seems to be working now, at least with the twilek_m01 set of textures. Looks like their normal map effect is heavily tied in with alpha and specular -- why the existing ones tend to look like shiny plastic. Still, probably can do some interesting things with it...

 

EDIT: if you mean the acid-ice texture set I think you mean (below) it does indeed appear to have what looks like to be a valid RGB normal map and not a grayscale image

 

plc_acidice.jpg plc_acidice2b.jpg

Share this post


Link to post
Share on other sites

Man, I was trying to give this a shot (with Darth Sapiens' twilek skins) but whenever I modified it, the bump mapping went away. I exported it as greyscale but no cigar.

Share this post


Link to post
Share on other sites

My test: The Tar-faced Twi'lek

UCPXXnj.png

 

As cool as that looks, it looks pretty weird with the skin (shiny, plasticy) and while I could see this being useful for shiny things (alien skin, metals), this will probably look terrible on human skin.

 

That said, maybe using a normal map with a less intense shine might help? idk

Share this post


Link to post
Share on other sites

My test: The Tar-faced Twi'lek

UCPXXnj.png

 

As cool as that looks, it looks pretty weird with the skin (shiny, plasticy) and while I could see this being useful for shiny things (alien skin, metals), this will probably look terrible on human skin.

 

That said, maybe using a normal map with a less intense shine might help? idk

Actually human skin can be replicated pretty well even with cm_baremetal, with a few noise filters and a less liberal approach to the shininess.

 

The biggest hurdle for me was to get more reds into the reflective texture to simulate subsurface flesh colors. (Due to our new custom cubemaps, this is no longer an issue)

 

If we can get a good realistic skin pore bump texture (along with added skin folds and creases to replace some of the worse shading details of the diffuse), then I am certain we can achieve a rather realistic skin quality. (Even with the shininess)

 

 

 

Incidentally out of curiosity, would someone be able to edit the models of people who have alpha tranparency applied to their hair, such as Mira or Atton, so that we can add a reflective map to them as well?

Share this post


Link to post
Share on other sites

That looks intense, VP. Skin a rakghoul with that and replace it's head with an Xenomorph and you'd have the mod Q and redrob(not sure on that one) were working on years ago.

Share this post


Link to post
Share on other sites

My current attempt. It's hard to see the bump/specular out of game with the screens, that's due to going for something more natural rather than strong.

 

 

 

The first uses my original bump map texture, skin specular sheen appears more pourous -- bit hard to tell when not seen in-game.

 

k2_bumptest_03.jpg

 

The second one uses an alt bump map resulting in a more glossy uniform sheen to the skin -- again, hard to see when not in-game.

 

k2_bumptest_04.jpg

 

 

 

Share this post


Link to post
Share on other sites

 a couple interesting points i'd like to bring out, 

 

keep in mind these are animateable as well as every other texture in game (other than particle textures, they are controlled by the model)

 

the controls i brought up from nwn in my first post are valid for use in kotor.

 

bumpyshinytexture is like a reverse envmap, ill explain in a diagram shortly,  how ever it works with non-bumpmappable surfaces as well (with out bump mapping effect)

 

i'm gonna test out the acid texture in kotor, maybe we can get it to be valid and not crash the game.

 

the bump map effect (not bumpyshiny texture) is basically the same as bumpyshiny, but with a dynamically generated cubemap based n the light in a room and from what i can tell the aforementioned controls, this changes in every room and is noticeable with no smooth transition, in fact maybe its related to the rooms models as some rooms have two or more "hot-swaps" in them.

 

though this is for dx-8 it resembles eerily what we see in kotor

http://developer.download.nvidia.com/assets/gamedev/docs/AGDC__Per_Pixel_Shading.pdf

 

p.s.

SIC, that's the texture (acid one) that i had in mind :)

Share this post


Link to post
Share on other sites

 a couple interesting points i'd like to bring out, 

 

keep in mind these are animateable as well as every other texture in game (other than particle textures, they are controlled by the model)

 

the controls i brought up from nwn in my first post are valid for use in kotor.

 

bumpyshinytexture is like a reverse envmap, ill explain in a diagram shortly,  how ever it works with non-bumpmappable surfaces as well (with out bump mapping effect)

 

i'm gonna test out the acid texture in kotor, maybe we can get it to be valid and not crash the game.

 

the bump map effect (not bumpyshiny texture) is basically the same as bumpyshiny, but with a dynamically generated cubemap based n the light in a room and from what i can tell the aforementioned controls, this changes in every room and is noticeable with no smooth transition, in fact maybe its related to the rooms models as some rooms have two or more "hot-swaps" in them.

 

though this is for dx-8 it resembles eerily what we see in kotor

http://developer.download.nvidia.com/assets/gamedev/docs/AGDC__Per_Pixel_Shading.pdf

 

p.s.

SIC, that's the texture (acid one) that i had in mind :D

 

As far as I can tell these don't work:

 

isdiffusebumpmap  1
isspecularbumpmap 1

 

Only isbumpmap will work without throwing an error on load; you can use these with isbumpmap, however, that does not mean that they work only that the engine will ignore them if they don't work. As far as I can tell, they do nothing when used in conjunction with isbumpmap.

 

As far as bumpyshinytexture, it seems to work the same as envmaptexture when used in conjunction with bumpmaptexture.

 

And bumpmapscaling does work, how I'm not sure as it doesn't seem to work the same as I would expect from regular bump/height maps -- seems to make the effect wider than heigher.

 

I haven't used specularcolor but I suspect it will and will work along the lines I suspect.

 

Yeah, I think that what you can achieve with this will be limited as this seems to be more of a bumpy reflections implementation of bump mapping and not really normal mapping as you would expect it from modern games. Mainly good for things that are (hard and) reflective, with limited use for organic things -- especially as it only works with models that have existing bump map textures.

Share this post


Link to post
Share on other sites

Final tests with the updated green tex again, albeit with some tweaks to make it more vibrant along with the other variants I've done...

 

k2_bumptest_07.jpg

 

And this last one should show more clearly the bump-specular effect to the textures...

 

k2_bumptest_08.jpg

Share this post


Link to post
Share on other sites

Continuing from what was discussed last year, I have learned how to enable bumpmaps on models which do not originally have support for them. Specially thanks to LiliArch for helping me ;). Below is a test I did on one of the PC head models.

 

 


572960b1c8ab061ef65afcc68d6becb2.png
+
91032fddf8c222a757f2cfed1587808b.png
=
e8d60f2a755bebf2679626d561422760.png

 

 

The process involved to make a model bump map compatible is actually rather simple if you're somewhat familiar with the how the .mdl file works. On each mesh node, the first bit in the MDX Data Bitmap is a yes/no flag for rendering bump maps. Setting the bit to 1 will enable it. There is still a matter of UV's for the bump map. The MDX bump map UV offset is 16 bytes away from the beginning of the texture uv offset. While you *could* insert extra UV's into the .mdx file then fix each node's .mdx offset, this is just not needed. Simply set the bump map's UV offset equal to the texture UV offset.

 

:mellow: I probably could have explained that a lot better and made a neater set of instructions but instead I'll make a tool somewhere down a long the line which does the above for you instead.

 

As for the "isdiffusebumpmap" and "isspecularbumpmap", neither of them seem to require the above to work. "LEH_wall01b" is an instance of this. I've checked various models that use it, none seem to have the bumpmap flag turned on in the .mdls' nodes.

 

tl;dr Bumpmaps can be now put on possibly any model and I'll probably make a tool which does all the hex editing for you.  still some problems that need to be solved

  • Like 4

Share this post


Link to post
Share on other sites

I'm interested in this process and am wondering if there have been any follow-up posts about it, since?  

 

Thanks!

Unfortunately, I hit a road bump with this. There are 9 floats per vertex in the mdx file which seem to be needed when bumpmaps are enabled. They look like a collection of normals but I have no idea how to calculate any of them (Possibly related to something called "Tangent Space"). If anyone knows what they could be, pm me or post here. Thanks. 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.