Jump to content
The Dark Mod Forums

WARNING: baseLightProject invert failed


grayman

Recommended Posts

Yes.

I tried the Training Mission and WS5 for a few mins and there was no spam.

If this has something to do with projected lights, I could try isolating it. I use a lot of projected lights due to lightning in the mission. (I tried Somewhere Above the City, which also has lightning, and there was no spam.)

 

Edit: Not caused by projected lights. I removed all of them, and the spam still appeared.

Link to comment
Share on other sites

2 minutes ago, grayman said:

I don't have one.

Is the warning part of the lighting code, or something else? I need to know what to focus on when creating a test case.

Yes, it's a part of D3 BFG lighting code merged into TDM this year

Namely the R_DeriveLightData() function.
 

Link to comment
Share on other sites

First impression looks like 32bit precision overflow

Do you need the light to be 999999 units in size?

If so, try 2^20 instead of 999999 just to see if that helps.

Are you trying to simulate a parallel light here by making the point light that huge?

I think instead of inversing the near-degenerate matrix we could initialize it alternatively but my linear algebra kungfu is lame.

@stgatilov?

As a dirty work around we could mark specific lights to not emit this warning but I think it's there in the first place to avoid light abuse like this.

Link to comment
Share on other sites

There are many options what to do.

  1. Reduce light radius of all thunders from 999999 to 99999. It would pass the tolerance then, but would still be 10x larger than size of normal level according to ID software.
  2. Reduce tolerance on determinant. But to be honest, it is already very low (1e-16), so matrix inversion will more likely return garbage for almost-singular matrix than report error for properly invertible one.
  3. Implement special case --- inversion of diagonal matrix. In such case, no tolerances are necessary. Of course, if someone adds rotation to such a gigantic light, it will stop working.

 

 

Link to comment
Share on other sites

AFAIK, Doom 3 never had "true" Parallel lights. When you use the parallel keyword, you are forcing an absurd light radius.

I haven't checked the recent code-base to see if this has been substantially altered since Doom 3.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

3 hours ago, stgatilov said:

There are many options what to do.

  1. Reduce light radius of all thunders from 999999 to 99999. It would pass the tolerance then, but would still be 10x larger than size of normal level according to ID software.
  2. Reduce tolerance on determinant. But to be honest, it is already very low (1e-16), so matrix inversion will more likely return garbage for almost-singular matrix than report error for properly invertible one.
  3. Implement special case --- inversion of diagonal matrix. In such case, no tolerances are necessary. Of course, if someone adds rotation to such a gigantic light, it will stop working.

 

 

4. Switch the 'lightning' light to parallel?

Now wait a minute

Isn't this an ambient light essentially?

I mean, does it need shadows, or direction?

If it does need direction, it should be parallel. If it does not need both, it can be ambient.

Alternatively, we could use the current world size instead of the hardcoded 999999

One more option, the lightning could be implemented via a screen filter, or something

 

Link to comment
Share on other sites

In Sotha's mission "The Transaction" the lightning has shadows and you can hide in them when the lightning flashes.

If Sotha used the default entity then this would also have shadows.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

8 minutes ago, nbohr1more said:

In Sotha's mission "The Transaction" the lightning has shadows and you can hide in them when the lightning flashes.

If Sotha used the default entity then this would also have shadows.

Correct me if I'm wrong but the default lightning has origin (0,0,0). The shadows that it's casting will look like nothing you see in real world.

@Sotha?

Link to comment
Share on other sites

Again, as I recall, Id Software did a hack to make the light "look parallel" by forcing it to always be "far away" even if the actual

entity is close to the surface. It simulates attributes of moon\sun lighting but short-cuts the need to actually "exist" in a distant location.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Here we go:

 

https://www.iddevnet.com/doom3/editor_light.html

 

By marking the light as parallel, the light acts as if the center is extruded out to infinity. All the shadows will go in the same direction, and all the highlights in the bumps will face the same direction. This is very handy for creating sunlight.

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I'll bet that if you follow the entity inheritance for the lightning entity to the template light entity that it is created from,

you will find the parallel keyword there ;)

 

Edit: I lost that bet...

 

We would need to parse this fx def:

darkmod/fx/thunder.fx

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I reduced each 999999 to 99999 and the lightning works correctly now, with no warning spam.

I haven't committed the change; whoever's looking at the math might come up with something better.

Released maps that use fx/thunder.fx should get tested during beta. There are at least eight.

 

 

  • Like 1
Link to comment
Share on other sites

33 minutes ago, grayman said:

I reduced each 999999 to 99999 and the lightning works correctly now, with no warning spam.

I haven't committed the change; whoever's looking at the math might come up with something better.

In my opinion that's the best solution for now.

 

Quote

Released maps that use fx/thunder.fx should get tested during beta. There are at least eight.

Ehm... 12 maps by January 2019:

ac2\ac2.pk4 -> maps/ac2.map: 2
antr\antr.pk4 -> maps/antr.map: 1
briarwood\briarwood.pk4 -> maps/briarwoodcathedral.map: 2
closemouthed_shadows\closemouthed_shadows.pk4 -> maps/closemouthed_shadows.map: 1
deceptiveshadowsv1_2\deceptiveshadowsv1_2.pk4 -> maps/deceptiveshadows.map: 2
nhat3\nhat3.pk4 -> maps/anoott.map: 1
nhat3\nhat3.pk4 -> maps/forest.map: 1
siegeshop\siegeshop.pk4 -> maps/siegeshop.map: 2
somewhere1_1\somewhere1_1.pk4 -> maps/somewhere.map: 11
springcleaning\springcleaning.pk4 -> maps/sc.map: 1
storm\storm.pk4 -> maps/storm.map: 2
transaction\transaction.pk4 -> maps/transaction.map: 2

 

Link to comment
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.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...