Uploaded image for project: 'Snowstorm'
  1. Snowstorm
  2. STORM-1823

Replace current specular model with Normalized Blinn-Phong specularity

    Details

    • Type: Story
    • Status: Closed
    • Priority: Major
    • Resolution: Released
    • Affects Version/s: None
    • Fix Version/s: Active
    • Environment:
      CPU: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz (2666 MHz)
      Memory: 12288 MB
      OS Version: Mac OS X 10.7.3 Darwin 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64

      Description

      For a while now, Second Life's deferred renderer has had a somewhat "toonish" looking specular model, as opposed to other platforms which try to go for more physically accurate looking models, such as blinn-phong and similar.

      This feature changes the specular model to a technique called normalized blinn-phong. The specular model applies the usual blinn-phong term (assume NdotV to the power of n), multiplied by a normalization function of:
      ((n + 2) * (n + 4)) / (8 * PI * (powf(2, -n/2) + n))
      Assume n is the specular exponent.

      Gamma correction is also applied to the result to bring the visual results more in line with what you see in high end game engines such as Unreal Engine 3 and Frostbite 2, and stored in a lookup texture.

      Test Plan:

      • Log in with normal viewer
      • Enable Lighting and Shadows in the graphics preferences
      • Visit http://maps.secondlife.com/secondlife/Hippo%20Hollow/155/110/23
      • Look at the different spheres with different lighting conditions and shiny values applied
        • Best viewed with sky set to "Midnight"
      • Take screen shots showing the "old" shiny
      • Log in with viewer with "new" normalized blinn-phong shiny
      • Repeat the steps above, comparing the screenshots of the "old" shiny with the "new" shiny
      • Compare the two under different lighting conditions. Click each light source to turn it on or off to do so, and set the sky to different presets.
      • Bonus points: Check for content breakage due to the change in specular model.

      Expected results: The new shiny should seem "softer" at low shiny, and both brighter and smaller at high shiny. Performance should not degrade when compared to a compiled vanilla viewer using viewer-release as the codebase. Performance should stay the same between the two.

      Repository for these changes can be found here: https://bitbucket.org/Geenz/viewer-nbp

      Note about tweaking the effect: Use the "RenderSpecularExponent" debug setting to tweak the maximum exponent for specular highlights. Note that you will need a higher exponent than most other specular models, typically somewhere in the 300 to 500 range.

        Attachments

        1. Avatar New Specular Model.png
          Avatar New Specular Model.png
          479 kB
        2. Avatar Old Specular Model.png
          Avatar Old Specular Model.png
          365 kB
        3. Deshima Legacy CIC - New Specular.png
          Deshima Legacy CIC - New Specular.png
          1.94 MB
        4. Deshima Legacy CIC - Old Specular.png
          Deshima Legacy CIC - Old Specular.png
          1.55 MB
        5. Deshima New Specular Model.png
          Deshima New Specular Model.png
          2.22 MB
        6. Deshima Old Specular Model.png
          Deshima Old Specular Model.png
          1.73 MB
        7. New Specular Model.png
          New Specular Model.png
          2.81 MB
        8. Normalized Blinn-Phong.png
          Normalized Blinn-Phong.png
          3.32 MB
        9. Old Shiny.png
          Old Shiny.png
          2.64 MB
        10. Old Specular Model.png
          Old Specular Model.png
          2.51 MB
        11. Updated Test Rig.png
          Updated Test Rig.png
          1.90 MB

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                geenz.spad Geenz Spad
                Extended Group Visibility:
                jira-users
              • Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: