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

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.1
    • Fix Version/s: 6.1
    • Component/s: Quick: 3D
    • Labels:
      None
    • Story Points:
      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

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes