Replies: 1 comment
-
|
@pleprince some relevant links: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
OSL metadata standardisation proposal
Draft 1
Table of contents
Motivation
User interfaces are important for usability and enforcing conventions across DCCs goes a long way towards makintg artists' work easier.
Currently, OSL defines only a few metadata keywords, representing a subset of Katana's UI capabilities. Then, there are all the other DCCs like Houdini, Maya, Cinema4D, Blender, etc, which support either none, a subset or an entirely different set of UI metadata keywords.
This area is ripe for standardization and having implemented many of these keywords in RenderMan for Maya, I am confident this would greatly improve user experience at a reasonnable cost.
The emphasis of this proposal is to define a somewhat minimal set of UI hints that may be supported by most DCC applications.
Support levels
Given the number of controls to implement, it may be useful to introduce support levels.
One would hope that developers implements at least the basic level, as it would already provide a reasonnable user-experience.
As of today:
Common keywords
These keywords are supported by all widgets.
labelhelpreadOnlyconnectablepageAssign the parameter to a page defined as a dot-separated path, i.e. "Specular.Advanced".
openSample code
widgetDefines which widget type will control the parameter. All parameter types default to a sensible widget if un-defined in the metadata block.
Widget:
nullParameters using a
nullwidget are invisible in the UI.Sample code
Widget:
numberA widget for editable numeric values. This is the default widget used for number parameters.
minmaxdigitsslidersliderminslidermaxSample code
Widget:
stringDefault widget type used for string parameters.
Sample code
Widget:
checkBoxAn int parameter displayed as a boolean check box.
Sample code
Widget:
colorA widget used to edit color parameters.
color_enableFilmlookVis1color_restrictComponentsSample code
Widget:
popupDisplay a pop-up menu or combox box with literal choices for a string parameter.
options"One|Two|Three"editableSample code
Widget:
mapperAn menu presenting associative choices (like enums) for int, float and string parameters.
optionsSample code
Widget:
fileInputA string attributes containing a file path. There should always be an associated button to open a file browser and select the file.
fileTypes"tex,tx,exr", to filter the dialog's file list.assetDialogSample code
Widget:
colorRampNote
OSL's spline interpolation shadeops only work on static arrays when most users actually want dynamic arrays. This forces the shader writer to copy multiple dynamic arrays to static arrays. I don't know the exact cost of that operation but it would be great to get rid of this limitation.
Note
Start and end knots need to be repeated n-times depending on the interpolation scheme. It would be nice to add an option flag to let the spline shadeop automatically select the correct number of repetitions.
Note
It would be good to make sure DCC app widgets support all standard OSL interpolation modes. Last time I checked Maya did not, blender used other bases, etc.
Note
Do we really want to support per-knot interpolation bases ?
Color ramps depend on multiple parameters to provide knots position, knots value and knots interpolation.
The main parameter is an int parameter with a
colorRampwidget. Its value is the number of currently used knots. This representation allows support of fixed-size ramps.The metadata MUST define 3 additional keywords (
rampKnots,rampColorsandrampInterp) to be functional. If any of theme is missing, an error should be raised.Note
Should we extend oslc to validate metadata ?
rampKnotsrampColorrampInterprampHeightSample code
Widget:
floatRampThe main parameter is an int parameter with a
colorRampwidget.The metadata MUST define 3 additional keywords (
rampKnots,rampColorsandrampInterp) to be functional.rampKnotsrampColorrampInterprampHeightSample code
Arrays
OSL support array parameters of any types and the metadata allows writers to decide which widget should be used.
sizeDynamic arrays: the number of existing members on node creation. Defaults to -1 for empty.
isDynamicArrayuiStructtupleSizetupleGroupSizeSample code
Conditional visibility or locking
These keywords allow to control a parameter's visibility or editability based on the value of one or more shader parameters. The comparison rules are defined as a set of pair-wise comparisons:
prefixPath prefixOp prefixValueorprefixLeft prefixOp prefixRightNote
Katana uses
conditionalVis/conditionalLockbut I prefer a shorter keyword as it is still descriptive enough. TBD.Note
Pages should also support conditional visibility and locking.
How about
pageVis*andpageLock*?The keyword structure is as follows:
visorlock.Op,Path,Value,Left,Right.vis*Pathvis*Opvis*Valuelock*Pathlock*Oplock*ValueequalTonotEqualTogreaterThanlessThangreaterThanOrEqualTolessThanOrEqualToandorSample code
DCC app integration
Occasionaly, OSL shaders need to carry more metadata to make integrate with host applications.
*_nodeIDtags*_attributehiddenniceNameSample code
Footnotes
This is a Katana-ism and I would prefer something more generic like
color_managedthat doesn't mention "film". ↩Beta Was this translation helpful? Give feedback.
All reactions