[opensource-dev] Review Request: STORM-1823 - Replace current specular model with Normalized Blinn-Phong specularity

4 views
Skip to first unread message

Geenz Spad

unread,
Mar 21, 2012, 11:35:51 AM3/21/12
to Geenz Spad, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer.
By Geenz Spad.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance
Bugs: STORM-1823

Diffs

  • indra/newview/app_settings/settings.xml (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/settings.xml (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • doc/contributions.txt (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/llviewercontrol.cpp (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/pipeline.h (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/pipeline.cpp (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/pipeline.cpp (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)
  • indra/newview/pipeline.cpp (51b2fd52e36aab8f670e0874e7e1472434ec4b4a)

View Diff

Geenz Spad

unread,
Mar 21, 2012, 1:42:31 PM3/21/12
to Geenz Spad, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer.
By Geenz Spad.

Updated March 21, 2012, 10:42 a.m.

Changes

Added a link to the latest builds of these changes.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing (updated)

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html

Geenz Spad

unread,
Mar 21, 2012, 4:01:21 PM3/21/12
to Geenz Spad, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer.
By Geenz Spad.

Updated March 21, 2012, 1:01 p.m.

Changes

Updated the diff to generally be cleaner, consolidating all changes into a single diff.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs (updated)

  • doc/contributions.txt (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/settings.xml (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/llviewercontrol.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.h (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)

View Diff

Argent Stonecutter

unread,
Mar 22, 2012, 4:57:57 AM3/22/12
to Geenz Spad, Viewer

On 2012-03-21, at 12:42, Geenz Spad wrote:
>
> 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.

Could we see some examples of SL scenes using the two models, because there have been a number of changes to the SL renderer over the years... and the main effect of increasing the "realism" of the renderer has been to throw the deficiencies of the SL avatar mesh into sharp relief. The current specular model was a deliberate compromise.

_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Cindy Chidester

unread,
Mar 24, 2012, 2:29:17 PM3/24/12
to Cindy Chidester, Geenz Spad, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Ship it!

Been running with this patch for about two days with no negative effect. Performance is more or less the same with much improved visuals, exceptionally well in bright lit areas (where previously, the light would almost wash out my avatar in white light)

- Cindy


On March 21st, 2012, 1:01 p.m., Geenz Spad wrote:

Review request for Viewer.
By Geenz Spad.

Updated March 21, 2012, 1:01 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Tofu Buzzard

unread,
Mar 25, 2012, 5:55:50 AM3/25/12
to Tofu Buzzard, Geenz Spad, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

I'd like to see the mis-named handleReleaseLUTBufferChanged be called handleLUTBufferChanged, and ideally I'd like some comment (probably in the LUT creation) about why the results of lookups should be multiplied by 4 (to avoid saturation in the LUT?).
Otherwise, I reckon this is great.

- Tofu


On March 21st, 2012, 1:01 p.m., Geenz Spad wrote:

Review request for Viewer.
By Geenz Spad.

Updated March 21, 2012, 1:01 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Oz Linden

unread,
Mar 25, 2012, 2:06:56 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 11:06 a.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Oz Linden

unread,
Mar 25, 2012, 2:08:15 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

On March 25th, 2012, 2:55 a.m., Tofu Buzzard wrote:

I'd like to see the mis-named handleReleaseLUTBufferChanged be called handleLUTBufferChanged, and ideally I'd like some comment (probably in the LUT creation) about why the results of lookups should be multiplied by 4 (to avoid saturation in the LUT?).
Otherwise, I reckon this is great.
I concur with both of these comments, and have asked for a review from Dave.

- Oz


On March 25th, 2012, 11:06 a.m., Geenz Spad wrote:

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 11:06 a.m.

Description

Geenz Spad

unread,
Mar 25, 2012, 5:07:49 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 2:07 p.m.

Changes

Added more information as to why we multiply in our shaders, and why we're scaling our results by (1.f / 6) in our LUT creation.
Also renamed handleReleaseLUTBufferChanged to handleLUTBufferChanged, per Tofu's request.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs (updated)

  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/llviewercontrol.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)

View Diff

Geenz Spad

unread,
Mar 25, 2012, 5:10:29 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

On March 25th, 2012, 2:55 a.m., Tofu Buzzard wrote:

I'd like to see the mis-named handleReleaseLUTBufferChanged be called handleLUTBufferChanged, and ideally I'd like some comment (probably in the LUT creation) about why the results of lookups should be multiplied by 4 (to avoid saturation in the LUT?).
Otherwise, I reckon this is great.

On March 25th, 2012, 11:08 a.m., Oz Linden wrote:

I concur with both of these comments, and have asked for a review from Dave.
The reasoning for doing this is basically just as you said, to avoid saturation in the LUT since most energy conserving specular models tend to exceed a floating point range of 0 to 1, something that should be accounted for when storing the results in an R8 LUT.
Granted, one could just use a floating point LUT instead, but driver support can be a bit spotty for R16F and R32F.  However, storing in an R16F LUT is something to look into in the future regardless if only to reduce banding.
Scaling by 6 allows us to get a bit more of a higher range (same scale used by RGBM encoding), though whether or not it's really necessary is something potentially worth investigating.

- Geenz


On March 25th, 2012, 2:07 p.m., Geenz Spad wrote:

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 2:07 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/llviewercontrol.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)

View Diff

Argent Stonecutter

unread,
Mar 25, 2012, 5:56:22 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Could we see some examples of SL scenes using the two models, particularly with avatars in them, because there have been a number of changes to the SL renderer over the years... and the main effect of increasing the "realism" of the renderer has been to throw the deficiencies of the SL avatar mesh into sharp relief. The current specular model was a deliberate compromise between the older even-toonier renderer and a more "realistic" model that made avatars look horrible.

- Argent


On March 25th, 2012, 2:07 p.m., Geenz Spad wrote:

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 2:07 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Geenz Spad

unread,
Mar 25, 2012, 6:36:38 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

On March 25th, 2012, 2:56 p.m., Argent Stonecutter wrote:

Could we see some examples of SL scenes using the two models, particularly with avatars in them, because there have been a number of changes to the SL renderer over the years... and the main effect of increasing the "realism" of the renderer has been to throw the deficiencies of the SL avatar mesh into sharp relief. The current specular model was a deliberate compromise between the older even-toonier renderer and a more "realistic" model that made avatars look horrible.
Avatars are only ever effected if they're using attachments that make sure of the shiny attribute.

The diffuse shading on avatars remains unaffected.  I think the "compromise" you're thinking of is the environment map that typically gets applied in classic forward rendering, which was later re-added to the deferred renderer to mitigate content breakage that resulted when it was removed, which hasn't been changed with my modifications.

As I had mentioned previously, there are comparison pictures posted on the JIRA that everyone can see, and I would also very much appreciate it if people could post their own comparisons, and identify any in-world content breakage that relied on the previous model that was used.

- Geenz

Tofu Buzzard

unread,
Mar 25, 2012, 6:39:54 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Ship it!

4 -> 6 is a bit of a last-minute change... :3  But ship it.

- Tofu


On March 25th, 2012, 2:07 p.m., Geenz Spad wrote:

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 2:07 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Geenz Spad

unread,
Mar 25, 2012, 6:49:57 PM3/25/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

On March 25th, 2012, 3:39 p.m., Tofu Buzzard wrote:

4 -> 6 is a bit of a last-minute change... :3  But ship it.
Mostly just using an idea I got from reading up on RGBM encoding, and why they scale by 6 as well (though really, in theory you could scale by pretty much any value so long as both the encode and decode use the same scales).  Seems to work quite well, especially since medium shiny seems to have slightly less saturation induced artifacting. :3

- Geenz

Oz Linden

unread,
Mar 26, 2012, 12:10:44 PM3/26/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Ship it!

indra/newview/pipeline.cpp (Diff revision 3)
void LLPipeline::createLUTBuffers()
1188
					spec *= (((n + 2) * (n + 4)) / (8 * 3.14159f * (powf(2, -n/2) + n)));
1188
					spec *= (((n + 2) * (n + 4)) / (8 * 3.14159f * (powf(2, -n/2) + n)));
Use F_PI here (yes, I know that was in the old code too)

- Oz


On March 25th, 2012, 2:07 p.m., Geenz Spad wrote:

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 25, 2012, 2:07 p.m.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs

Geenz Spad

unread,
Mar 26, 2012, 1:46:07 PM3/26/12
to David Parks, Viewer
This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/565/

Review request for Viewer and David Parks.
By Geenz Spad.

Updated March 26, 2012, 10:46 a.m.

Changes

Added the change that Oz requested, also updated contributions.txt while I was at it.

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))
Where 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 can be found in the JIRA.
Repository can be found here: https://bitbucket.org/Geenz/viewer-nbp

Testing

* Tested performance characteristics - both Normalized Blinn-Phong and the previous model seem to have the same performance
* Checked the perceived "brightness" of the new highlights vs. the old ones - new ones seem much brighter at higher shiny values than the old ones, and seem much less "cartoonish" as such
* Checked the impact on different bumpiness values at the test rig at Hippo Hollow - noticeable visual improvement across all objects (though low shiny seems to have a much more subtle light reflectance term - this is expected for normalized blinn-phong)
* Tested different LUT resolutions - best looking seems to be 512x128 with seemingly no measurable decrease in performance

You can find the latest build here: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oz_project-8/rev/251711/index.html
Bugs: STORM-1823

Diffs (updated)

  • doc/contributions.txt (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/settings.xml (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/llviewercontrol.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.h (b32595c5170f92ac2dbab635955b1b86634f1475)
  • indra/newview/pipeline.cpp (b32595c5170f92ac2dbab635955b1b86634f1475)

View Diff

Reply all
Reply to author
Forward
0 new messages