billw2015
King
- Joined
- Jun 22, 2015
- Messages
- 837
Problem: Civ 4 will only support a max of 1024 DirectX lights active at the same time. We exhaust this limit quite easily when not using graphics paging. We hit this limit way before we run out of actual memory in some games.
But it confuses me because we should only need ONE light because there is only the sun (sometimes some effects from mine flares).
This lead me to start investigating what specific models are causing D3D light allocations (some esoteric techniques were required here!).
I started narrowing this down, and found the first offender. Who would have suspected the humble lobster?
Here is what it looks like in game WITH those two lights:
And here is what it looks like without:
Better looking if anything. It is now being only lit by the sun instead of two random extra lights.
I also just found the sneaky shrimp has the same problem.
My plan now is to use the Python NIF tools and scan our entire model library for extra lights. Hopefully I can resolve the running out of lights crash just with model fixes and not more hacky things I was contemplating!
But it confuses me because we should only need ONE light because there is only the sun (sometimes some effects from mine flares).
This lead me to start investigating what specific models are causing D3D light allocations (some esoteric techniques were required here!).
I started narrowing this down, and found the first offender. Who would have suspected the humble lobster?
Spoiler :
Here is what it looks like in game WITH those two lights:
Spoiler :
And here is what it looks like without:
Spoiler :
Better looking if anything. It is now being only lit by the sun instead of two random extra lights.
I also just found the sneaky shrimp has the same problem.
My plan now is to use the Python NIF tools and scan our entire model library for extra lights. Hopefully I can resolve the running out of lights crash just with model fixes and not more hacky things I was contemplating!