Increase D3D9 local light sources available from 8 to 20#633
Increase D3D9 local light sources available from 8 to 20#633Xyon merged 1 commit intoorbitersim:mainfrom
Conversation
Thanks to @ThePuzzlemaker for helping me with this Launchpad options: - None - 4x - 8x - 12x - 16x - 20x
|
Looks like there were some odd whitespace changes in the shader, Visual Studio might've tried to auto-format on save maybe |
|
It looks like it's been reindented, yeah. Which makes it a little difficult to spot logical changes in that shader code; I don't see any, but lots of lines show changed because of the reindent. Are there rendering changes in there? |
| #else | ||
| cDiffLocal = 0; | ||
| cSpecLocal = 0; | ||
| #if LMODE == 0 |
There was a problem hiding this comment.
@Xyon These are the relevant changes (L214-L250). It is the exact same code path, after compilation, due to the loop unrolling, just (imo) cleaner and more general. Otherwise, since the LocalLights/LocalLightsBeckman functions only do 4 at a time, 20x lights would require 5 calls of these functions, which is kind of unnecessary when you can just use the preprocessor/compiler well and let it generate those calls with an unrolled for loop.
|
I think more lights were asked years ago, and @jarmonik answered was that there was some limitation (don't know what it was) preventing that... is that limitation now gone? IMO, the unrelated formatting changes should be removed from this PR. If they are an improvement, that is another PR. |
Agreed on the formatting. If I had to guess, my assumption would be the removal of the DX7 dependencies, but I'm not sure. |
|
There's been no limitation other than performance.
So, the X would still need to be re-balanced for 20 lights. Of course, lights per vessel don't need to be higher than 20 in which case the algorithm could be skipped. |
|
I'm a little unclear whether your comment was to suggest there should be more work done here before this is merged, @jarmonik ? |
|
I haven't had time to dig to D3D9 light rendering code, so, I am unsure. If the code is tested and it works then it's fine to merge. Also, If a problem arise it can be fixed later on. Also D3D9 is no longer officially developed, so, issues should be tracked and implemented to future clients. |
Thanks to @ThePuzzlemaker for helping me with this
Rendering path for None, 4x, and 8x is the same as the existing D3D9 client.
Launchpad options: