Author Topic: Environment mapping on held items (weapons)  (Read 365 times)

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« on: June 15, 2014, 02:28:58 pm »


               

I am trying to change the environment map on a hand-held item, but I can't get the value to change. It just uses the default for the baseitem line.


 


I've tried TXI, and have previously read that changing the env map in the TXI on items will not do anything at all.


 


How do I change the environment map on a single model, or individual mesh in a model?


 


It seems like there was a MDL file line that could do this, but I can't find it searching through the omnibus. I think my problem is simply that I don't know what words I am searching for.


 


Anybody know this one?


 


If cube mapping would work on items, could somebody explain to me how I would make that work on them?


 


I may try texture replacement then changing the env map on that specific texture. Probably wont work either.



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #1 on: June 15, 2014, 03:09:47 pm »


               

I just tried using an emitter to place my shiny effect external from my item and it also does not work. In fact, it has no shine at all, even with env mapping turned on. It also has the side effect of leaving model artifacts where they should not be when unequipped or when having the object's appearance index changed.


 


It also jiggles slightly when I move the carrier around, as if trying to keep up with the inherit property, and not being able to do it on an immediate basis.



               
               

               
            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #2 on: June 15, 2014, 03:23:26 pm »


               

I may be wrong, but I think the env-map for creatures and weapons is taken from the tileset they are in. That way the 'reflections' in a desert look different from those in a frozen waste.



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #3 on: June 15, 2014, 03:29:44 pm »


               

I may have to go about this another way. Must brainstorm



               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #4 on: June 15, 2014, 07:39:12 pm »


               


I may be wrong, but I think the env-map for creatures and weapons is taken from the tileset they are in. That way the 'reflections' in a desert look different from those in a frozen waste.




 


Only if they're given the envmap 'default' in the appearance.2da or baseitems.2da respectively. Specifying any other texture name there overrides that behaviour and forces a particular envmap.


 


That applies to any .2da with an envmap field.


               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #5 on: June 15, 2014, 08:16:21 pm »


               

So from what I can see, there is no way to modify the env map on items at all. What I can do is:


  • Modify the envmap in a tileset, which will affect everything in it not specifying a variant

  • Modify the creature appearance envmap, which will affect anything held by the creature (??)

  • Modify a placeable envmap, which I cannot equip like I am doing anyway

  • Apply envmaps to the creature holding the object using stuff OTR and Virusman were playing with 2012. But does that affect the held items?

If that last one is workable, then I can probably do that, as long as my creature model does not have anything on that will be changed by the env map applied.


 


The only problems there is that 1) I have to then make an onEquip script for my star ruby orbs so that if they get equipped they change the carrying creature's environment map (and onUnequip to undo it) and 2) if my player equips it I either have to NOT do that, or alternately do that and suffer having all my shiny bits on my player character be replaced with star gem shine.


 


Looks like this is a no go all around.


 


I may instead equip the gem with a single emitter so the inner star always faces the camera. The only thing I see wrong with that is that it will not be on the outside of the gem, like you would see with star gems, it will be under the outermost model skin, which will dull the shine.


 


The only other option would be to emit a model instead, and I already know that has some serious issues.


 


Frankly, not currently worth the effort.



               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #6 on: June 15, 2014, 08:18:56 pm »


               

Make a new item type in baseitems.2da - then you can specify an envmap for that item type.



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #7 on: June 15, 2014, 08:20:20 pm »


               

What column would that be?



               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #8 on: June 15, 2014, 08:25:20 pm »


               


What column would that be?




 


Part1EnvMap Part2EnvMap Part3EnvMap


 


 


Owait... that's a boolean option? Well bugger me sideways. Apologies for the misdirection I guess :s Weird thing is, I do know for a fact they don't use the envmap of the creature wielding the item. So I guess it must always just assume default. That's disappointing.



               
               

               


                     Modifié par _six, 15 juin 2014 - 07:27 .
                     
                  


            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #9 on: June 15, 2014, 08:27:44 pm »


               

ok, so those point to actual indices in something? Because I thought that was just a type-global transparencyHint flag. 0 = transparent, 1 = envmap



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #10 on: June 15, 2014, 08:28:32 pm »


               

Finally found something else in NWN I have no power over! Took two years but hey!



               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #11 on: June 15, 2014, 08:29:16 pm »


               


ok, so those point to actual indices in something? Because I thought that was just a type-global transparencyHint flag. 0 = transparent, 1 = envmap




 


That's not what transparencyHint does, but yeah it looks like it is just a bool '<img'>


               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Environment mapping on held items (weapons)
« Reply #12 on: June 15, 2014, 08:30:52 pm »


               

Oh well, at least it is figured out. Moving on ... unless somebody knows something we don't.