Difference between revisions of "Deferred Rendering Test"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with 'Category:Test Plans === Overview === The goal is to ship a new, additional rendering mode for not-old graphics cards that greatly improves the '''quality''' of the in-world ...')
 
 
(36 intermediate revisions by 2 users not shown)
Line 11: Line 11:


System requirements:
System requirements:
* Windows (or Linux).  Support for Mac is NOT a requirement.
* Supported on all viewer platforms; Linux, Mac, Windows.
* A not-old graphics card:
* A not-old graphics card:
** For the initial release, GeForce 8600 and 8800, GTX 2xx, and Radeon HD 4xxxx in Windows XP and Vista are good test targets.  ATI support on linux is optional, nVidia (8600+) cards on Linux with the official nVidia drivers are expected to work equivalently to Windows but it is not essential to test this configuration.
** For the initial release, GeForce 8600 and 8800, GTX 2xx, and Radeon HD 4xxxx in Windows XP and Vista are good test targets.  ATI support on linux is optional, nVidia (8600+) cards on Linux with the official nVidia drivers are expected to work equivalently to Windows but it is not essential to test this configuration.
** A relatively old graphics card which does not support this rendering mode will still entirely function as before - it will simply have the corresponding preference option(s) grayed-out.
** A relatively old graphics card which does not support this rendering mode will still entirely function as before - it will simply have the corresponding preference option(s) grayed-out.


== Deferred rendering prefs UI ==
== Deferred rendering prefs UI ==
[[Image:Prefs.png]]
[[Image:Prefs3.png]]
* New toggle option: "Lighting and Shadows" (should be greyed-out if "Atmospheric Shaders" is unchecked; may also be greyed-out on unsupported hardware)
* Toggle option: "Advanced Lighting Model" (should be greyed-out if "Atmospheric Shaders" is unchecked; should be greyed-out if "Hardware Skinning" is unchecked; may also be greyed-out on unsupported hardware)
* New toggle option: "Ambient Occlusion" (should be greyed-out if "Lighting and Shadows" is unchecked)
* Toggle option: "Ambient Occlusion" (should be greyed-out if "Advanced Lighting Model" is unchecked)
* New drop-down option: "Shadows:" (should be greyed-out if "Lighting and Shadows" is unchecked); available options should be "None", "Sun/Moon", "Sun/Moon + Projectors".
* Toggle option: "Depth of Field" (should be greyed-out if "Advanced Lighting Model" is unchecked)
* Drop-down option "Water Reflections:" replaces viewer 2.0 radio buttons with the same effect (should be greyed-out if "Basic shaders" is unchecked); available options should be "Minimal", "Terrain and Trees", "All static objects", "All avatars and objects", "Everything".
* Drop-down option: "Shadows:" (should be greyed-out if "Advanced Lighting Model" is unchecked); available options should be "None", "Sun/Moon", "Sun/Moon + Projectors".
* Drop-down option "Water Reflections:" (should be greyed-out if "Basic shaders" is unchecked); available options should be "Minimal", "Terrain and Trees", "All static objects", "All avatars and objects", "Everything".


== Deferred rendering - general ==
== Deferred rendering - general ==
* Turn on 'Lighting and Shadows', in 'Shadows:' select 'None'
* Turn on 'Advanced Lighting Model', in 'Shadows:' select 'None'
** ''Broadly-speaking'', viewing random existing in-world content in this 'Lighting and Shadows' mode should look very similar to toggling 'Lighting and Shadows' off, except it should look... better.  Better means:
** ''Broadly-speaking'', viewing random existing in-world content in this 'Advanced Lighting Model' mode should look very similar to toggling 'Advanced Lighting Model' off, except it should look... better.  Better means:
*** A bit smoother lighting from sun, moon, and local lights
*** A bit smoother lighting from sun, moon, and local lights
*** Shiny on non-fullbright surfaces should look different (more testing in a later section)
*** Shiny on non-fullbright surfaces should look different (more testing in a later section)
Line 34: Line 33:
*** Avatar imposters are now lit very similarly to non-imposters
*** Avatar imposters are now lit very similarly to non-imposters
*** Otherwise, there is no expected outright content breakage in this mode.
*** Otherwise, there is no expected outright content breakage in this mode.
** In this mode, all of the following should behave as historically expected, i.e. very similarly to when 'Lighting and Shadows' is off, per general render testing:
** In this mode, all of the following should behave as historically expected, i.e. very similarly to when 'Advanced Lighting Model' is off, per general render testing:
*** Avatar clothing, non-prim hair and skirts
*** Avatar clothing, non-prim hair and skirts
*** Fullbright faces
*** Fullbright faces
Line 47: Line 46:


== Deferred rendering - shiny ==
== Deferred rendering - shiny ==
* Fullbright shiny objects should render exactly as with 'Lighting and Shadows' turned off
* Fullbright shiny objects should render exactly as with 'Advanced Lighting Model' turned off
* Non-fullbright shiny objects should have the following visual properties of shininess:
* Non-fullbright shiny objects should have the following visual properties of shininess:
** A reflected specular 'spot' from the sun or moon (when above horizon); the higher the shiny level, the tighter-and-brighter the spot.
** A reflected specular 'spot' from the sun or moon (when above horizon); the higher the shiny level, the tighter-and-brighter the spot. Example at http://maps.secondlife.com/secondlife/Bug%20Island%202/246/200/23
[[Image:Shinylevels100.png]]
[[Image:Shinylevels100.png]]
** Reflected specular spot(s) from nearby local lights; the higher the shiny level, the tighter-and-brighter the spot.
** Reflected specular spot(s) from nearby local lights; the higher the shiny level, the tighter-and-brighter the spot. Example at http://maps.secondlife.com/secondlife/Bug%20Island%202/195/238/23
[[Image:Localshinies.png]]
[[Image:Localshinies.png]]
* Reflections on water should generally behave like reflections on shiny faces (specular spots from nearby local lights and sun/moon).  These reflections are in addition to - and thus affect - all 'Water reflections' preferences which should otherwise all behave very similarly to their historic counterparts (reflecting terrain, avatars etc. in the water).
* Reflections on water should generally behave like reflections on shiny faces (specular spots from nearby local lights and sun/moon).  These reflections are in addition to - and thus affect - all 'Water reflections' preferences which should otherwise all behave very similarly to their historic counterparts (reflecting terrain, avatars etc. in the water). Example at http://maps.secondlife.com/secondlife/Bug%20Island%202/114/117/21
[[Image:Waterref.png]]
[[Image:Waterref.png]]


== Deferred rendering - bumpiness ==
== Deferred rendering - bumpiness ==
* Fullbright bumpy objects should render exactly as with 'Lighting and Shadows' turned off (''hmm, they don't seem to - they don't seem to show any bumpyness - this is probably a bug'')
* Fullbright bumpy objects should render exactly as with 'Advanced Lighting Model' turned off.
* Non-fullbright bumpy objects should have the following visual properties of bumpiness:
* Non-fullbright bumpy objects should have the following visual properties of bumpiness:
** Realistic lighting for the depth-like roughness detail of the bump texture, according to sun/moon direction and the direction and influence of any local lights:
** Realistic lighting for the depth-like roughness detail of the bump texture, according to sun/moon direction and the direction and influence of any local lights. Example at http://maps.secondlife.com/secondlife/Bug%20Island%202/202/236/23
[[Image:Bumpgeneral.png]]
[[Image:Bumpgeneral.png]]
** Non-fullbright bumpy shiny objects should have these bumpy properties *plus* have the properties of shiny objects according to the ''''Deferred rendering - shiny'''' section above; in addition, their shiny properties should be realistically perturbed by the bumpiness.  See below screenshot for example.
[[Image:Shinybump.png]]


== Deferred rendering - shadows / ambient occlusion ==
== Deferred rendering - shadows / ambient occlusion ==
Line 68: Line 65:
* The 'Ambient Occlusion' toggle and the 'Shadows' dropdown may be used independently.
* The 'Ambient Occlusion' toggle and the 'Shadows' dropdown may be used independently.
** Enabling 'Ambient Occlusion' should cause a rather subtle darkening of nooks and crannies in shapes.
** Enabling 'Ambient Occlusion' should cause a rather subtle darkening of nooks and crannies in shapes.
*** See example at http://maps.secondlife.com/secondlife/Bug%20Island%202/216/245/23
** Setting 'Shadows' to 'Sun/Moon' should cause all qualifying objects (details further down!) to cast shadows and have shadows cast upon them.
** Setting 'Shadows' to 'Sun/Moon' should cause all qualifying objects (details further down!) to cast shadows and have shadows cast upon them.
[[Image:Shadall400.png]]
[[Image:Shadows-ambient occlusion3.jpg]]
 
 
** Enabling 'Ambient Occlusion' '''and''' setting 'Shadows' to 'Sun/Moon' should simultaneously exhibit both effects, with the ''added effect'' that shadows are now smoother/softer/blurrier.
** Enabling 'Ambient Occlusion' '''and''' setting 'Shadows' to 'Sun/Moon' should simultaneously exhibit both effects, with the ''added effect'' that shadows are now smoother/softer/blurrier.
[[Image:Aooffon.png]]
[[Image:Aooffon.png]]


=== Casting and receiving shadow ===
=== Casting and receiving shadow ===
Example content at http://maps.secondlife.com/secondlife/Bug%20Island%202/209/235/23
Set your World -> Environment Editor -> Environment Setting... -> Fixed sky -> A-3PM to approximate the sun position in the following images.
Shadows should be cast in a direction opposite to the location of the sun (or moon) in the sky, i.e. realistically.  If there is no sun or moon above the horizon, then effectively the whole world is in shadow and you won't see a clear shadow at all.
Shadows should be cast in a direction opposite to the location of the sun (or moon) in the sky, i.e. realistically.  If there is no sun or moon above the horizon, then effectively the whole world is in shadow and you won't see a clear shadow at all.


Line 81: Line 85:
A = avatar
A = avatar
B = opaque object
B = opaque object
C = 30% transparency
C = 11% transparency
D = 60% transparency
D = 60% transparency
E = 80% transparency
E = 96% transparency
F = opaque fullbright object
F = opaque fullbright object
G = alpha texture (per-pixel transparency)
G = alpha texture (per-pixel transparency)


==== Things that can cast shadows ====
==== Things that can cast solid shadows ====
* alpha pixels > 50% opaque
* alpha pixels <= 11% transparent
* fullbrights, glowies, sculpties, avatars, foliage, ground
* fullbrights, glowies, sculpties, avatars, foliage, ground
==== Things that can cast partial shadows ====
* alpha pixels => 12% and <= 96% transparent


==== Things that cannot cast shadows ====
==== Things that cannot cast shadows ====
* alpha pixels <50% opaque
* alpha pixels => 97% transparent
* impostered avatars
* impostered avatars
* particles
* particles
[[Image:Casters.png]]
[[Image:Casters2.png]]


==== Things that can receive shadows ====
==== Things that can receive shadows ====
Line 102: Line 109:
==== Things that cannot receive shadows ====
==== Things that cannot receive shadows ====
* fullbright surfaces (opaque or transparent)
* fullbright surfaces (opaque or transparent)
[[Image:Receivers.PNG]]
[[Image:Receivers2.png]]
 
==== Accepted weaknesses ====
==== Accepted weaknesses ====
* Sun/moon shadows cast ''onto'' partially-transparent/alpha faces ''may'' exhibit more blockiness than shadows cast onto normal opaque faces.
* Sun/moon shadows cast ''onto'' partially-transparent/alpha faces ''may'' exhibit more blockiness than shadows cast onto normal opaque faces.
Line 110: Line 118:


== Deferred rendering - legacy point-lights ==
== Deferred rendering - legacy point-lights ==
* With 'lighting and shadows' turned on, existing in-world lights should look quite similar to how they've historically looked (and continue to look, when 'lighting and shadows' is turned off), except:
 
[add lighting consistency test, which is built at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/174/23]
* With 'Advanced Lighting Model' turned on, existing in-world lights should look quite similar to how they've historically looked (and continue to look, when 'Advanced Lighting Model' is turned off), except:
** The generated light should generally look smoother (less triangular, less delineated, and more 'round' in its influence - see below screenshot for example)
** The generated light should generally look smoother (less triangular, less delineated, and more 'round' in its influence - see below screenshot for example)
** The generated light may appear brighter on surfaces close to the light source (see below screenshot for example)
** The generated light may appear brighter on surfaces close to the light source (see below screenshot for example)
** Lights whose areas of influence overlap may make that area seem lit ''much'' brighter than previously.
** Lights whose areas of influence overlap may make that area seem lit ''much'' brighter than previously.
** ''Every'' light in the scene will have a cumulative influence on lighting (not just the closest 6 lights)
** ''Every'' light in the scene will have a cumulative influence on lighting (not just the closest 6 lights)
* The above exceptions ''may'' not apply to lighting falling upon transparent or alpha-textured faces - faces with a lot of partial transparency should appear essentially identical (apart from shadows falling upon them) regardless of whether 'lighting and shadows' is turned on or off.
* The above exceptions ''may'' not apply to lighting falling upon transparent or alpha-textured faces - faces with a lot of partial transparency should appear essentially identical (apart from shadows falling upon them) regardless of whether 'Advanced Lighting Model' is turned on or off.
* The light attributes 'color', 'intensity', 'radius', and 'falloff' should affect lights in visually similar ways with 'lighting and shadows' on or off.
* The light attributes 'color', 'intensity', 'radius', and 'falloff' should affect lights in visually similar ways with 'Advanced Lighting Model' on or off.
[[Image:Pointlights.png]]
[[Image:Pointlights.png]]


== Deferred rendering - projector UI ==
== Deferred rendering - projector UI ==
* Editing/creating a light-source should be the same process and UI as Viewer 2.0, '''but''' extra lighting options are exposed in the build->Features tab if you have 'Lighting and shadows' turned on:
* Editing/creating a light-source should be the same process and UI as Viewer 2.0, '''but''' extra lighting options are exposed in the build->Features tab if you have 'Advanced Lighting Model' turned on:
[[Image:Lightopts.png]]
[[Image:Lightopts.png]]


The extra options are:
The extra options are:
* A new texture-chooser next to the light's color-chooser.  This defaults to 'no texture' (a grey box with an X through it).
* A new texture-chooser next to the light's color-chooser.  This defaults to 'no texture' (a grey box with an X through it).
* A 'FOV' entry (defaulting to 0.0)
* A 'FOV' entry (defaulting to 0.0) (changes to 1.571 after a texture is chosen)
* A 'Focus' entry (defaulting to 0.0)
* A 'Focus' entry (defaulting to 0.0)
* An 'Ambiance' entry (defaulting to 0.0)
* An 'Ambiance' entry (defaulting to 0.0)
Line 136: Line 146:


A light becomes a 'projector' as long as it has a texture assigned to it (from the texture-picker next to the color-picker in the light editor).
A light becomes a 'projector' as long as it has a texture assigned to it (from the texture-picker next to the color-picker in the light editor).
The features of projectors are only fully visibly supported when 'Lighting and shadows' is enabled (more details below).
The features of projectors are only fully visibly supported when 'Advanced Lighting Model' is enabled (more details below).
 
=== Projectors: 'Advanced Lighting Model' enabled ===
Example of projector at http://maps.secondlife.com/secondlife/Bug%20Island%202/89/148/31


=== Projectors: 'Lighting and shadows' enabled ===
A projector differs from a regular ('point') light in these significant ways:
A projector differs from a regular ('point') light in these significant ways:
* It respects the FOV, Ambiance and Focus attributes (more on these below).
* It respects the FOV, Ambiance and Focus attributes (more on these below).
Line 144: Line 156:
** The upshot of this is that the effect of a projector's light depends on the rotation of the object with the Light feature.
** The upshot of this is that the effect of a projector's light depends on the rotation of the object with the Light feature.
* Light emitted along the negative Z-axis of a projector will actually cause lit objects to cast shadows appropriately, according to the same caster/receiver rules as sun/moon shadows, but only if:
* Light emitted along the negative Z-axis of a projector will actually cause lit objects to cast shadows appropriately, according to the same caster/receiver rules as sun/moon shadows, but only if:
** the 'Shadows' preference is set to 'Sun/Moon + Projectors', '''and'''
** the projector in question is one of the top two most influential projectors in the scene ('influential' is a fuzzy metric, but basically 'closest to the avatar')
** the projector in question is one of the top two most influential projectors in the scene ('influential' is a fuzzy metric, but basically 'closest to the avatar')
* The light emitted along a projector's negative Z axis is itself textured (with the texture selected in the light section of the build->Feature tab, tinted with the color selected alongside it), effectively like a slide-projector.
* The light emitted along a projector's negative Z axis is itself textured (with the texture selected in the light section of the build->Feature tab, tinted with the color selected alongside it), effectively like a slide-projector.
* The scale of a prim with the Light feature proportionally affects the scale of the textured light projection from that object.
* The scale of a prim with the Light feature proportionally affects the scale of the textured light projection from that object.
==== Accepted Weaknesses ====
==== Accepted Weaknesses ====
Projectors ''may'' not project textures onto alpha/transparent faces which have partial transparency.  Such faces may be lit by the projector as if 'Lighting and Shadows' was disabled, as detailed in the below section "Projectors: 'Lighting and shadows' disabled (a.k.a. Spotlights)"
* Projectors ''may'' not project textures onto alpha/transparent faces which have partial transparency.  Such faces may be lit by the projector as if 'Advanced Lighting Model' was disabled, as detailed in the below section "Projectors: 'Advanced Lighting Model' disabled (a.k.a. Spotlights)"
 
* Invisaprims do not work with deferred rendering. The outfit from "My Inventory/Library/Clothing/Initial Outfits/Female Cosplay Outfit" is pictured. Use alpha masks from "My Inventory/Library/Body Parts/Alpha Masks" to hide body parts.
 
[[Image:Invisiprim+deferred_render.jpg]]
 
==== Projectors & Shiny ====
==== Projectors & Shiny ====
[[Image:Projref.png]]
[[Image:Projref.png]]
[ Test built at http://maps.secondlife.com/secondlife/Bug%20Island%202/247/156/23 ]


A projecting prim reflecting in a shiny surface should exhibit a reflection of the projecting prim's projected texture.  This should be increasingly sharper and brighter, the more shiny the reflecting surface is.
A projecting prim reflecting in a shiny surface should exhibit a reflection of the projecting prim's projected texture.  This should be increasingly sharper and brighter, the more shiny the reflecting surface is.
==== FOV ====
==== FOV ====
This defines the 'field of view' of the projector, ''in radians''.  This is the angular width of the cone of light projected.  The possible range of values from 0.0 to 3.0 correspond to widths from 0 degrees (''you can't see it - we should probably set this lower range to 0.001'') to approx 172 degrees (almost a hemisphere of influence).
This defines the 'field of view' of the projector, ''in radians''.  This is the angular width of the cone of light projected.  The possible range of values from 0.0 to 3.0 correspond to widths from 0 degrees (''you can't see it - we should probably set this lower range to 0.001'') to approx 172 degrees (almost a hemisphere of influence).
It is accepted that the fidelity of any shadows caused by a projector may degrade as the FOV becomes larger.
It is accepted that the fidelity of any shadows caused by a projector may degrade as the FOV becomes larger.
[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/64/23 ]


[[Image:Fov.jpg]]
[[Image:Fov.jpg]]
Line 162: Line 183:
==== Focus ====
==== Focus ====
A projected texture appears blurrier the further the projection point is from the projector.  The Focus value controls how attenuated this effect is.  Positive values keep the projection sharper for further, negative values make the projection start to blur at a closer range.
A projected texture appears blurrier the further the projection point is from the projector.  The Focus value controls how attenuated this effect is.  Positive values keep the projection sharper for further, negative values make the projection start to blur at a closer range.
[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/43/23 ]


[[Image:Focus.jpg]]
[[Image:Focus.jpg]]
==== Ambiance ====
==== Ambiance ====
This adds a very blurred version of the projected image to all faces within the cone of influence, regardless of even whether they are in shadow or facing away from the projector.  The goal is to very roughly simulate light influence which is being diffused in all directions by surfaces receiving a projected image.  Thus it is acceptable that this be even brighter on faces facing ''away'' from the projector.
This adds a very blurred version of the projected image to all faces within the cone of influence, regardless of even whether they are in shadow or facing away from the projector.  The goal is to very roughly simulate light influence which is being diffused in all directions by surfaces receiving a projected image.  Thus it is acceptable that this be even brighter on faces facing ''away'' from the projector.
The brightness of this effect should be proportional to the Ambiance value.  ''It is probably a bug that values from 0.5-1.0 seem to have no additional effect above the 0.5 value.''
The brightness of this effect should be proportional to the Ambiance value.  ''It is probably a bug that values from 0.5-1.0 seem to have no additional effect above the 0.5 value.''
[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/24/23 ]


[[Image:Amb.jpg]]
[[Image:Amb.jpg]]


=== Projectors: 'Lighting and shadows' ''disabled'' (a.k.a. Spotlights) ===
=== Projectors: 'Advanced Lighting Model' ''disabled''===
[[Image:Projdefndef.png]]


This should be tested with three levels of non-'Lighting and Shadows' shaders:
* When 'Advanced Lighting Model' is disabled, a projector behaves like a point light, it continues to obey the Color, Intensity, Radius, Falloff attributes of the light.
* No Shaders: 'basic shaders' turned off in prefs
* Basic Shaders: 'basic shaders' turned on in prefs, 'atmospheric shaders' turned off
* Atmospheric Shaders: 'atmospheric shaders' turned on in prefs, 'lighting and shadows' turned off
A light which was turned into a Projector with 'Lighting and shadows' enabled, appears thusly to users with 'Lighting and shadows' disabled:
* Like a point light and a projector, it continues to obey the Color, Intensity, Radius, Falloff attributes of the light.
* Like a projector, it casts its light in a cone along the prim's negative Z-axis (i.e. the light is ''directional'', and may be ''pointed at things'').
* Unlike a projector, it does not cast textured light, neither is it affected by the FOV, Focus or Ambiance attributes of the projector.
* Unlike a projector, the scale of the prim with the Light feature does not affect the output light
* Spotlights fall within the same limited pool of non-'Lighting and Shadow' lights; a maximum of 6 or 2 lights of any kind may be visible at any time, depending on hardware and shader level, as with Viewer 2.0.
 
''There is no UI for creating these 'Spotlights' if you can't turn on Lighting and Shadows.  This is a weakness and can probably be considered a bug.''


== Deferred rendering and Environment ==
== Deferred rendering and Environment ==
=== Atmospheric settings ===
=== Atmospheric settings ===
Atmospheric/Sky (aka WindLight) settings should function pretty much identically regardless of whether 'Lighting and Shadows' is enabled (they may be slightly better or otherwise more accurate when 'Lighting and Shadows' is enabled, but the difference is hardly noticeable if things are working right).
Atmospheric/Sky (aka WindLight) settings should function pretty much identically regardless of whether 'Advanced Lighting Model' is enabled (they may be slightly better or otherwise more accurate when 'Advanced Lighting Model' is enabled, but the difference is hardly noticeable if things are working right).
This can be tested by comparing the Environment Editor's sky presets in both modes (especially the more 'extreme' presets like Gelatto).
This can be tested by comparing the Environment Editor's sky presets in both modes (especially the more 'extreme' presets like Gelatto).


[[Image:Envboth475.jpg]]
[[Image:Envboth475.jpg]]
=== Water settings ===
=== Water settings ===
Although the overall appearance of water is a bit different with 'Lighting and Shadows' enabled, it should still respond similarly to all tweaks in the Advanced Water Settings section of the Environment Editor.
Although the overall appearance of water is a bit different with 'Advanced Lighting Model' enabled, it should still respond similarly to all tweaks in the Advanced Water Settings section of the Environment Editor.
This can be tested by comparing the Environment Editor's water presets in both modes.
This can be tested by comparing the Environment Editor's water presets in both modes.
===Antialiasing===
Antialiasing while Deferred rendering is enabled is supported on the following platforms [as of Nov 2011]:
* Windows + ATI
* Windows + Nvidia
* Mac + Nvidia
* Linux + Nvidia
Test:
# Enable Advanced Lighting Model and Antialiasing (Preferences > Graphics > Hardware > Antialiasing > 2x or greater) on those platforms.
# Restart the viewer
# '''Verify''' the edges of objects are antialiased.
[[Image:Antialiased_vs_aliased_2.png]]

Latest revision as of 15:03, 14 April 2017


Overview

The goal is to ship a new, additional rendering mode for not-old graphics cards that greatly improves the quality of the in-world visual experience and immersion. The two main features of this (optional) mode are support for real-time shadows and much-improved lighting.

Expectations:

  • There should be no negative impact on viewer speed, quality or compatibility if this mode is disabled.
  • It is expected that this mode be disabled by default on any hardware where this would cause the default frame-rate to become lower than (say) a typical 10FPS.
  • It is expected that enabling this mode lowers the frame-rate compared with turning it off.
  • Mild-to-moderate changes in the presentation of content - generally for the subjective better - are acceptable.

System requirements:

  • Supported on all viewer platforms; Linux, Mac, Windows.
  • A not-old graphics card:
    • For the initial release, GeForce 8600 and 8800, GTX 2xx, and Radeon HD 4xxxx in Windows XP and Vista are good test targets. ATI support on linux is optional, nVidia (8600+) cards on Linux with the official nVidia drivers are expected to work equivalently to Windows but it is not essential to test this configuration.
    • A relatively old graphics card which does not support this rendering mode will still entirely function as before - it will simply have the corresponding preference option(s) grayed-out.

Deferred rendering prefs UI

Prefs3.png

  • Toggle option: "Advanced Lighting Model" (should be greyed-out if "Atmospheric Shaders" is unchecked; should be greyed-out if "Hardware Skinning" is unchecked; may also be greyed-out on unsupported hardware)
  • Toggle option: "Ambient Occlusion" (should be greyed-out if "Advanced Lighting Model" is unchecked)
  • Toggle option: "Depth of Field" (should be greyed-out if "Advanced Lighting Model" is unchecked)
  • Drop-down option: "Shadows:" (should be greyed-out if "Advanced Lighting Model" is unchecked); available options should be "None", "Sun/Moon", "Sun/Moon + Projectors".
  • Drop-down option "Water Reflections:" (should be greyed-out if "Basic shaders" is unchecked); available options should be "Minimal", "Terrain and Trees", "All static objects", "All avatars and objects", "Everything".

Deferred rendering - general

  • Turn on 'Advanced Lighting Model', in 'Shadows:' select 'None'
    • Broadly-speaking, viewing random existing in-world content in this 'Advanced Lighting Model' mode should look very similar to toggling 'Advanced Lighting Model' off, except it should look... better. Better means:
      • A bit smoother lighting from sun, moon, and local lights
      • Shiny on non-fullbright surfaces should look different (more testing in a later section)
      • Any number of lights will now light the scene simultaneously (with some exceptions - more testing in a later section)
      • Increased accuracy in lighting means that a bright light near a surface may now light nearby points on that surface more intensely than previously
      • Avatar imposters are now lit very similarly to non-imposters
      • Otherwise, there is no expected outright content breakage in this mode.
    • In this mode, all of the following should behave as historically expected, i.e. very similarly to when 'Advanced Lighting Model' is off, per general render testing:
      • Avatar clothing, non-prim hair and skirts
      • Fullbright faces
      • Faces with transparency and/or alpha-textures
      • Animation textures
      • Faces with glow
      • Underwater scenes
      • Faces with bumpiness
      • Media textures / shared media
      • Underwater camera view
      • Combinations of any of the above

Deferred rendering - shiny

  • Fullbright shiny objects should render exactly as with 'Advanced Lighting Model' turned off
  • Non-fullbright shiny objects should have the following visual properties of shininess:

Shinylevels100.png

Localshinies.png

  • Reflections on water should generally behave like reflections on shiny faces (specular spots from nearby local lights and sun/moon). These reflections are in addition to - and thus affect - all 'Water reflections' preferences which should otherwise all behave very similarly to their historic counterparts (reflecting terrain, avatars etc. in the water). Example at http://maps.secondlife.com/secondlife/Bug%20Island%202/114/117/21

Waterref.png

Deferred rendering - bumpiness

  • Fullbright bumpy objects should render exactly as with 'Advanced Lighting Model' turned off.
  • Non-fullbright bumpy objects should have the following visual properties of bumpiness:

Bumpgeneral.png

Deferred rendering - shadows / ambient occlusion

Shadow preference settings

  • The 'Ambient Occlusion' toggle and the 'Shadows' dropdown may be used independently.

Shadows-ambient occlusion3.jpg


    • Enabling 'Ambient Occlusion' and setting 'Shadows' to 'Sun/Moon' should simultaneously exhibit both effects, with the added effect that shadows are now smoother/softer/blurrier.

Aooffon.png

Casting and receiving shadow

Example content at http://maps.secondlife.com/secondlife/Bug%20Island%202/209/235/23

Set your World -> Environment Editor -> Environment Setting... -> Fixed sky -> A-3PM to approximate the sun position in the following images.

Shadows should be cast in a direction opposite to the location of the sun (or moon) in the sky, i.e. realistically. If there is no sun or moon above the horizon, then effectively the whole world is in shadow and you won't see a clear shadow at all.

Note, it is expected and desired that an object (or twisted prim face, etc) which both casts and receives shadows may cast a shadow on itself. For example, an avatar's arm should cast a shadow on that avatar's leg, where appropriate.

Key to illustrations in this section: A = avatar B = opaque object C = 11% transparency D = 60% transparency E = 96% transparency F = opaque fullbright object G = alpha texture (per-pixel transparency)

Things that can cast solid shadows

  • alpha pixels <= 11% transparent
  • fullbrights, glowies, sculpties, avatars, foliage, ground

Things that can cast partial shadows

  • alpha pixels => 12% and <= 96% transparent

Things that cannot cast shadows

  • alpha pixels => 97% transparent
  • impostered avatars
  • particles

Casters2.png

Things that can receive shadows

  • avatars, glowies, sculpties, water, ground, foliage, impostered avatars

Things that cannot receive shadows

  • fullbright surfaces (opaque or transparent)

Receivers2.png

Accepted weaknesses

  • Sun/moon shadows cast onto partially-transparent/alpha faces may exhibit more blockiness than shadows cast onto normal opaque faces.
  • The 'ambient occlusion' preference may have no effect on partially-transparent/alpha faces.
  • Sun/moon shadow fidelity is not evenly distributed across the scene; shadows being cast onto faces far from the viewer may start to look increasingly blocky, also depending on camera angle and sun angle.
  • Faces which are far from the camera (approx 256 meters+) will not receive shadows. As they approach this distance, the received shadows should quickly fade away to zero effect. This can be tested by setting your draw distance to 300m and slowly pulling your camera back from the world by hundreds of meters.

Deferred rendering - legacy point-lights

[add lighting consistency test, which is built at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/174/23]

  • With 'Advanced Lighting Model' turned on, existing in-world lights should look quite similar to how they've historically looked (and continue to look, when 'Advanced Lighting Model' is turned off), except:
    • The generated light should generally look smoother (less triangular, less delineated, and more 'round' in its influence - see below screenshot for example)
    • The generated light may appear brighter on surfaces close to the light source (see below screenshot for example)
    • Lights whose areas of influence overlap may make that area seem lit much brighter than previously.
    • Every light in the scene will have a cumulative influence on lighting (not just the closest 6 lights)
  • The above exceptions may not apply to lighting falling upon transparent or alpha-textured faces - faces with a lot of partial transparency should appear essentially identical (apart from shadows falling upon them) regardless of whether 'Advanced Lighting Model' is turned on or off.
  • The light attributes 'color', 'intensity', 'radius', and 'falloff' should affect lights in visually similar ways with 'Advanced Lighting Model' on or off.

Pointlights.png

Deferred rendering - projector UI

  • Editing/creating a light-source should be the same process and UI as Viewer 2.0, but extra lighting options are exposed in the build->Features tab if you have 'Advanced Lighting Model' turned on:

Lightopts.png

The extra options are:

  • A new texture-chooser next to the light's color-chooser. This defaults to 'no texture' (a grey box with an X through it).
  • A 'FOV' entry (defaulting to 0.0) (changes to 1.571 after a texture is chosen)
  • A 'Focus' entry (defaulting to 0.0)
  • An 'Ambiance' entry (defaulting to 0.0)

The effects of these options are explained in the next section. 'FOV', 'Focus', and 'Ambiance' settings have no visible effect unless a texture is selected in the texture-chooser.

Deferred rendering - projectors

Proj.png

A light becomes a 'projector' as long as it has a texture assigned to it (from the texture-picker next to the color-picker in the light editor). The features of projectors are only fully visibly supported when 'Advanced Lighting Model' is enabled (more details below).

Projectors: 'Advanced Lighting Model' enabled

Example of projector at http://maps.secondlife.com/secondlife/Bug%20Island%202/89/148/31

A projector differs from a regular ('point') light in these significant ways:

  • It respects the FOV, Ambiance and Focus attributes (more on these below).
  • It does not cast light evenly in all directions; it only casts light along its negative Z-axis (i.e. the light is directional, and may be pointed at things).
    • The upshot of this is that the effect of a projector's light depends on the rotation of the object with the Light feature.
  • Light emitted along the negative Z-axis of a projector will actually cause lit objects to cast shadows appropriately, according to the same caster/receiver rules as sun/moon shadows, but only if:
    • the projector in question is one of the top two most influential projectors in the scene ('influential' is a fuzzy metric, but basically 'closest to the avatar')
  • The light emitted along a projector's negative Z axis is itself textured (with the texture selected in the light section of the build->Feature tab, tinted with the color selected alongside it), effectively like a slide-projector.
  • The scale of a prim with the Light feature proportionally affects the scale of the textured light projection from that object.

Accepted Weaknesses

  • Projectors may not project textures onto alpha/transparent faces which have partial transparency. Such faces may be lit by the projector as if 'Advanced Lighting Model' was disabled, as detailed in the below section "Projectors: 'Advanced Lighting Model' disabled (a.k.a. Spotlights)"
  • Invisaprims do not work with deferred rendering. The outfit from "My Inventory/Library/Clothing/Initial Outfits/Female Cosplay Outfit" is pictured. Use alpha masks from "My Inventory/Library/Body Parts/Alpha Masks" to hide body parts.

Invisiprim+deferred render.jpg

Projectors & Shiny

Projref.png

[ Test built at http://maps.secondlife.com/secondlife/Bug%20Island%202/247/156/23 ]

A projecting prim reflecting in a shiny surface should exhibit a reflection of the projecting prim's projected texture. This should be increasingly sharper and brighter, the more shiny the reflecting surface is.

FOV

This defines the 'field of view' of the projector, in radians. This is the angular width of the cone of light projected. The possible range of values from 0.0 to 3.0 correspond to widths from 0 degrees (you can't see it - we should probably set this lower range to 0.001) to approx 172 degrees (almost a hemisphere of influence). It is accepted that the fidelity of any shadows caused by a projector may degrade as the FOV becomes larger.

[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/64/23 ]

Fov.jpg

Focus

A projected texture appears blurrier the further the projection point is from the projector. The Focus value controls how attenuated this effect is. Positive values keep the projection sharper for further, negative values make the projection start to blur at a closer range.

[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/43/23 ]

Focus.jpg

Ambiance

This adds a very blurred version of the projected image to all faces within the cone of influence, regardless of even whether they are in shadow or facing away from the projector. The goal is to very roughly simulate light influence which is being diffused in all directions by surfaces receiving a projected image. Thus it is acceptable that this be even brighter on faces facing away from the projector. The brightness of this effect should be proportional to the Ambiance value. It is probably a bug that values from 0.5-1.0 seem to have no additional effect above the 0.5 value.

[ See the test at http://maps.secondlife.com/secondlife/Bug%20Island%202/242/24/23 ]

Amb.jpg

Projectors: 'Advanced Lighting Model' disabled

  • When 'Advanced Lighting Model' is disabled, a projector behaves like a point light, it continues to obey the Color, Intensity, Radius, Falloff attributes of the light.

Deferred rendering and Environment

Atmospheric settings

Atmospheric/Sky (aka WindLight) settings should function pretty much identically regardless of whether 'Advanced Lighting Model' is enabled (they may be slightly better or otherwise more accurate when 'Advanced Lighting Model' is enabled, but the difference is hardly noticeable if things are working right). This can be tested by comparing the Environment Editor's sky presets in both modes (especially the more 'extreme' presets like Gelatto).

Envboth475.jpg

Water settings

Although the overall appearance of water is a bit different with 'Advanced Lighting Model' enabled, it should still respond similarly to all tweaks in the Advanced Water Settings section of the Environment Editor. This can be tested by comparing the Environment Editor's water presets in both modes.


Antialiasing

Antialiasing while Deferred rendering is enabled is supported on the following platforms [as of Nov 2011]:

  • Windows + ATI
  • Windows + Nvidia
  • Mac + Nvidia
  • Linux + Nvidia

Test:

  1. Enable Advanced Lighting Model and Antialiasing (Preferences > Graphics > Hardware > Antialiasing > 2x or greater) on those platforms.
  2. Restart the viewer
  3. Verify the edges of objects are antialiased.

Antialiased vs aliased 2.png