arnold-usd icon indicating copy to clipboard operation
arnold-usd copied to clipboard

DomeLight with HDRI image doesn't cast shadow in usdview

Open msercheli opened this issue 1 year ago • 1 comments

Describe the bug DomeLight with a HDRI (exr) image doesn't cast shadows in usdview, but it does in Solaris. I tested using an EXR and TX but the behavior is the same. In Solaris, Arnold viewport is fine. Rendering using Arnold from Solaris is also fine. But in usdview, no shadows.

To Reproduce Steps to reproduce the behavior:

  1. In Houdini/Solaris:
  2. Create a grid, a sphere and a domeLight
  3. Plug into the inputs:texture:file attribute of the light an HDRI
  4. Adjust the inputs:texture:format attribute to "latlong", etc, to match your HDRI format
  5. Solaris viewport set to Arnold should show the sphere's shadow on the grid
  6. Export the USD file to disk
  7. Open in usdview and enable Arnold delegate
  8. No shadows in usdview

Expected behavior Shadows in usdview viewport

Screenshots hou_viewport usdview

Used Software Versions

  • Arnold: 7.1.2.0
  • USD: 0.21.08
  • Compiler: GCC 6.3.1
  • OS: CentOS 7
  • Houdini: 19.0.622
  • HTOA: 6.1.2.1

Additional context The contents of the USD file:

#usda 1.0
(
    defaultPrim = "root"
    endTimeCode = 1
    framesPerSecond = 24
    metersPerUnit = 1
    startTimeCode = 1
    timeCodesPerSecond = 24
    upAxis = "Y"
)

def Xform "root" (
    kind = "component"
)
{
    def Xform "floor"
    {
        matrix4d xformOp:transform:xform = ( (10, 0, 0, 0), (0, 10, 0, 0), (0, 0, 10, 0), (0, 0, 0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform:xform"]

        def Mesh "mesh_0"
        {
            float3[] extent = [(-5, 0, -5), (5, 0, 5)]
            int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
            int[] faceVertexIndices = [0, 1, 11, 10, 1, 2, 12, 11, 2, 3, 13, 12, 3, 4, 14, 13, 4, 5, 15, 14, 5, 6, 16, 15, 6, 7, 17, 16, 7, 8, 18, 17, 8, 9, 19, 18, 10, 11, 21, 20, 11, 12, 22, 21, 12, 13, 23, 22, 13, 14, 24, 23, 14, 15, 25, 24, 15, 16, 26, 25, 16, 17, 27, 26, 17, 18, 28, 27, 18, 19, 29, 28, 20, 21, 31, 30, 21, 22, 32, 31, 22, 23, 33, 32, 23, 24, 34, 33, 24, 25, 35, 34, 25, 26, 36, 35, 26, 27, 37, 36, 27, 28, 38, 37, 28, 29, 39, 38, 30, 31, 41, 40, 31, 32, 42, 41, 32, 33, 43, 42, 33, 34, 44, 43, 34, 35, 45, 44, 35, 36, 46, 45, 36, 37, 47, 46, 37, 38, 48, 47, 38, 39, 49, 48, 40, 41, 51, 50, 41, 42, 52, 51, 42, 43, 53, 52, 43, 44, 54, 53, 44, 45, 55, 54, 45, 46, 56, 55, 46, 47, 57, 56, 47, 48, 58, 57, 48, 49, 59, 58, 50, 51, 61, 60, 51, 52, 62, 61, 52, 53, 63, 62, 53, 54, 64, 63, 54, 55, 65, 64, 55, 56, 66, 65, 56, 57, 67, 66, 57, 58, 68, 67, 58, 59, 69, 68, 60, 61, 71, 70, 61, 62, 72, 71, 62, 63, 73, 72, 63, 64, 74, 73, 64, 65, 75, 74, 65, 66, 76, 75, 66, 67, 77, 76, 67, 68, 78, 77, 68, 69, 79, 78, 70, 71, 81, 80, 71, 72, 82, 81, 72, 73, 83, 82, 73, 74, 84, 83, 74, 75, 85, 84, 75, 76, 86, 85, 76, 77, 87, 86, 77, 78, 88, 87, 78, 79, 89, 88, 80, 81, 91, 90, 81, 82, 92, 91, 82, 83, 93, 92, 83, 84, 94, 93, 84, 85, 95, 94, 85, 86, 96, 95, 86, 87, 97, 96, 87, 88, 98, 97, 88, 89, 99, 98]
            uniform token orientation = "leftHanded"
            point3f[] points = [(-5, 0, -5), (-3.8888888, 0, -5), (-2.7777777, 0, -5), (-1.6666665, 0, -5), (-0.55555534, 0, -5), (0.5555558, 0, -5), (1.666667, 0, -5), (2.7777781, 0, -5), (3.8888893, 0, -5), (5, 0, -5), (-5, 0, -3.8888888), (-3.8888888, 0, -3.8888888), (-2.7777777, 0, -3.8888888), (-1.6666665, 0, -3.8888888), (-0.55555534, 0, -3.8888888), (0.5555558, 0, -3.8888888), (1.666667, 0, -3.8888888), (2.7777781, 0, -3.8888888), (3.8888893, 0, -3.8888888), (5, 0, -3.8888888), (-5, 0, -2.7777777), (-3.8888888, 0, -2.7777777), (-2.7777777, 0, -2.7777777), (-1.6666665, 0, -2.7777777), (-0.55555534, 0, -2.7777777), (0.5555558, 0, -2.7777777), (1.666667, 0, -2.7777777), (2.7777781, 0, -2.7777777), (3.8888893, 0, -2.7777777), (5, 0, -2.7777777), (-5, 0, -1.6666665), (-3.8888888, 0, -1.6666665), (-2.7777777, 0, -1.6666665), (-1.6666665, 0, -1.6666665), (-0.55555534, 0, -1.6666665), (0.5555558, 0, -1.6666665), (1.666667, 0, -1.6666665), (2.7777781, 0, -1.6666665), (3.8888893, 0, -1.6666665), (5, 0, -1.6666665), (-5, 0, -0.55555534), (-3.8888888, 0, -0.55555534), (-2.7777777, 0, -0.55555534), (-1.6666665, 0, -0.55555534), (-0.55555534, 0, -0.55555534), (0.5555558, 0, -0.55555534), (1.666667, 0, -0.55555534), (2.7777781, 0, -0.55555534), (3.8888893, 0, -0.55555534), (5, 0, -0.55555534), (-5, 0, 0.5555558), (-3.8888888, 0, 0.5555558), (-2.7777777, 0, 0.5555558), (-1.6666665, 0, 0.5555558), (-0.55555534, 0, 0.5555558), (0.5555558, 0, 0.5555558), (1.666667, 0, 0.5555558), (2.7777781, 0, 0.5555558), (3.8888893, 0, 0.5555558), (5, 0, 0.5555558), (-5, 0, 1.666667), (-3.8888888, 0, 1.666667), (-2.7777777, 0, 1.666667), (-1.6666665, 0, 1.666667), (-0.55555534, 0, 1.666667), (0.5555558, 0, 1.666667), (1.666667, 0, 1.666667), (2.7777781, 0, 1.666667), (3.8888893, 0, 1.666667), (5, 0, 1.666667), (-5, 0, 2.7777781), (-3.8888888, 0, 2.7777781), (-2.7777777, 0, 2.7777781), (-1.6666665, 0, 2.7777781), (-0.55555534, 0, 2.7777781), (0.5555558, 0, 2.7777781), (1.666667, 0, 2.7777781), (2.7777781, 0, 2.7777781), (3.8888893, 0, 2.7777781), (5, 0, 2.7777781), (-5, 0, 3.8888893), (-3.8888888, 0, 3.8888893), (-2.7777777, 0, 3.8888893), (-1.6666665, 0, 3.8888893), (-0.55555534, 0, 3.8888893), (0.5555558, 0, 3.8888893), (1.666667, 0, 3.8888893), (2.7777781, 0, 3.8888893), (3.8888893, 0, 3.8888893), (5, 0, 3.8888893), (-5, 0, 5), (-3.8888888, 0, 5), (-2.7777777, 0, 5), (-1.6666665, 0, 5), (-0.55555534, 0, 5), (0.5555558, 0, 5), (1.666667, 0, 5), (2.7777781, 0, 5), (3.8888893, 0, 5), (5, 0, 5)] (
                interpolation = "vertex"
            )
            uniform token subdivisionScheme = "none"
        }
    }

    def Sphere "ball"
    {
        float3[] extent = [(-1, -1, -1), (1, 1, 1)]
        color3f[] primvars:displayColor = [(0.17702079, 0.32605308, 1)] (
            interpolation = "constant"
        )
        double radius = 1
        matrix4d xformOp:transform = ( (5, 0, 0, 0), (0, 5, 0, 0), (0, 0, 5, 0), (0, 4.53095817565918, 0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }

    def Xform "lights"
    {
        def DomeLight "domelight1" (
            prepend apiSchemas = ["HoudiniViewportGuideAPI"]
        )
        {
            rel filters = None
            float houdini:guidescale = 1
            bool houdini:inviewermenu = 0
            color3f inputs:color = (1, 1, 1)
            float inputs:diffuse = 1
            bool inputs:enableColorTemperature = 0
            float inputs:exposure = 0
            float inputs:intensity = 1
            bool inputs:normalize = 0
            float inputs:specular = 1
            asset inputs:texture:file = @./hdri.exr@
            token inputs:texture:format = "latlong"
            rel portals = None
            matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
            uniform token[] xformOpOrder = ["xformOp:transform"]
        }
    }

    def Xform "cameras"
    {
        def Camera "cam" (
            prepend apiSchemas = ["HoudiniCameraPlateAPI", "HoudiniViewportGuideAPI"]
        )
        {
            float2 clippingRange = (1, 1000000)
            float exposure = 0
            float focalLength = 0.5
            float focusDistance = 5
            float fStop = 0
            float horizontalAperture = 0.20955
            float horizontalApertureOffset = 0
            asset houdini:backgroundimage = @@
            asset houdini:foregroundimage = @@
            float houdini:guidescale = 1
            bool houdini:inviewermenu = 1
            token projection = "perspective"
            double shutter:close = 0.25
            double shutter:open = -0.25
            float verticalAperture = 0.11787187
            float verticalApertureOffset = 0
            matrix4d xformOp:transform = ( (0.8514716160265045, 2.775557561562892e-17, -0.5244006932691957, 0), (-0.1793556002720108, 0.9396926207859081, -0.2912204441511245, 0), (0.49277546180007764, 0.34202014332566955, 0.8001215943887584, 0), (40.306498515468796, 31.35126409642696, 67.3424863795675, 1) )
            uniform token[] xformOpOrder = ["xformOp:transform"]
        }
    }
}

msercheli avatar Jul 14 '22 16:07 msercheli

Hi @msercheli , I reproduced the scene you described, however I don't see any sharp shadows in the houdini viewport. I am using the same houdini version as your example. Generally sharp shadows are created by point lights, or lights that are very small. Does your hdri contains a small region of high intensity ? Thanks

cpichard avatar Aug 23 '22 16:08 cpichard

@msercheli can you confirm if this is still an issue?

compso avatar Sep 23 '22 09:09 compso

Hi, sorry for the delay. @compso , yes, it's still an issue using the same versions as well as using USD 22.05.

@cpichard , answering about sharp shadows, the HDRI I am using has a sun in it, providing such intense and directional light source. Here is the web location to the HDIR file I am using: https://polyhaven.com/a/fouriesburg_mountain_midday

msercheli avatar Sep 23 '22 13:09 msercheli

Hi,

@compso , I finally had time to update my versions here. Using Arnold SDK 7.1.3.1 and Arnold-Usd 7.1.3.0 I can verify that it is working now. Issue fixed. Thanks.

msercheli avatar Oct 04 '22 19:10 msercheli