AcademySoftwareFoundation / AcademySoftwareFoundation/MaterialX
Triplanar with different colorspaces gets wrong color transform
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 451
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Description
### Description
When using the `` node (which has 3 filename inputs) and different colorspaces on the different inputs only one colorspace transform is generated.
### To reproduce
Create a `` node with different colorspaces on the different input and observe the generated OSL code.

[repro-triplanar.zip](https://github.com/user-attachments/files/18396033/repro-triplanar.zip)
### Result
Generated OSL code:
```
NG_triplanarprojection_color3(triplanarprojection_filex_, triplanarprojection_filey_, triplanarprojection_filez_, triplanarprojection_layerx, triplanarprojection_layery, triplanarprojection_layerz, triplanarprojection_default, geomprop_Pobject_out1, geomprop_Nobject_out1, triplanarprojection_upaxis, triplanarprojection_blend, triplanarprojection_filtertype, triplanarprojection_framerange, triplanarprojection_frameoffset, triplanarprojection_frameendaction, triplanarprojection_out);
color triplanarprojection_out_cm_out = color(0.0);
NG_srgb_texture_to_lin_rec709_color3(triplanarprojection_out, triplanarprojection_out_cm_out);
```
### Expected result
I'd expect that three colorspace transforms would be emitted, one for each file input, with the corresponding source colorspace for each file input.
Contributor guide
Research direction
Start with the attached repro-triplanar.zip and inspect the generated OSL for a triplanarprojection node with three differently colored inputs. Trace the triplanarprojection code-generation entry point and existing colorspace-transform handling, then verify that the generated output contains one transform per file input with its source colorspace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100