Skip to content

Increase D3D9 local light sources available from 8 to 20#633

Merged
Xyon merged 1 commit intoorbitersim:mainfrom
maxq519:more-d3d9-lights
Apr 13, 2026
Merged

Increase D3D9 local light sources available from 8 to 20#633
Xyon merged 1 commit intoorbitersim:mainfrom
maxq519:more-d3d9-lights

Conversation

@maxq519
Copy link
Copy Markdown
Contributor

@maxq519 maxq519 commented Feb 15, 2026

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:

  • None
  • 4x
  • 8x
  • 12x
  • 16x
  • 20x

Thanks to @ThePuzzlemaker for helping me with this
Launchpad options:
- None
- 4x
- 8x
- 12x
- 16x
- 20x
@ThePuzzlemaker
Copy link
Copy Markdown
Contributor

ThePuzzlemaker commented Feb 15, 2026

Looks like there were some odd whitespace changes in the shader, Visual Studio might've tried to auto-format on save maybe

@Xyon
Copy link
Copy Markdown
Member

Xyon commented Feb 15, 2026

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
Copy link
Copy Markdown
Contributor

@ThePuzzlemaker ThePuzzlemaker Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@GLS-SSV
Copy link
Copy Markdown
Contributor

GLS-SSV commented Feb 16, 2026

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.

@n7275
Copy link
Copy Markdown
Contributor

n7275 commented Feb 16, 2026

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.

@jarmonik
Copy link
Copy Markdown
Contributor

There's been no limitation other than performance.
The code seems to be missing light selector/optimizer code modifications.

  1. Number of lights in a scene is unlimited.
  2. From where X number of lights are selected for each vessel.
  3. From where 4 - 8 most effective lights are selected for each mesh.

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.

@Xyon
Copy link
Copy Markdown
Member

Xyon commented Apr 8, 2026

I'm a little unclear whether your comment was to suggest there should be more work done here before this is merged, @jarmonik ?

@jarmonik
Copy link
Copy Markdown
Contributor

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.

@Xyon Xyon merged commit a735af5 into orbitersim:main Apr 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants