Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86711

DefaultMaterial's specularRoughness default value is not within the range specified in DefaultMaterialSection.qml

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.2
    • 5.15.1
    • Quick: 3D
    • None
    • 1

    Description

      DefaultMaterial's specularRoughness default value (50) is not within the range specified in DefaultMaterialSection.qml [0.001, 1]. Either the range is incorrect, or the default value is. Since the range is not documented, only clue for valid range is how it's used in the code. Here's the snippet from defaultMaterialLighting.glslib:

      vec3 calculateSpecularAddition( vec3 lightDir, vec3 normalDir, vec3 viewVec, vec3 lightSpecularColor, float specularAmount
                                      , float specularRoughness, vec2 lightParameters )
      {
          vec3 reflection = normalize( 2.0 * lightParameters.x * normalDir + lightDir );
          return ( lightParameters.y * specularAmount * lightSpecularColor * pow( clamp( dot( reflection, viewVec ), 0.0, 1.0 ), specularRoughness ) );
      } 

      Looks like specularRoughness is used as exponent in pow() function, so 50 seems pretty extreme at first glance.

      Also, the stepSize in DefaultMaterialSection.qml is not specified, so it uses step size of 1, which is obviously not correct for the given range. If the range is correct, more reasonable stepSize should be specified.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            janichol Andy Nichols
            e0348803 Miikka Heikkinen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes