Skip to content

USDMeshLight Color Temperature Fix - #7291

Open
ericmehl wants to merge 6 commits into
mainfrom
usdMeshLightTemperatureFix
Open

ericmehl wants to merge 6 commits into
mainfrom
usdMeshLightTemperatureFix

Conversation

@ericmehl

Copy link
Copy Markdown
Contributor

This is a replacement for #7278. It's made from a GafferHQ branch so the Arnold tests can run.

I'm including the original and fixup for now, but if it's easier to review after squashing the fixup, I can do that.

From the original description :

This fixes a bug where the color temperature was not being applied to USDMeshLight in some cases.

In Arnold, if there was a surface emission color, the combination was not tinting by the color temperature.

In all renderers except RenderMan (we don't support inputs to color in RenderMan), if there was a shader connected to the USDMeshLight color parameter, it was not being tinted by the color temperature.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

- Match formatting across similar code blocks
- Remove tests for the light color value when it has an input. The value
is irrelevant and it increases the burden of matching values to those
produced by the algorithm.
@ericmehl ericmehl mentioned this pull request Nov 24, 2026
4 tasks done
@ericmehl

Copy link
Copy Markdown
Contributor Author

This has a much simpler solution to the multiplication shader network for the light color input. It's now building a list of things - shader parameters or a plain color - that need to be multiplied together to satisfy the specification.

It could perhaps be made a little more resilient to later extension by sorting the vector of multipliers to have all the Parameters before the color, but manually tacking on the color at the end seems like a good simplification for now.

@ericmehl

Copy link
Copy Markdown
Contributor Author

I just have the Arnold case improved so far. If we're happy with this, I'll move the 3Delight and Cycles conversions to use a similar approach.

@danieldresser-ie

Copy link
Copy Markdown
Contributor

That definitely looks like an improvement to me. If I had any nitpick, multiplierTree doesn't really gain anything from splitting the range in half? It always needs to output N - 1 multiply nodes. It seems like it could be written to just recursively call itself once for multiplierTree( network, multipliers, start + 1, end );, peeling off one element every time, rather than recursively splitting ... I think that would be a slightly simpler form of recursion, and might make the names of the adapter shaders easier to reason about? But this is already much better.

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.

2 participants