Skip to content

The light refraction effect of the shader is not working. #2992

@Garfield9986

Description

@Garfield9986

Description of Issue

When I used usdview to open an asset with a glass material, usdview didn't always display the glass correctly.

Steps to Reproduce

I wanted to refer to the official scene examples "still_life_project_files" and "bar_scene_proxy" to use princopledshader to add refraction to my glass model, but instead when I opened the official scene using usdview, The glass bottle in the scene could not be displayed correctly, and after I set the parameters of the model created by myself and opened it, the model in the usdview scene did not have the effect of glass, but just like the obj model was opened directly in usdview, without coloring. I was very confused. I have consulted the api of princopled shader in Houdini, which has support for physical optical parameters. Does usd not support refraction effects or princopled shader? Or is it because I didn't set the parameters correctly?
Here's what my material says about shaders:

      def Material "principledshader1"
              {
                  token outputs:karma:displacement.connect = 
</imagetostl_mesh/materials/principledshader1/principledshader1_displace.outputs:displacement>
                  token outputs:karma:surface.connect = 
</imagetostl_mesh/materials/principledshader1/principledshader1_surface.outputs:surface>
                  token outputs:surface.connect = 
</imagetostl_mesh/materials/principledshader1/principledshader1_preview.outputs:surface>
      
                  def Shader "principledshader1_surface"
                  {
                      uniform token info:implementationSource = "sourceAsset"
                      uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?SurfaceVexCode@
                      vector3f inputs:basecolor = (1, 1, 1)
                      int inputs:fakecausticsenabled = 1
                      float inputs:rough = 0
                      float inputs:ior = 1.50
                      float inputs:dispersion = 0.40
                      float inputs:transparency = 1
                      token outputs:surface
                  }
      
                  def Shader "principledshader1_displace"
                  {
                      uniform token info:implementationSource = "sourceAsset"
                      uniform asset info:sourceAsset = @opdef:/Vop/principledshader::2.0?DisplacementVexCode@
                      token outputs:displacement
                  }
      
                  def Shader "principledshader1_preview"
                  {
                      uniform token info:id = "UsdPreviewSurface"
                      float inputs:clearcoatRoughness = 0
                      color3f inputs:diffuseColor = (1, 1, 1)
                      float inputs:opacity = 0
                      float inputs:roughness = 0
                      float inputs:ior = 1.50
                      float inputs:dispersion = 0.40
                      color3f inputs:specularColor = (1, 1, 1)
                      token outputs:surface
                  }
              }

Uploading 20240307153806.png…

System Information (OS, Hardware)

windows10

Package Versions

usd23.11

Build Flags

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions