Depth of Field test


Purpose

Test the functionality of the Depth of Field [DOF] render effect.

Sources

Depth_of_field

Scope

Video cards with OpenGL 3.0 or higher.

Test Plan

Setup

  1. Choose Me menu > Preferences.
  2. In the Preferences window, click Graphics tab.
  3. Click Advanced button to show additional options.
  4. If Lighting and Shadows is not a visible option, you'll need to get a viewer that includes the feature. See https://wiki.secondlife.com/wiki/Depth_of_field#How_can_I_see_the_depth_of_field_effect.3F
  5. Check Hardware skinning.
  6. Check Atmospheric shaders
  7. Check Lighting and Shadows
  8. Check Depth of Field
  9. Enable the Advanced menu (ctrl-alt-d)
  10. Open Advanced menu > Show Debug Settings
  11. Type in CameraFocalLength , set the value to 500 and hit enter. This will will accentuate the Depth of Field effect and make correctness testing easier.

Avatar is always in focus when not alt-zooming or using flycam

  1. Hit the escape key so nothing has focus.
  2. Put your cursor over the sky.
  3. Verify your avatar is in focus.
  4. Verify objects in the distant background are out of focus.

Alt-zooming on something locks the DOF focus

  1. Hold the Alt key and click an object
  2. Verify the object is now focused.
  3. Move your cursor over various objects.
  4. Verify the object the object you alt-zoomed on remains focused.

DOF becomes stronger as you zoom closer to an object

  1. Alt-zoom on an object while watching objects in the background.
  2. Verify object in the background become fuzzier as you zoom closer to the foreground object.


DOF does nothing under water

  1. Fly under water and verify the DOF effect is disabled.

Media on a Prim looks sharp when focused

  1. Alt-zoom on a media prim
  2. Verify the spot you alt-zoomed on looks sharp.
  3. Click the focus button on the media bar
  4. Verify the camera moves to point directly at the media the entire media face looks sharp.

In mouselook, object behind the crosshair is focused

  1. Enter mouselook mode by pressing the m key.
  2. Move your view around.
  3. Verify that whatever is behind the block cursor in the center of the screen is in focus.
  4. Exit mouselook mode by pressing the escape key.

HUD attachments should be ignored

  1. Attache a block to your HUD or wear any HUD attachments you own.
  2. Move your cursor over various objects.
  3. Verify your HUD object is always in focus.

DOF should be off when in build/edit mode

  1. Create a box
  2. Verify nothing is blurry because DOF has been disabled.
  3. Close the edit tools.
  4. Verify DOF has been enabled again.

Flycam Mode

Object under cursor gets focus in flycam mode

  1. Move your cursor over an object in world
  2. Verify object becomes in focus.

Specific point on object under cursors gets focus in flycam mode

  1. Move camera very near an object.
  2. Move cursor around on surface of object.
  3. Verify focus tracks mouse cursor "depth."

Water within a region does get DOF focus in flycam mode

  1. Teleport to some water that is within the boundary of a region.
  2. Move your cursor from your avatar to the water.
  3. Verify the water receives focus.

if you hover your cursor over your nametag, your avatar should get focus in flycam mode

  1. Move your cursor from a distant object to your nametag
  2. Verify your avatar becomes focused.

end of flycam mode test

Turn off flycam mode so your camera once again tracks your avatar.

CameraFieldOfView

CameraFNumber

CameraFocalLength

CameraFocusTransitionTime

CameraMaxCoF

Objects with Transparency value of 100% allow right-clicks to pass through Unless it has a touch event.

  1. Create 2 boxes.
  2. Set the Transparency of one box to 99% and the other to 100%
  3. Close the edit tools window.
  4. Attempt to right-click through the objects.
  5. Verify you can click through the object that is 100% transparent, but cannot click through the object that is 99% transparent.
  6. Add a default script to the 100% Transparent object.
  7. Attempt to right-click through the 100% Transparent object.
  8. Verify you can no longer click through the 100% Transparent object.

Objects with Transparency of 66% or lower will not affect the DOF effect behind them.

  1. Set Advanced menu > Show Debug Settings > CameraFocalLength to 500
  2. Create a 2x2x2m cube
  3. Set the cube's transparency to 66%.
  4. Close the edit tool and alt-zoom on the cube.
  5. Verify you see a DOF effect on the objects or ground behind the cube.
  6. Set the cube's transparency to 67%.
  7. Close the edit tool and alt-zoom on the cube.
  8. Verify everything appears fuzzy behind the cube.



Tests to add sometime: Can different real-world cameras be simulated by plugging in the right FNumber and FocalLength numbers?