Aller au contenu

Photo

A second type of "bumpmapping" possible but not yet discovered. (?)


  • Veuillez vous connecter pour répondre
87 réponses à ce sujet

#1
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

Happy holidays!  I hope you're all doing well!

 

Someone wrote me a few weeks ago about bumpmapping (shinywater) in NWN and after responding, I started playing around with all that stuff again.  The shinywater effect is not very flexible, doesn't yield much when it does yield something, and it's usually only visible on NVidia cards- though my current ATI drivers (new) seem to display it "fine".  The shiny water effect isn't even real bump mapping, per se.  It is or is closely related to an effect called EMBM ("Environment-Mapped Bump Mapping") and it always gives that plastic-y, shiny look when it's used in a game.  Anyway, as usual for playing around with TXI files, after a few weeks of trying different brute force approaches to make headway on useful features, I came up empty handed.

 

But I wanted to toss something out there, a clue, in case there were others who had the time and inclination to explores such things.  The "lead" I'm following (albeit in my usual roundabout fashion) is based on a single (official) screenshot that Bioware produced very early on in production and which can still be found on a few NVidia sites:

 

k8tcQR9.jpg

 

So, the above pic (one of a kind, AFAIK) shows an effect on the boulder and the obelisk that is "bump mappy" but is definitely not that EMBM/shinywater effect.  It's something else.  What...is it?

 

Well, so far, I think it's a specular bump map.  That would explain the monocromatic nature of the effect itself, where it appears that it relies on lighting to give it its color.  It would also fit in with the example.txi file's commands (which includes isspecularbumpmap along with isdiffusebumpmap) which were included with the original Bioware engine export plugins for 3ds Max 3, 4 & 5.1.  Unfortunately, while many of the commands in that example file work, a number of them don't and the command sequence they imply for bump mapping use doesn't appear to.  From that same plugin pack, the BumpyShinyAlignCheck portion of aurasanity.ms would seem, from what I can understand of it, to work with specular maps- though it might've worked for other maps, as well.

 

But is it an example of a specular bump map?  I dunno for sure.  It's some kind of bump map.  The things I mentioned above, along with the LightColor and (especially) LightOffsetX, LightOffsetY and LightOffsetZ columns in placeables.2da kind of make me think that, at least at one time, Bioware was sweet on the idea of doing a kind of 3D emboss effect on placeables and one which might not have even required a cubemap to do.  Which means, if the functionality is still in there, it might be something everyone (and not just NVidia users) could benefit from.

 

Food for thought!  If I find anything useful, I'll post about it and I hope others would do the same.

 

Cheers!


  • Carcerian, Rolo Kipp, CaveGnome et 3 autres aiment ceci

#2
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

Oh!  If people are interested in playing around with this, a basic start might be dabbling with shinywater as it currently exists.

 

To set up a test scene, here's the minimum you need to invoke shinywater and how it works.  In this example, it's not animated and will produce "frozen shiny water".  This should be tested with static objects and I typically test it on tiles.

 

1. Slap a texture (such as TTR01_water01) on a static object whose TXI has the following commands:

bumpyshinytexture ttr01__env
bumpmaptexture shinywater

 

In processing the TXI, the engine loads up ttr01__env (which doesn't even have a texture, IIRC), but it does have a TXI which reads as follows:

cube 1
filerange 6

 

Those commands load up ttr01__env0.tga->ttr01__env5.tga which do exist and which compose the cubemap which is necessary for the effect.  So that first line from the first TXI has run its course and is done.  The next line, bumpmaptexture shinywater texture is read in.  It's an 8-bit grayscale (important) and all it needs, IIRC, is just the following in its TXI:

isbumpmap 1

 

If I recall correctly, that's all that needs to happen for shinywater.  If the effect I have the screenshot of is still in the code, I can give no warranty that the above will definitely help to find it, merely that it's the closest thing to help I have right now.  Further hints can be found in the string dump from NWMain.exe and can be downloaded here.


  • Carcerian, Rolo Kipp, CaveGnome et 1 autre aiment ceci

#3
ia.Pepper

ia.Pepper
  • Members
  • 85 messages

Oh that's neat, oh the stuff you find and look to crack the cases of. A question though, what could we really use this for, if we discovered it? It seems like it might look a tad out of place, next to all the other textures.



#4
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

@ia.Pepper: The main thing I want it for (and I would really, really like this) is the ability to give the illusion of high geometric detail without actually having to have a high polycount on the model, itself.  That rock in the screenshot, if it were a model, would probably take upwards of 20-40k triangles to get the same lighting effects normally, if not much higher. 

 

While complex (static) models aren't that big a deal in NWN, that kind size for detail is not a good tradeoff.  Not for a rock, anyway.

 

If the effect I post the screenshot of is something that can be reproduced, it would be excellent for anything made out of stone, metal, clay or other things which are composed of a uniform material- environmental stuff like pillars, floors, walls, etc.  It would also be relatively easy to take existing diffuse maps from existing models, feed them into a program like InsaneBump (a freeware clone of CrazyBump) and get an appropriate grayscale map for such an effect.  In other words, just about anyone could get their toes wet with such an effect without having to be particularly skilled or have loads of time. 

 

Whether it can be reproduced, though, is the big question.


  • Carcerian, Rolo Kipp et MerricksDad aiment ceci

#5
ia.Pepper

ia.Pepper
  • Members
  • 85 messages

It could have been experimental code that never got added to the actual game. Though I suppose it would be neat if that wasn't the case. Good luck on your search!



#6
henesua

henesua
  • Members
  • 3 871 messages

is this merely a search for the right TXI commands? and it will just work off the alpha channel?



#7
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

@ia.Pepper: Very true and thanks!

 

@henesua: It could be...anything.  If the functionality is still in there, it could use the alpha or it could use a standalone 8-bit grayscale image like shinywater, something I'd probably think more likey given the hints in example.txi that I link to, upthread.  Or maybe something else.  It's really kind of anybody's guess.  Like I mentioned, part of it "working" may even hinge on something as un-intuitive as being a static placeable with a light defined in placeables.2da.  There are things I think of as clues (like light positioning info in placeables.2da) and even other things, like Virusman's discovery that envmaps were configurable (which allowed me to do this in stock NWN)) but I'm tossing it out to the community because, since there isn't any kind of reference point to begin from, others might have different, more successful, approaches.



#8
Jedijax

Jedijax
  • Members
  • 395 messages

Glad to have you back playing weird science on NWN! It may be one of two options, as it has already been mentioned. Either it was experimental bump mapping, which wasn't included in the final version, yet saw its way into latter Bioware games, or it could very well be a digitally altered image to make the product look better, which has happened at many times during product development.

 

It could be bump-mapping and you have sort of discovered something big here... and I really really hope it is... but only you can tell! If there's anything anyone who has followed your experiments can tell, is you think waaaay out of the box!



#9
Zarathustra217

Zarathustra217
  • Members
  • 221 messages

I and others experimented a lot with this back when Bioware first release the 3DsMax exporter plugin (since it mentioned the bumpmaps). Check my post "Bioware plz read! Bumpmapping" (by a very young me, trying to use hip language!) in the Omnibus (kudos for that btw).

 

Unfortunately, as far as anyone could tell, it's not possibly to do anything beyond that bluish specular bump that you see. Also, as far as I recall, it reacts very different from Nvidia to AMD/ATI, sometimes being transparent.

 

I also loosely recall that someone from DLA or CODI later told me that the Bioware developers explicitly stated that this was something they never managed to properly implement.


  • OldTimeRadio aime ceci

#10
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

I know that someone implemented pseud-bumpmapping - pcpeachykeen or Chico maybe? Anyway, maybe what they started to develop could be furthered along. I've never used their stuff and I know, from what I've read at least, that its a love/hate relationship. However, given the number of people that DID like it, there has to be something there that is worth exploring and developing further.



#11
Zarathustra217

Zarathustra217
  • Members
  • 221 messages

Peachykeen's NWshader (and later VoodooShader) fully features normal-mapping as seen here:

 

Unfortunately, it seems he has abandoned work on it: https://github.com/ssube/VoodooShader

 

And the last released version had bugs in this regard.


  • OldTimeRadio aime ceci

#12
Zwerkules

Zwerkules
  • Members
  • 1 322 messages

I know that someone implemented pseud-bumpmapping - pcpeachykeen or Chico maybe? Anyway, maybe what they started to develop could be furthered along. I've never used their stuff and I know, from what I've read at least, that its a love/hate relationship. However, given the number of people that DID like it, there has to be something there that is worth exploring and developing further.

Peachykeen had normal mapping working, but not in vanilla NWN, you needed the NWNShader he wrote.

Chico's 'bumpmaps' were pseudo bumpmaps which could at least have looked half decent if done right.

There are programs which automatically generate a normal map for a given texture. There's also a plugin

for the Gimp that can do the same. If you take a brick texture for example, let a program or plugin generate

a normal map from the texture and then use that normal map with the bump map filter of Gimp you get a

brick texture with a 'simulated' bump map.

Chico however just used the same grainy texture for making the pseudo-bumpmaps on nearly all his textures.

Some people actually liked that. I think it didn't improve the textures at all, just the opposite, it just added some

bumps to the textures in places they didn't even make sense like in the grout of wall textures and completely

destroyed all detail in things like paintings.


  • Jedijax et henesua aiment ceci

#13
Tarot Redhand

Tarot Redhand
  • Members
  • 2 686 messages

FWiW, I used a sort of pseudo bump mapping when I made Map Mats. In gimp under filters/artistic there is one called clothify, which is what I used. The only drawback is that it has to be used with care as once done, undo doesn't properly undo it.

 

TR



#14
_six

_six
  • Members
  • 919 messages

Painting bumps onto a 2d texture is not a bump map.

 

 

Captain obvious strikes again!


  • Pstemarie, Zarathustra217 et Jedijax aiment ceci

#15
Tarot Redhand

Tarot Redhand
  • Members
  • 2 686 messages

I did say that it was sort of pseudo bump mapping and not actual bump mapping.

 

TR



#16
_six

_six
  • Members
  • 919 messages

It's just a texture with bumps drawn on it. No need to invent fancy words :P 's all I'm saying.



#17
Fester Pot

Fester Pot
  • Members
  • 1 394 messages

/me bumps _six!

Welcome back :D

FP!


  • Pstemarie aime ceci

#18
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

Thanks all for the info about NWShader!  Right now, I'm more likely to investigate stuff that can be used by everyone pretty easily (i.e. that people can put to work in CCC submissions, for instance) than something that requires a completely different package and paradigm.  The exception to this would probbaly be NWNCX, because it's just about a necessity for playing online, nowdays. 

 

@Zarathustra217: Yep, that's a great thread!  Looking at Revinor's sample file at the end of the thread is a good indicator just how slow the going can be, even after twelve years.  On the topic of statements from Bioware, I keep chugging at stuff like this because I've become convinced over the years that even "inside sources" at Bioware could, on occasion, give out unintentionally misleading information that was then considered gospel- if they, themselves, even knew the answer at all.  I don't mean to put too fine a point on it, but it happened.  While not related to the functionality of the graphics engine, the "10 weapon limit finally cracked!" thread in the Omnibus is a great example of this.  Interestingly, Bioware remained exceptionally tight-lipped on certain topics related to CC (probably because it wasn't worth it to pull actual engineers away from programming to comment) and, because of that, both the NWN and KotOR modding communities are in the dark about a lot of similar things- even after all this time. 

 

That tends to put folks like you and me (and a lot of other people, over the years) in the same position as those guys who comb beaches with a metal detector, hoping to find something under the sand!

 

:lol:


  • Jedijax, Rolo Kipp et MerricksDad aiment ceci

#19
Tarot Redhand

Tarot Redhand
  • Members
  • 2 686 messages

That tends to put folks like you and me (and a lot of other people, over the years) in the same position as those guys who comb beaches with a metal detector, hoping to find something under the sand!

 

Let's just hope you find more gold rings than can ring-pulls  :) .

 

TR


  • OldTimeRadio et MerricksDad aiment ceci

#20
MerricksDad

MerricksDad
  • Members
  • 1 609 messages

I have a feeling that the TXI example I pulled from bioware was for KoTOR, but does this help at all?

 

# Specify whether or not this texture is a bumpmap.  If this
# flag is set, the texture module will expect to read in a
# texture which is grayscale.
#
# Default is 0

bumpmap 1

# Specify what kind of bumpmapping this bump map will do:
# specular, diffuse, or both.  These values are ignored if
# this texture is not a bump map.
#
# Default: isdiffusebumpmap 0, isspecularbumpmap 1

isdiffusebumpmap  1
isspecularbumpmap 1

# Specify a scaling factor for the bumpmap height.  If you
# want higher peaks and lower valleys in the bump map, set
# the value to be greater than 1.  If you want a smoother bump
# map, set this value to less than 1.
#
# Default is set to 1.

bumpmapscaling 1.5

# Specify a color for specular bumpmap highlights (RGB).  This
# value is modulated with the bump mapping light's color
# to produce the final highlight color.
#
# Default is (1,1,1)

specularcolor 0.5 0.5 0.8


  • CaveGnome aime ceci

#21
MerricksDad

MerricksDad
  • Members
  • 1 609 messages

I am unable to test this, since I cannot enable shiny water, and I suspect my game will not show any bumpmaps of any kind.

 

I put together these textures and txi files based on the KoTOR data. See if they do anything for you at all.

 

I'm sure you know already, but simply paint an object with the tx_ice06.tga texture and see if it grabs tx_ice06bmpmp.tga to use as a bump map.

 

https://www.dropbox....test_01.7z?dl=0



#22
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

Thanks, MD!  The snippet you posted is from the txi file I linked to in the first message.  While it seems to have historically gotten more play in the KotOR modding community,  the file's actually actually from the original Bioware NWN export scripts and plugins.  The texture files you provided are good for the job, but the tx_ice06.txi needed a cubemap line added (bumpyshinytexture ttr01__env) and tx_ice06bmpmp.txt needed to use the isbumpmap instead of bumpmap command in order to work.

 

I can't tell so much whether the lines...

isspecularbumpmap 1
bumpmapscaling 1.5
specularcolor 0.5 0.5 0.8

...do anything at all.

 

Kudos and thanks for kicking out ideas, though!  As I'm sure you're well aware, these sorts of investigations can be a lonely, lonely road to walk down and a little company helps keep the enthusiasm tank filled.  I don't know if you caught Zarathustra217's post above, where he references a great thread ("Bioware plz read! Bumpmapping") from the Omnibus regarding attempts to define bumpmapping capabilities, but at the end of it no less than the venerable Revinor coughs up his successful frozen water test materials and which also include his hashed-up TXI files- revealing more or less the same kinds of unfruitful guesses I (and I imagine, a lot of others) have been making, all these years since. 

 

Still, it should be noted that I tried this and most of my other tests only with tiles so far.  Once I've exhausted what I think are a decent set of possibilities with tiles, I'll wait for the alignment of caffiene and free time and plunge into similar experiments with placeables, static and non-static.  Because you never know quite where the coin might be hidden, if it's there at all.

 

On the KotoR side of things, Darth Sapiens and others have been poking around more or less the same functionality and with more or less the same results.  Threads here, here, here and here provide more information.  From what I most recently recall of their content, they are "basically" seeing exactly the same thing that we are when they try to wrangle bumpmaps with the exception, I believe, that certain models are receptive to their bumpmap attempts, presumably (?) having been compiled in such a way by Bioware as to allow for it.  From what I've seen, nothing Holy Grail-ish yet, but it's promising.  My hope is that, if it is something that requires a special compiler, that the leaked internal Bioware model compiler from 2002 will be the key that helps unlock that door.

 

But for the moment, it's still mostly TXI's I'm playing with.

 

EDIT: Almost forgot.  I managed to track down the very earliest screenshots of the Witcher which, according to everything I've read in interviews, were produced something like a month or two after they licensed the engine from Bioware in 2003.  Here they are.  So, at least to my thinking, these show at least some of what people who have access to the source code can pull out of NWN without any real changes having been made to the rendering/gfx pipeline yet.  If one looks through, they'll notice the shiny water ripples (not so much a fan of that) and some more subtle differences involving lighting and maybe other things.  I'm not too sure yet.  Oddly, some of these screenshots have a kind of brightness and clarity I associate with some very early NWN screenshots and it makes me think in both cases the some portions of the lighting we currently have are absent or modified, such as the sun object either not being present or having different values.


  • Jedijax, CaveGnome et MerricksDad aiment ceci

#23
MerricksDad

MerricksDad
  • Members
  • 1 609 messages

One more silly question, does isspecularbumpmap need to be set to 0 to try isdiffusebumpmap = 1. Since they are separate lines, maybe setting one to true while the other is already true makes it mad.

 

I want so much to find ways to make memory-cheap bump mapping, and at the same time, I don't even have a computer strong enough to actually use them. That fact alone makes it so maddening to poke around with this idea.

 

But I want it so bad :)



#24
MerricksDad

MerricksDad
  • Members
  • 1 609 messages

The more I stare at your top image, the more I see wrong with it from a bumpmapping perspective. The ridges and valleys are all wrong from any one light source anywhere near the front most stone. I think that is simply a texture, and a bad one at that. Try to geometrically pinpoint any one light source (given that multiple sources would affect it multiple times) and you can see that just the first light source fails to correctly raise/lower the centermost portion of the stone given that the light seems to be radiated from above and to the right the stone. I think it is prefabbed.



#25
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

I don't really know what the relationship is between them, but I have tried that combination in the regular shinywater chain and it didn't seem to work.   In regards to the image itself, I'm pretty sure it's real.  There's no visibile source of the blue light, it's true, but my guess is it's only because the model that is casting it doesn't have the familiar flare attached.  The model that the engine attaches to the placeable when you have LightColor, LightOffsetX, LightOffsetY and LightOffsetZ filled out happens to have a flare on it, but that can be removed and it'll just be a point of light without any clear indicator of source.  Here's an example of what I mean.  Goes in the override.

 

I haven't really had much of a chance to play around with it, but it appears that if one takes a texture (I did this on a placeable) and then, in its TXI, has a...

bumpreplacementtexture (grayscale bump map)

...and then in the gray scale bump map's TXI, have...

isbumpmap 1

...then the game will actually load the texture and process it as though it were a bump map- though without the environment map we associate with bump-mapping.  What does this mean?  Well, that's an interesting question.  First, I should explain that the reason the chest's lid is red is because of some Ambient and Diffuse settings (probably 5 0 0 for each) I set on the model, itself.  Let me show you some cutouts of the same patch of texture with something like bumpmap 1, 2 and 5 (or whatever, I can't remember my actual settings) applied:

 

hiYyUEk.jpg

wdEDJ7w.jpg

ZFQmRXg.jpg

 

Yay!  Well, sort of "Yay!", anyway.  See, without something to play over these presumed perturbed normals (like an envmap or light or something), what winds up on these chests are nothing but flat textures.  Or are they?  Excusing the strange coloring, here's how my regular ole torch lights up the surface:

 

KHqcH7I.jpg

 

Okay, official "Yay!" :D Bumpy.  If you look right where my torch's light and the regular pink of the chest meet you can see it.  Not quite the kind of bumpy I want, but it's better than nothing at the moment.

 

It appears that as far as the per-pixel shading is concerned, those are real perturbed normals.  Wonderful, but maybe not the most wonderful thing in the world because, as I've written (here, here at least) the overall  lighting situation in NWN is...unfortunate...and most lighting schemes cause builders to inadvertently build areas which crap it up even more than it is.  However, this investigation is far from done and there may be one or more pleasant twists to the story as it unfolds.  (knocks wood)

 

While neat, this is not optimal.  What's optimal?

What I want is the ability to get an environment map to play over this instead of the lighting.  I want this being perturbed by the normals the bump map above.  Because of the shading on smoothed models, I could take relatively low-poly models and punch them up with detail something fabulous.  Right now, the only way I can invoke this behavior is from a bumpreplacementtexture command and that command (at least to my tests so far) doesn't allow for me to get some shiny in there, too.  After all, the bump map texture is just an 8-bit, no alpha.  So to get the goods, somehow it has to be figured out how to take these bumps and make them kiss with some environment map or a cube map.

 

I don't know how to do that yet.  My big wish for 2015 is that someone will figure this out so I don't have (try) to.  :P

 

Cheers and Happy New Year, all!

 

EDIT: Some bonus shots from my testing in a gallery here.


  • Michael DarkAngel, Jedijax et MerricksDad aiment ceci