Page MenuHome

Fix T83450: Missing 4th studio light in preview icon
ClosedPublic

Authored by Nathan Craddock (natecraddock) on Feb 2 2021, 5:50 AM.

Details

Summary

Due to an off-by-one error the generated studio light icons did not show
the influence of the 4th light. This fix changes the loop to iterate
over all of the lights when computing the lighting.

Diff Detail

Repository
rB Blender

Event Timeline

Nathan Craddock (natecraddock) requested review of this revision.Feb 2 2021, 5:50 AM
Nathan Craddock (natecraddock) created this revision.

Is there a way we can make this not hard codes? If not, it should at lease be a constant.

This can use the already existing STUDIOLIGHT_MAX_LIGHT. Otherwise, good catch!

This revision is now accepted and ready to land.Feb 2 2021, 12:39 PM
Clément Foucault (fclem) requested changes to this revision.Feb 2 2021, 12:40 PM

Well. A lot of things rely on the fact that there is a max of 4 lights. There is vector packing in shader for instance.

On the other hand you could use ARRAY_SIZE macro to get the correct length.

This revision now requires changes to proceed.Feb 2 2021, 12:40 PM
  • Use define instead of hard-coded value
This revision is now accepted and ready to land.Feb 2 2021, 3:29 PM