AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.05k stars 347 forks source link

Feature: Ability to sparsely gather scalar values and connect them to elements of a dynamic or statically sized array parameter #1826

Open sfriedmapixar opened 4 weeks ago

sfriedmapixar commented 4 weeks ago

Description

This requires you to first declare a setting for the dynamic array input that
will be used to size and provide values for any unconnected elements of the
dynamically sized array.  After that, individual scalar->arrayelem connections
can be specified from any number of different upstream shading nodes.  This
facilitates gathering inputs from across your shading network, for example
several procedurally generated color signals and using them to drive inputs
to shading nodes that are best left dynamically sized, such as the inputs
to spline operations.

Tests

This includes a new test in vararray-scalar-connect to demonstrate and
test the new connection method.

Checklist: