Announcement

Collapse
No announcement yet.

(Fixed) (HOU-4471) Camera focalLength discrepancies in viewport only (it's fine via husk)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • (Fixed) (HOU-4471) Camera focalLength discrepancies in viewport only (it's fine via husk)

    Hi,
    I've written a simple usd file that renders fine via husk but by in the viewport doesn't match the camera focal length to HoudiniGL/VK or Karma.
    The stage is set to `metersPerUnit=0.1` and I wonder if that could be the cause of this.

    File in usda format here:

    Code:
    #usda 1.0
    (
        metersPerUnit = 0.1
    )
    
    def Scope "World"
    {
        def Mesh "room_mesh" (
            apiSchemas = ["MaterialBindingAPI"]
        )
        {
            float3[] extent = [(-50, 0, 0), (0, 30, 30)]
            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]
            int[] faceVertexIndices = [0, 1, 6, 7, 1, 2, 5, 6, 2, 3, 4, 5, 27, 26, 29, 28, 26, 25, 30, 29, 25, 24, 31, 30, 0, 1, 9, 8, 1, 2, 10, 9, 2, 3, 11, 10, 3, 4, 12, 11, 4, 5, 13, 12, 5, 6, 14, 13, 6, 7, 15, 14, 7, 0, 8, 15, 8, 9, 17, 16, 10, 11, 19, 18, 11, 12, 20, 19, 12, 13, 21, 20, 13, 14, 22, 21, 14, 15, 23, 22, 15, 8, 16, 23, 16, 17, 25, 24, 17, 18, 26, 25, 18, 19, 27, 26, 19, 20, 28, 27, 20, 21, 29, 28, 21, 22, 30, 29, 22, 23, 31, 30, 23, 16, 24, 31]
            rel material:binding = </materials/defaultMaterial>
            uniform token orientation = "rightHanded"
            point3f[] points = [(0, 0, 0), (0, 0, 10), (0, 0, 20), (0, 0, 30), (-50, 0, 30), (-50, 0, 20), (-50, 0, 10), (-50, 0, 0), (0, 10, 0), (0, 10, 10), (0, 10, 20), (0, 10, 30), (-50, 10, 30), (-50, 10, 20), (-50, 10, 10), (-50, 10, 0), (0, 20, 0), (0, 20, 10), (0, 20, 20), (0, 20, 30), (-50, 20, 30), (-50, 20, 20), (-50, 20, 10), (-50, 20, 0), (0, 30, 0), (0, 30, 10), (0, 30, 20), (0, 30, 30), (-50, 30, 30), (-50, 30, 20), (-50, 30, 10), (-50, 30, 0)]
            uniform token subdivisionScheme = "none"
        }
    }
    
    def Camera "camera"
    {
        float2 clippingRange = (0.1, 10000000)
        float focalLength = 5
        float focusDistance = 5
        float horizontalAperture = 19.2
        float verticalAperture = 10.8
        matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 15, 30, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }
    
    def "materials"
    {
        def Material "defaultMaterial"
        {
            token outputs:surface.connect = </materials/defaultMaterial/default_usdpreviewsurface.outputs:surface>
    
            def Shader "default_usdpreviewsurface"
            {
                uniform token info:id = "UsdPreviewSurface"
                float inputs:clearcoatRoughness = 0.1
                color3f inputs:diffuseColor = (0.8, 0.8, 0.8)
                float inputs:roughness = 0.2
                color3f inputs:specularColor = (1, 1, 1)
                token outputs:surface
            }
        }
    }
    
    def RectLight "area01"
    {
        float inputs:exposure = 1
        float inputs:height = 1
        float inputs:intensity = 1
        float inputs:width = 5
        float xformOp:rotateX = -90
        double3 xformOp:translate = (-10, 20, 1)
        uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateX"]
    }
    
    def RectLight "area02"
    {
        float inputs:exposure = 1
        float inputs:height = 1
        float inputs:intensity = 1
        float inputs:width = 5
        float xformOp:rotateX = -90
        double3 xformOp:translate = (-20, 20, 1)
        uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateX"]
    }
    
    def RectLight "area03"
    {
        float inputs:exposure = 1
        float inputs:height = 1
        float inputs:intensity = 1
        float inputs:width = 5
        float xformOp:rotateX = -90
        double3 xformOp:translate = (-30, 20, 1)
        uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateX"]
    }
    
    def DomeLight "light_dome"
    {
        float inputs:exposure = 1
        float inputs:intensity = 1
    }
    
    def DistantLight "light_distant"
    {
        custom float houdini:guidescale = 10
        float inputs:exposure = 1
        float inputs:intensity = 1
        bool inputs:normalize = 1
        float xformOp:rotateY = 90
        float xformOp:rotateZ = 45
        uniform token[] xformOpOrder = ["xformOp:rotateZ", "xformOp:rotateY"]
    }
    
    def "Render"
    {
        def RenderVar "var"
        {
            uniform token dataType = "color4f"
            custom string driver:parameters:aov:channel_prefix = ""
            custom int driver:parameters:aov:clearValue = 0
            custom token driver:parameters:aov:format = "color4f"
            custom bool driver:parameters:aov:multiSampled = 0
            custom string driver:parameters:aov:name = "Beauty"
            custom bool driver:parameters:aov:vray:color:color_mapping = 1
            custom bool driver:parameters:aov:vray:color:consider_for_aa = 0
            custom bool driver:parameters:aov:vray:color:denoise = 0
            custom bool driver:parameters:aov:vray:color:derive_raw_channels = 1
            custom bool driver:parameters:aov:vray:color:enableDeepOutput = 0
            custom bool driver:parameters:aov:vray:color:filtering = 1
            uniform string sourceName = "C.*"
            uniform token sourceType = "lpe"
        }
    
        def RenderProduct "product"
        {
            uniform token aspectRatioConformPolicy = "expandAperture"
            rel camera = </camera>
            uniform float4 dataWindowNDC = (0, 0, 1, 1)
            custom bool includeAovs = 1
            uniform bool instantaneousShutter = 0
            rel orderedVars = </Render/var>
            uniform float pixelAspectRatio = 1
            uniform token productType = "raster"
            uniform int2 resolution = (1920, 1080)
        }
    
        def RenderSettings "rendersettings"
        {
            uniform token aspectRatioConformPolicy = "expandAperture"
            rel camera = </camera>
            uniform float4 dataWindowNDC = (0, 0, 1, 1)
            uniform token[] includedPurposes = ["default"]
            uniform bool instantaneousShutter = 0
            uniform float pixelAspectRatio = 1
            rel products = </Render/product>
            uniform int2 resolution = (1920, 1080)
            custom float vray:SettingsImageSampler_progressive_maxTime = 1
        }
    }

    Cheers!

  • #2
    Repro-steps are:
    - copy&paste that text in a usda file
    - open Houdini-20.5
    - Add the file in a Sublayer node
    - switch to the /camera view in the viewport
    - compare HoudiniVK/Karma/VRay

    Comment


    • #3
      Hey paolo_selva1 ,

      Could you please share your exact V-Ray build version (found under top menu -> V-Ray -> About V-Ray).
      I attempted the steps described on my end, and the result between Vulkan and V-Ray, with respect to the FOV, seems to be the same on my end. Screenshots are below (I've disabled all lights to speed up the render).

      Best regards!
      Attached Files
      gosho.genchev@chaosgroup.com

      Comment


      • #4
        Hi Gosho.Genchev,

        thanks for testing it and sorry, yeah, I've forgot the versions.
        One other thing to confirm is to make sure you are using the RenderSettings from the stage, and not the ViewportSettings as there is a bit of a different behaviour there.
        Anyway, versions and how it renders for me, in the attached images.

        Cheers!

        Attached Files

        Comment


        • #5
          Just checking to see if you were able to reproduce it Gosho.Genchev ?
          Happy to provide more details if needed.
          Thanks for your time.

          Cheers!

          Comment


          • #6
            Hello paolo_selva1 ,

            Yes, and thank you for the build number. Indeed the problem is reproducible for me with the nightly builds from Oct. 25. The problem was logged under HOU-4471, and fixed in the nightly builds starting Nov. 04.
            If possible, please grab a recent nightly build as we had to fix a few regressions over the past couple of weeks.

            Best regards!
            gosho.genchev@chaosgroup.com

            Comment


            • #7
              Thank you!

              Comment

              Working...
              X