Skip to content

Conversation

ld-kerley
Copy link
Contributor

Currently if the OSL shader generator is passed an element that outputs a single surfaceshader type, then it injects the shader code from the OSL implementation of surfacematerial node. Because the surfaceshader type is a struct and it needs to be resolved down to a closure color for output.

This PR modifies the shader generator to insert an instance of the surfacematerial node, instead of hardcoding the shader source in the shader generator. This decouples the library, and means we just have a single source of truth for the shader code in the surfacematerial node for OSL.

Adds a new API call on the ShaderGraph node to insert a node upstream of an output of the graph.

… the required node that exists in the data library
Copy link
Contributor

@niklasharrysson niklasharrysson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thank @ld-kerley

Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the minor notes I've added inline, this change looks good to me.

I'd probably recommend that we hold this change in reserve for 1.39.5, since it's a substantial change in logic.

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.

3 participants