AcademySoftwareFoundation / OpenShadingLanguage

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

fix for ReParameterization corner case #1670

Closed cmstein closed 1 year ago

cmstein commented 1 year ago

Description

This proposed patch fixes a corner case we were seeing during live rendering with ReParameterization.

We were experiencing a problem when ss->ReParameterize() wasn't successfully applying parameter changes for us.

In our situation, a shader's parameter, "A", was marked with lockgeom=0 (ie. "live" or "editable") and was set via ss->Parameter(). This parameter was connected (through a series of copies and network links) to another shader's parameter, "B", downstream whose initialized value (ie. the one specified in the .osl/.oso file) matched A's set value. When this happened, A's shading layer was getting marked as "mergeable" and deleted, and we wouldn't see any updates to A via "reparameterization" take effect.

Tests

We are using v3.13.2.3 locally and a similar fix (with b_sym->lockgeom() == 0 in lieu of this PR's b_sym->interactive()) resolved the issue. I can port my fix to the v3.12.3 branch if desired.

Checklist: