Author Topic: A second type of "bumpmapping" possible but not yet discovered. (?)  (Read 2866 times)

Legacy_Zarathustra217

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #45 on: March 26, 2015, 10:04:16 am »


               

Actually, I wonder if they ditched it because of the issues with ATI cards? (not to mention various on board, usually Intel cards) They never got shiny water to work right with Radeons (which is a similar way of post processing/pixel shading) and doing the significant effort of implementing bumpmaps would be hard to justify if the majority of players wouldn't be able to use it.



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #46 on: March 26, 2015, 04:43:13 pm »


               

Well, the first part is a bit sticky to address, the last part of your comment nailed it, at least based on this interview GameSpy did with Scott Greig at Bioware:

 



GameSpy - While the number of polygons that an engine can process in realtime is bound to increase, several other technologies are available that can increase the visual aspect of a game, including such items as bump-mapping, "true" reflection and environment mapping, detail texturing, and dynamic level of architectural detail. Will your next-generation engine incorporate any (or all) of these, or any other "next-gen" architectural/environment effects?


 


Scott - New technologies are always exciting to play with, but they should really only be added if they actually add to the game play experience. There is also the problem of the lack of hardware support for the latest features. For example, some of the latest video cards support per-pixel environment mapping. This feature is really great. It finally allows for realistic metals, not just Terminator 2 like chrome effects, but more realistic texturing effects. The problem is, by the time our game will ship, less than 20% of players would have hardware that supports this feature (Ok, I just made up that number). We are then faced with the option of either, not using the feature, or having to implement two systems and two sets of artwork. It then becomes a choice of can we afford the cost of the extra work required to add a feature that only 20% of the players will get to see. These are the types of problems that occur every time you look at new technologies. In the case of Neverwinter Nights, we managed to avoid this problem by creating a new technique that closely approximates the per-pixel environment mapping available on latest cards, but still works on the older video cards too. Most of the time, we are not so lucky.




               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #47 on: November 04, 2015, 12:26:51 am »


               

I inadvertently discovered that there's a hidden cubemap in NWN which doesn't exist as file but is generated via an algorithm.  It's always generated by the game, nomatter what, and sits in memory with all the other textures.  It looks something like this:
bQpdFVC.png

 

Since I didn't want any rainbow cubemapped objects, I didn't investigate it much.  But, going through some notes of mine I came up with this page and found out this cubemap is called a "Normalisation Cube Map".  Turns out, it's not just for making things rainbowy.   '<img'>   From what I understand, it's for helping the game figure out how much to correctly perturb a surface normal when used in conjunction with a bumpmap.  They work together.  

 

So normally I would assume that the normalisation cube map above is an under-the-hood thing as part of what-passes-for-bumpmapping in NWN.  Something that's maybe blended into the existing equation of grayscale bumpmap + cube environment map (ttr01__env as an example) but it turns out that it can be accessed simply by referencing the texture NormCubeMap.

 

Which I found very interesting because it implied, at least, that there would be a reason to invoke it separately from ASCII.  About the time I noticed all that, I also noticed that in the demo example I link to at the page above was a complete tangent space normal map (a typical modern normal map which has a blue tinge) except it wasn't in RGB format, it was an 8-bit image.  Still looks like a typical normal map though.  Now, NWN requires its bump maps to be 8-bit and we usually assume it means grayscale but that's not necessarily true.  Turns out, the bumpmap can be color and, in this case, it would make even more sense (in retrospect) that NWN could process a typical tangent space normal map, just with less fidelity than a more modern game.

 

I also noticed that when I used one of these 256 color normal maps, they look slightly better than grayscale ones, but not by a whole lot.  Both grayscale and indexed colors show up as grayscale when not bumpmaps, with the natural grayscale one looking considerably muddier and the 256 color map having a bit more contrast and being sharper.

 

So I don't know what to make of that. I played More KotoR to try to get a feel for something to shoot for, bumpmap-wise, or a clue or something and all I can really say is the bumpmapping in KotoR I and II (from what I've seen) looks absolutely terrible.  If anyone can point to a spot in KotoR I or II or Jade Empire that actually has bumpmapping that looks good, I mean even remotely good, somehow let me know or send a screenshot or something.  All I've been able to pull up so far looks more or less exactly like crappy frozen shiny water in NWN.

 

Anyway, there's a funny twist to all this.  I've spent so much time messing around with different textures and color channel combinations in order to coax out some alternate bumpmap effect that I've randomly come across some non-bumpmap texture methods which look way better than they should.  I'm not really sure if I can put it better than that at this point.  "They just look better than I think they should."  I guess this translates into unexpectedly nice dynamic highlights for a 2D texture.  This is a rough WIP example of what I'm talking about.  Even though it's missing what I hope is a clever envmap addition, it still just...looks....a....little...better...than...it...should...

 
ePa8Emr.jpg

 

This is not a filtered texture.  It's not like the textures in NWNCQ, for instance.  What it is, is a high quality (but only 256x256 resolution) 32-bit tangent space normal map whose color channels and alpha have been broken apart and then rearranged or copied into other channels in a very specific way.  The method I'm using apes Dragon Age: Origin's normal map format, where the normal map's Red channel (lit normals along the X-axis) replaces the Alpha and the Green channel (lit normals along the Y-axis) then replaces the existing Red and Blue channels.  

 

All that seems like an exceptionally strange way to compose a texture to be honest, but I'm going with the flow.  Right now it looks like what's happening is I'm baking the highlights and lowlights while the midrange is transparent...or something.

 

Anyway, there are a ton of other variables both in the model and texture which could be at play so it may take a while to suss out.



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #48 on: November 04, 2015, 12:43:56 am »


               

I can't recall ever seeing any flat surface anywhere in NWN that looks that... non-flat.



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #49 on: November 04, 2015, 01:11:55 am »


               

It's a pretty neat effect, if I can figure out how to tame it.  BTW, I do a lot of talking about blue-tinged tangent space normal maps.  Just to be clear, this effect is not blue tinged or anything like that, that was just the color of the backing I had behind it.  Here's a red backing with a purple light, for instance.  Probably a hideous color combo but...


 


That backing is going to be replaced with an environment map, probably a colored version of something like this, when I'm done figuring out why those highlights work how they do.  If I'm lucky, it'll come together as a 1-2 punch of visual trickery and misdirection.  Make the eye think there's something there when there isn't.



               
               

               
            

Legacy_CaveGnome

  • Sr. Member
  • ****
  • Posts: 432
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #50 on: November 04, 2015, 01:55:03 am »


               This is a very convincing effect. If used on tile floors or walls, I see huge potential... Hey, one of my secret wishes is a lunar/asteroid tileset (na, nothing to do with a certain famous space rock named B.... ;-)
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #51 on: November 05, 2015, 03:36:35 am »


               

I am starting to understand a leetle bit more and I thought I would show off some comparison shots of a teapot model with a green light (from placeables.2da) next to it.  Before I go on, I just wanted to underscore that the process that I wrote about creates a texture which is transparent to some degree.  So some of the things below either involve coloring the transparent texture with an envmap or having something "under" it with a texture.


 


 First, the "control" picture with the regular rock texture applied to a teapot.  This is the picture I derived the normal map from, with no modifications or anything:


P8Kcm0x.jpg


 


Here is that method I posted about in the previous two messages, except instead of using a sort of a square sphere map that I linked to, this is just a solid brown 64x64 envmap:


KOo5qwn.jpg


Notice how the green light "paints" the surface?  I'll get to that a little bit later in the post.  


 


But what if you didn't want a single-color surface and wanted bits of the original texture to show through?  Well, just duplicate the model and texture it with your original texture or, as here, basically mimic the color of an envmap on a full-sized texture but with portions of the original bitmap "showing through".  No need to change the scale of the models, as long as the model with the transparent texture is the child (hierarchy-wise) of the diffuse-textured one, it'll draw after the diffuse and the effect will composite correctly.  This is what that looks like:


hKPKkiw.jpg


 


Anyway, those are some screenshots of different techniques and what they look like.  They are by no means all the different ways you can tweak this situation, just the ones I thought of and had time to do this evening.


 


On to more general things: So what tricks are responsible for these looking like they have more depth?  Part of it is definitely how the textures are put together.  By copying the Red into Alpha and Green into the other channels, you basically wind up with an 8-bit image...with an alpha layer.   How the alpha and the grayscale in the texture interact is definitely a part of it.  But the following phenomena also seems to be partly at play:


 


BduCTPD.jpg


 


The way light "paints" a transparent model.  Or, I should say, at least the models I've set myself up with.  I have to determine if there's something special I'm doing, model-wise.  Anyway, that's me standing in the center of a big sphere model with a transparent texture (using the technique I outlined above) with a placeables.2da light above it and in an Interior, Torch-Lit only environment.  Notice how where the light hits it, it becomes opaque?  If I were to pull out my torch model and walk outside the sphere, that whole side would go from being transparent to opaque- and be the color of whatever light my torch was putting off.  Like I've said, I've seen this before and not paid too much attention to it but there might be something Interestingâ„¢ going on.  I'm not so sure there is.  I'm pretty sure there isn't.  But there might be.  If there was, it would be something where a light calculation was treating that surface as though they were surface normals.  I really don't think that's the case.  Howwwwwever...see the buttons above and the radial pleats they have?  In this video you can see the pleats apparently appear and disappear when I move my camera around.  Only the first 25-30 seconds are worth watching. 


 


I'm not sure what's up with that.



               
               

               
            

Legacy_Jedijax

  • Hero Member
  • *****
  • Posts: 692
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #52 on: November 05, 2015, 05:43:25 am »


               

I have no idea what the hell you're talking about most of the time, but you're a genius. I never thought NWN was capable of those.




               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #53 on: November 05, 2015, 12:17:53 pm »


               

Is this still something which can only be done with shiny water enabled, or otherwise on a video card which supports effects like shiny water?



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #54 on: November 05, 2015, 08:55:09 pm »


               

@Jedijax - Ha- thank you!  Don't jinx me!   ':lol:'  

 

@MerricksDad - This should all just be achievable with regular lighting.  Bet let's put that to the test!  

 
FOpa75L.jpg

 

Download the demo module...

 
yAZDoGD.png

 

I'd love feedback if it works but especially if it doesn't!

 
NOTE: The plane on the left may appear a little more lit.  I think that's just because there's another light near the teapot whose rays are also hitting it.



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #55 on: November 06, 2015, 12:21:32 pm »


               

On mine, the snake looking tube is transparent with darker spots sliding along it. It doesn't shine for me at all. The other parts are about the same, but I can see some variation in how the lighting works. The teapot is more brown on mine, and the right plane is more well lit than yours, making it look less shiny overall. When I walk past any of them with a torch, I don't get as much play as in your video. Some of this could be my display settings on the monitor. I can't explain yet the lack of texture on the snake tube.


 


Edit: I don't see the globe-shaped env map in the hack, that is probably the only difference.



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #56 on: November 06, 2015, 03:09:23 pm »


               

Does this mean authors of tilesets will be able to update their textures and offer a new form of visual enjoyment for those of us in the community?


The latest picture example. How about the grass to make it look like grass, vs. looking like a carpet using the information you've found.


Or building textures that look smooth (ala plain texture example) but upgraded by the tileset authors to make it look like rock (ala two models example).


Is that what the direction of this new information you've provided will move CC makers toward?


FP!



               
               

               
            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #57 on: November 06, 2015, 03:40:45 pm »


               


Anyway, that's me standing in the center of a big sphere model with a transparent texture (using the technique I outlined above) with a placeables.2da light above it and in an Interior, Torch-Lit only environment.  Notice how where the light hits it, it becomes opaque?  If I were to pull out my torch model and walk outside the sphere, that whole side would go from being transparent to opaque- and be the color of whatever light my torch was putting off.  Like I've said, I've seen this before and not paid too much attention to it but there might be something Interestingâ„¢ going on.  I'm not so sure there is.  I'm pretty sure there isn't.  But there might be.


 




Is there a txi with 'blending additive' involved somewhere?


               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #58 on: November 06, 2015, 05:39:55 pm »


               

@MerricksDad - Thank you for downloading it and finding that error, MD!  I'd inadvertently left that file out.  It's in the updated pack at the download link above.  You can see the effect of that most easily by pausing the game and moving your camera around: It should cause highlights to play over the surface of the torus knot when paused.  I's not sure about the other differences though I would chalk those up to a difference in monitor calibration settings.  I know you're busy but if you can send me a screenshot (oldtimeradionwn at google's mail service dot com) of what you're seeing using the default lighting settings in the demo I can compare that to a screenshot from the same-ish view on my end.  If they're generally the same, it's a difference in displays.  AFAIK, though, the OpenGL coloring, NWN's lighting, should be basically the same across systems.

 



Does this mean authors of tilesets will be able to update their textures and offer a new form of visual enjoyment for those of us in the community?




Sure...if they want!  But for that to happen I have a ton of footwork to do and, even if I achieve what I consider a wild success, there's still no guarantee that anyone will do anything with it.  There are a lot of factors which figure into how widely adopted something new is, and which exist regardless of quality or utility.  I don't worry so much about that, but it's part of the reality of the situation. 

 

I still have a lot of ground to cover, though.  Just a few:

* Which default Ambient and Diffuse look better on the model.  All 1's vs all .588 or whatever vs Diffuse .8 & Ambient .2 vs something yet unknown

* Whether other settings, such as those applied by the TriMesh modifier (and regardless of their settings) might negatively impact or help with the effect

* How well those things blend in with regular NWN tiles/placeables.  These look good in regular daylight so that's bolstering.

* How to reproduce this effect with other textures or, put another way, what textures are a good candidate for this process?

* Appropriate range of grayscale (this is huge) which have to be used to make the effect work best.

* Is this effect disrupted by objects with different shapes/smoothing groups?  (Thankfully, looks pretty persistent)

 

And so on and so on.

 



The latest picture example. How about the grass to make it look like grass, vs. looking like a carpet using the information you've found.



Since I still have quite a bit to figure out, I'm just going to stick with bumpy stuff. I've tried a few things like cobblestones and while I can sort of conceptualize how to make them look better, doing it is a bit beyond my skills at the moment. So just bumpy stuff for now.

 



Or building textures that look smooth (ala plain texture example) but upgraded by the tileset authors to make it look like rock (ala two models example).


Is that what the direction of this new information you've provided will move CC makers toward?



If I can exploit this to some measurably nicer and reproducable effect, absolutely.  But even I am not convinced this is some kind of panacea.  A demo module full of side-by-side comparisons once I've answered the bullet-pointed questions/issue above is really the only way to know how much utility it'll have.



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
A second type of "bumpmapping" possible but not yet discovered. (?)
« Reply #59 on: November 06, 2015, 05:53:32 pm »


               


Is there a txi with 'blending additive' involved somewhere?




Nope, it should be just that missing texture that MD mentioned.  I stayed away blending additive in this current demo.  It could be very nice in the future but my experiments with it indicated I really needed to get a handle on the grayscale range in my alpha and my envmap first.  Beyond my skills at the moment.  The plane on the right is one transparent plane with an envmap like the one on the taurus knot on the demo and one backing plane.  The one on the left is just a basic textured plane.


 


Crap, misread your message.  Yes, there is a good chance I was using blending additive in there.  That would absolutely make sense.  I try so many different things so quickly that I often lose track of what settings I'm using until something stands out.