This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: M2 Bounding Boxes and Lights  (Read 1629 times)

iindigo

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 198
    • View Profile
M2 Bounding Boxes and Lights
« on: November 10, 2015, 03:54:46 am »
So I’ve been going through Azeroth and adding lights to the various lamps, torches, etc scattered throughout (3.3.5) with LightAdder. This works great, but as some of you here are aware, M2s with lights added by LightAdder have a bug: their bounding boxes don’t match up to the sphere of light that the light(s) you added cast, meaning that all of the light the model is casting just disappears when the model isn’t in the player’s field of vision. This creates a distracting, unpleasant effect where lighting kinda pops in and out of existence as you walk along.

To fix this, as suggested, I tried grabbing 010 editor and editing my custom M2 files with a template. I’m able to modify the M2 fine and it saves alright, but after logging into the game I see no difference, even after changing values to extremes (100+).

So now I’m wondering if I’ve done something wrong. Am I editing the appropriate values? What is the range of numbers that I should be editing within — what units do these numbers represent? Is there a known mapping between M2 light distance values and M2 bounding box values?

Below is a screenshot of the values in question.

« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: M2 Bounding Boxes and Lights
« Reply #1 on: November 10, 2015, 08:40:28 am »
There is supposedly a client limit of a certain amout of lights per field of view. I think I have an idea. Try to scale the bounding box bigger, so that it definitely covers the range of spreading light. The issue might be very possibly related to bounding boxes.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: M2 Bounding Boxes and Lights
« Reply #2 on: November 10, 2015, 09:13:34 am »
The box you have to edit is "vertex box" which is bounding, "bounding box" is for collision. I updated the naming to be consistent with Blizzard some weeks ago on the wiki.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: M2 Bounding Boxes and Lights
« Reply #3 on: November 10, 2015, 09:31:17 am »
Also the problem seems to be fixed in WoD as the light is no longer depending on surrounding geometry vertices.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Alastor

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1105
    • View Profile
Re: M2 Bounding Boxes and Lights
« Reply #4 on: November 10, 2015, 09:55:00 pm »
You changed float boxes not bouding boxes those are actualy in anim block
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
No matter how fast light travels it finds the darkness has always got there first and is waiting for it
Star Citizen Referral Code : STAR-XNFS-HVL9

Soldan

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 159
    • View Profile
Re: M2 Bounding Boxes and Lights
« Reply #5 on: November 10, 2015, 10:49:37 pm »
Take the values from vertex float boxes (max, min and radius.. 7 in total), and then go to the stand animation, and copy them into that animation's bounding boxes. That should do the trick.


It's a common bug that you get used to fixing with Obj2M2.exe. Garthog never got around to adding the fix.

---------------
For example - Fixing a dagger that has the same problem;



You take these, and put them here:



So then it looks like:

« Last Edit: January 01, 1970, 01:00:00 am by Admin »

iindigo

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 198
    • View Profile
Re: M2 Bounding Boxes and Lights
« Reply #6 on: November 11, 2015, 12:06:09 am »
Quote from: "schlumpf"
The box you have to edit is "vertex box" which is bounding, "bounding box" is for collision. I updated the naming to be consistent with Blizzard some weeks ago on the wiki.

This worked beautifully. Thanks!


Quote from: "Soldan"
Take the values from vertex float boxes (max, min and radius.. 7 in total), and then go to the stand animation, and copy them into that animation's bounding boxes. That should do the trick.


It's a common bug that you get used to fixing with Obj2M2.exe. Garthog never got around to adding the fix.

---------------
For example - Fixing a dagger that has the same problem;



You take these, and put them here:



So then it looks like:


Interesting. I haven’t used Obj2M2 at all, and have only been adding lights to M2s that already existed in WotLK (with exception to some down ported SW street lamps from Cata).

These changes didn’t seem necessary after editing the VertexBox entries under the theFloats struct, as pointed out by schlumpf. I don’t doubt that this would also fix the bug, I’m just curious as to when either method is necessary. Should both be set?


Also, has anybody worked out a way to dynamically calculate a proper vertex bounding box given an intensity? I’d really like to roll this into a new build of LightAdder if possible to reduce manual work.

And how do attenuationStart/End work? They sound like they’d control the “gradient” the light uses as it fades with distance but playing around with it, I don’t really see any difference in-game.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »