IECoreUSD : Add option to write OSL shaders conformant with RenderMan#1540
Open
johnhaddon wants to merge 1 commit into
Open
IECoreUSD : Add option to write OSL shaders conformant with RenderMan#1540johnhaddon wants to merge 1 commit into
johnhaddon wants to merge 1 commit into
Conversation
This means writing the `info:id` attribute without our `osl:` prefix, and omitting any directories in the shader name. Since this is a breaking change, it is gated behind an IECOREUSD_WRITE_CONFORMANT_OSL_SHADERS environment variable for folks to opt in via. Unfortunately Arnold doesn't support shaders exported in this format, but it didn't support the old format either. Since the new format seems to be "blessed" by Pixar, perhaps we can contribute support for it to `arnold-usd` in the future. Alternatively, we could write OSL shaders as `arnold:osl` shaders, but only when assigned via an `arnold:` prefixed material binding. This is left as future work though. Adopting the RenderMan-style formatting for OSL shaders implies a few things for our own small shader library in Gaffer : - We should move to a flat directory structure, so we don't need to save the full name in the `cortex:shaderName` sidecar metadata. - We should prefix the shader names with "Gaffer", since the likelihood of collision is much greater without the directory names. This is also left as future work though.
dcb0d8d to
efe1c67
Compare
Contributor
|
I've looked through this code, and it seems like a valid implementation of this idea, though I know we've got a conversation going about whether this is the right approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This means writing the
info:idattribute without ourosl:prefix, and omitting any directories in the shader name. Since this is a breaking change, it is gated behind an IECOREUSD_WRITE_CONFORMANT_OSL_SHADERS environment variable for folks to opt in via.Unfortunately Arnold doesn't support shaders exported in this format, but it didn't support the old format either. Since the new format seems to be "blessed" by Pixar, perhaps we can contribute support for it to
arnold-usdin the future. Alternatively, we could write OSL shaders asarnold:oslshaders, but only when assigned via anarnold:prefixed material binding. This is left as future work though.Adopting the RenderMan-style formatting for OSL shaders implies a few things for our own small shader library in Gaffer :
cortex:shaderNamesidecar metadata.This is also left as future work though.