Updates to Support PhysicallyBased V2 : Part I.#37
Conversation
…lorspace and format (for specular) is to take the first entry which preserves the previous values but now with proper colorspace tagging.
…iseny and USDPreview are not currently supported but the default is Gulbrandsen. There is no BSDF for Lama nodes but the default should work there as well. - Fix colorspace specification. It was being used for all inputs instead of just ones where specifeid. - Fix transmission color colorspace setting. - Rerun translation for each shading model.
…r does not write lin_rec709 unless specified by option.
There was a problem hiding this comment.
OpenPBR assumes ACEScg by default , so the color space needs to specifically be set to lin_rec709 when using that color space. For ACEScg it can be left empty.
StandardSurface doesn't seem to have a default color space, so the color space should always be set explicitly there.
I've made colorspace always explicit. I have patched custom phybased definition but it won't work since there is no 1 interface that can be used for multiple targets. i.e. you can't store 1 value when different values are required per backend. |
| colorspace = '' | ||
| input_doc = '' | ||
|
|
||
| if key in ['viscosity', 'density', 'thinFilmThickness']: |
There was a problem hiding this comment.
The format for these differs between materials now. No idea how to map to a single definition input. Sometimes it is float, vec2, or vec3.
There was a problem hiding this comment.
I can appreciate this causes some friction.
I wanted to give every implementer a chance to display the value they think is most useful, or all values if they prefer that. However in the case of MaterialX, only one value can be used of course.
For example, the Thin Film Thickness for Soap Bubble can be between 10-1000, with 500 being the most common thickness.
I would check if [2] in the array is present, and if not, choose either [1] or [0]. You could also calculate the average of [0] and [1] and use that.
Hope it makes sense.
There was a problem hiding this comment.
For the nodedef, this can't be dynamic as there is only 1 definition not a definition per material.
So if a parameter can be specified with 1, 2 or 3 values, then if the parameter is specified with the highest ordinal, the assigned value would have to have "dummy" values added
to "pad" it.
The current possible validation errors are as follows, without "padding"
Invalid value: <input name="viscosity" type="vector3" value="1.7">
Invalid value: <input name="viscosity" type="vector3" value="46">
Invalid value: <input name="viscosity" type="vector3" value="0.6">
Invalid value: <input name="viscosity" type="vector3" value="1.552">
Invalid value: <input name="viscosity" type="vector3" value="2">
Invalid value: <input name="thinFilmThickness" type="vector3" value="20, 300">
Invalid value: <input name="viscosity" type="vector3" value="1.002">- Delete acescg translations
AntonPalmqvist
left a comment
There was a problem hiding this comment.
I've tested the different .mtlx outputs in both MaterialXViewer and Unreal Engine 5.7 without issues.
Changes
lin_rec709.Example Output:
SS Cobalt: (explicit linear colorspace, Gulbrandsen format for specular color)
OpenPBR Cobalt: (explicit linear colorspace, F82 format for specular color)
glTF Cobalt: (explicit linear colorspace, F82 format for specular color)