STORM-1823 - Replace current specular model with Normalized Blinn-Phong specularity
Review Request #565 - Created March 21, 2012 and submitted
Geenz Spad | Reviewers | ||
viewer | |||
STORM-1823 | davep | ||
None | viewer-beta |
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
* 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/latest.html
Review request changed
Updated (March 21, 2012, 10:42 a.m.)
-
* 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
* 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
Added a link to the latest builds of these changes.
Review request changed
Updated (March 21, 2012, 1:01 p.m.)
-
- added Diff r2
Updated the diff to generally be cleaner, consolidating all changes into a single diff.
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)
Posted (March 25, 2012, 2:55 a.m.)
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.
Review request changed
Updated (March 25, 2012, 11:06 a.m.)
-
- added davep
Review request changed
Updated (March 25, 2012, 2:07 p.m.)
-
- added Diff r3
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.
Posted (March 25, 2012, 2:56 p.m.)
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.
4 -> 6 is a bit of a last-minute change... :3 But ship it.
-
indra/newview/pipeline.cpp (Diff revision 3) -
Use F_PI here (yes, I know that was in the old code too)
Review request changed
Updated (March 26, 2012, 10:46 a.m.)
-
- added Diff r4
Added the change that Oz requested, also updated contributions.txt while I was at it.
Review request changed
Updated (March 26, 2012, 5:24 p.m.)
-
- added Diff r5
Reduce the overall glow amount from the sun to a quarter of its original strength. This helps prevent specular highlights with glow applied from being too bright when compared to the previous specular model.
Review request changed
Updated (March 27, 2012, 9:54 a.m.)
-
* 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
* 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/latest.html
Updated build link.
Ship It!
Review request changed
Updated (April 9, 2012, 9:59 a.m.)
- changed from pending to submitted
Other reviews