addEmissiveColorToPbrMaterial#
Fully qualified name: usdex::core::addEmissiveColorToPbrMaterial
- bool usdex::core::addEmissiveColorToPbrMaterial(
- pxr::UsdShadeMaterial &material,
- const pxr::GfVec3f &color,
- const float luminance = 1000.0f,
Adds an emissive color and luminance to an OpenPBR material.
It is expected that the material was created by
definePbrMaterial()This drives the OpenPBR
emission_colorandemission_luminanceinputs in the MaterialX render context, and the UsdPreviewSurfaceemissiveColorinput in the universal render context. Two material interface inputs are created to share these values across both render contexts:emissiveColor(Color3) andemissiveLuminance(Float).Note
emissiveLuminanceis incd/m^2(Candelas per square meter, also known as Nits), per the OpenPBR Surface specification. UsdPreviewSurface does not have a separate luminance input, so the universal render context only receives the emissive color (without luminance scaling).- Parameters:
material – The material prim
color – The emissive color
luminance – The emissive luminance in
cd/m^2(Nits). Must be at least 0.0 (no upper bound). Defaults to 1000.0, which is roughly the brightness of an indoor LED light panel and produces a clearly visible emission in most scenes.
- Returns:
Whether or not the emissive color was added to the material