stride3d / stride3d/stride

Suspicious code in Lambertian prefiltering compute

Open
#1,555 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Graphics
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

https://github.com/stride3d/stride/blob/5f3542d08b701b90a5b1544e01e42a4d628b2105/sources/engine/Stride.Rendering/Rendering/ComputeEffect/LambertianPrefiltering/LambertianPrefilteringSH.cs#L104

Been reading the code to get to really know those light probes, when I stumbled on something that doesn't seem right. Looks like the order's switched, was it intended to assign groupSizeX instead before trying to decrease it?

                var groupCountX = 1;
                var groupCountY = sumsToPerfomRemaining;
                while (groupCountX >= short.MaxValue)
                {
                    groupCountX <<= 1;
                    groupCountY >>= 1;
                }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sources/engine/Stride.Rendering/Rendering/ComputeEffect/LambertianPrefiltering/LambertianPrefilteringSH.cs around line 104 and trace the group-count calculation surrounding the reported loop. Confirm whether the condition and update order are intentional, then validate the affected rendering or compute behavior; done means the suspicious logic is resolved and the result is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.