mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Deprecated old DumpRenderScene and related dump functions in render-data.cc that didn't include OpenPBR shader output. The newer implementation in render-scene-dump.cc already has proper support for dumping both UsdPreviewSurface and OpenPBR materials. The old DumpMaterial function only dumped surfaceShader field, missing the openPBRShader field entirely. Now DumpRenderScene correctly outputs OpenPBR material parameters including: - Base layer (weight, color, roughness, metalness) - Specular layer (weight, color, roughness, ior) - Coat layer (weight, color, roughness) - Emission (luminance, color) - Transmission (weight) - Subsurface (weight, color) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
219 lines
9.4 KiB
Plaintext
Executable File
219 lines
9.4 KiB
Plaintext
Executable File
#usda 1.0
|
|
(
|
|
defaultPrim = "root"
|
|
doc = "Blender v4.5.4 LTS"
|
|
metersPerUnit = 1
|
|
upAxis = "Z"
|
|
)
|
|
|
|
def Xform "root" (
|
|
customData = {
|
|
dictionary Blender = {
|
|
bool generated = 1
|
|
}
|
|
}
|
|
)
|
|
{
|
|
def Xform "Cube"
|
|
{
|
|
custom string userProperties:blender:object_name = "Cube"
|
|
|
|
def Mesh "Cube" (
|
|
active = true
|
|
prepend apiSchemas = ["MaterialBindingAPI"]
|
|
)
|
|
{
|
|
uniform bool doubleSided = 1
|
|
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
|
|
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
|
|
int[] faceVertexIndices = [0, 4, 6, 2, 3, 2, 6, 7, 7, 6, 4, 5, 5, 1, 3, 7, 1, 0, 2, 3, 5, 4, 0, 1]
|
|
rel material:binding = </root/_materials/Material>
|
|
normal3f[] normals = [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1), (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0)] (
|
|
interpolation = "faceVarying"
|
|
)
|
|
point3f[] points = [(1, 1, 1), (1, 1, -1), (1, -1, 1), (1, -1, -1), (-1, 1, 1), (-1, 1, -1), (-1, -1, 1), (-1, -1, -1)]
|
|
texCoord2f[] primvars:st = [(0.625, 0.5), (0.875, 0.5), (0.875, 0.75), (0.625, 0.75), (0.375, 0.75), (0.625, 0.75), (0.625, 1), (0.375, 1), (0.375, 0), (0.625, 0), (0.625, 0.25), (0.375, 0.25), (0.125, 0.5), (0.375, 0.5), (0.375, 0.75), (0.125, 0.75), (0.375, 0.5), (0.625, 0.5), (0.625, 0.75), (0.375, 0.75), (0.375, 0.25), (0.625, 0.25), (0.625, 0.5), (0.375, 0.5)] (
|
|
interpolation = "faceVarying"
|
|
)
|
|
uniform token subdivisionScheme = "none"
|
|
custom string userProperties:blender:data_name = "Cube"
|
|
}
|
|
}
|
|
|
|
def Scope "_materials"
|
|
{
|
|
def Material "Material" (
|
|
prepend apiSchemas = ["MaterialXConfigAPI"]
|
|
)
|
|
{
|
|
string config:mtlx:version = "1.39"
|
|
token outputs:mtlx:surface.connect = </root/_materials/Material/Principled_BSDF_mtlx1.outputs:surface>
|
|
token outputs:surface.connect = </root/_materials/Material/Principled_BSDF.outputs:surface>
|
|
custom string userProperties:blender:data_name = "Material"
|
|
|
|
def Shader "Principled_BSDF"
|
|
{
|
|
uniform token info:id = "UsdPreviewSurface"
|
|
float inputs:clearcoat = 0
|
|
float inputs:clearcoatRoughness = 0.03
|
|
color3f inputs:diffuseColor.connect = </root/_materials/Material/Image_Texture.outputs:rgb>
|
|
float inputs:ior = 1.45
|
|
float inputs:metallic = 0
|
|
float inputs:opacity = 1
|
|
float inputs:roughness = 0.5
|
|
float inputs:specular = 0.5
|
|
token outputs:surface
|
|
}
|
|
|
|
def Shader "Image_Texture"
|
|
{
|
|
uniform token info:id = "UsdUVTexture"
|
|
asset inputs:file = @./textures/texture-cat.jpg@
|
|
token inputs:sourceColorSpace = "sRGB"
|
|
float2 inputs:st.connect = </root/_materials/Material/uvmap.outputs:result>
|
|
token inputs:wrapS = "repeat"
|
|
token inputs:wrapT = "repeat"
|
|
float3 outputs:rgb
|
|
}
|
|
|
|
def Shader "uvmap"
|
|
{
|
|
uniform token info:id = "UsdPrimvarReader_float2"
|
|
string inputs:varname = "st"
|
|
float2 outputs:result
|
|
}
|
|
|
|
def Shader "Principled_BSDF_mtlx1"
|
|
{
|
|
uniform token info:id = "ND_open_pbr_surface_surfaceshader"
|
|
color3f inputs:base_color.connect = </root/_materials/Material/NodeGraphs.outputs:node_out>
|
|
float inputs:base_diffuse_roughness = 0
|
|
float inputs:base_metalness = 0
|
|
float inputs:base_weight = 1
|
|
color3f inputs:coat_color = (1, 1, 1)
|
|
float inputs:coat_darkening
|
|
float inputs:coat_ior = 1.5
|
|
float inputs:coat_roughness = 0.03
|
|
float inputs:coat_roughness_anisotropy
|
|
float inputs:coat_weight = 0
|
|
color3f inputs:emission_color = (1, 1, 1)
|
|
float inputs:emission_luminance = 0
|
|
color3f inputs:fuzz_color = (1, 1, 1)
|
|
float inputs:fuzz_roughness = 0.5
|
|
float inputs:fuzz_weight = 0
|
|
float3 inputs:geometry_coat_normal
|
|
float3 inputs:geometry_coat_tangent
|
|
float3 inputs:geometry_normal
|
|
float inputs:geometry_opacity = 1
|
|
float3 inputs:geometry_tangent.connect = </root/_materials/Material/NodeGraphs.outputs:node_004_out>
|
|
bool inputs:geometry_thin_walled
|
|
color3f inputs:specular_color = (1, 1, 1)
|
|
float inputs:specular_ior = 1.45
|
|
float inputs:specular_roughness = 0.5
|
|
float inputs:specular_roughness_anisotropy = 0
|
|
float inputs:specular_weight = 1
|
|
color3f inputs:subsurface_color.connect = </root/_materials/Material/NodeGraphs.outputs:node_out>
|
|
float inputs:subsurface_radius = 0.05
|
|
color3f inputs:subsurface_radius_scale = (1, 0.2, 0.1)
|
|
float inputs:subsurface_scatter_anisotropy = 0
|
|
float inputs:subsurface_weight = 0
|
|
float inputs:thin_film_ior = 1.33
|
|
float inputs:thin_film_thickness = 0
|
|
float inputs:thin_film_weight = 0
|
|
color3f inputs:transmission_color.connect = </root/_materials/Material/NodeGraphs.outputs:node_out>
|
|
float inputs:transmission_depth
|
|
float inputs:transmission_dispersion_abbe_number
|
|
float inputs:transmission_dispersion_scale
|
|
color3f inputs:transmission_scatter
|
|
float inputs:transmission_scatter_anisotropy
|
|
float inputs:transmission_weight = 0
|
|
token outputs:surface
|
|
}
|
|
|
|
def NodeGraph "NodeGraphs"
|
|
{
|
|
float3 outputs:node_004_out.connect = </root/_materials/Material/NodeGraphs/node_004.outputs:out>
|
|
color3f outputs:node_out.connect = </root/_materials/Material/NodeGraphs/node.outputs:out>
|
|
|
|
def Shader "node_texcoord"
|
|
{
|
|
uniform token info:id = "ND_texcoord_vector2"
|
|
float2 outputs:out
|
|
}
|
|
|
|
def Shader "Image_Texture_Color"
|
|
{
|
|
uniform token info:id = "ND_image_color4"
|
|
asset inputs:file = @./textures/texture-cat.jpg@ (
|
|
colorSpace = "srgb_texture"
|
|
)
|
|
string inputs:filtertype = "linear"
|
|
float2 inputs:texcoord.connect = </root/_materials/Material/NodeGraphs/node_texcoord.outputs:out>
|
|
string inputs:uaddressmode = "periodic"
|
|
string inputs:vaddressmode = "periodic"
|
|
color4f outputs:out
|
|
}
|
|
|
|
def Shader "node"
|
|
{
|
|
uniform token info:id = "ND_convert_color4_color3"
|
|
color4f inputs:in.connect = </root/_materials/Material/NodeGraphs/Image_Texture_Color.outputs:out>
|
|
color3f outputs:out
|
|
}
|
|
|
|
def Shader "node_001"
|
|
{
|
|
uniform token info:id = "ND_normal_vector3"
|
|
string inputs:space = "world"
|
|
float3 outputs:out
|
|
}
|
|
|
|
def Shader "node_002"
|
|
{
|
|
uniform token info:id = "ND_normalize_vector3"
|
|
float3 inputs:in.connect = </root/_materials/Material/NodeGraphs/node_001.outputs:out>
|
|
float3 outputs:out
|
|
}
|
|
|
|
def Shader "node_003"
|
|
{
|
|
uniform token info:id = "ND_tangent_vector3"
|
|
string inputs:space = "world"
|
|
float3 outputs:out
|
|
}
|
|
|
|
def Shader "node_004"
|
|
{
|
|
uniform token info:id = "ND_normalize_vector3"
|
|
float3 inputs:in.connect = </root/_materials/Material/NodeGraphs/node_003.outputs:out>
|
|
float3 outputs:out
|
|
}
|
|
|
|
def Shader "node_005"
|
|
{
|
|
uniform token info:id = "ND_rotate3d_vector3"
|
|
float inputs:amount = -90
|
|
float3 inputs:axis.connect = </root/_materials/Material/NodeGraphs/node_002.outputs:out>
|
|
float3 inputs:in.connect = </root/_materials/Material/NodeGraphs/node_004.outputs:out>
|
|
float3 outputs:out
|
|
}
|
|
|
|
def Shader "node_006"
|
|
{
|
|
uniform token info:id = "ND_normalize_vector3"
|
|
float3 inputs:in.connect = </root/_materials/Material/NodeGraphs/node_005.outputs:out>
|
|
float3 outputs:out
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def DomeLight "env_light"
|
|
{
|
|
float inputs:intensity = 1
|
|
asset inputs:texture:file = @.\textures\color_121212.hdr@
|
|
float3 xformOp:rotateXYZ = (90, 1.2722219e-14, 90)
|
|
uniform token[] xformOpOrder = ["xformOp:rotateXYZ"]
|
|
}
|
|
}
|