Skip to content

Feature Samples

Neil Widmaier edited this page Jun 20, 2022 · 29 revisions

AreaLights

Description Atom has several different area light types available. Area lights provide a more realistic lighting result than purely punctual lights.

  • Spherical Light - Light being emitted from a sphere of some radius
  • Disk Light - Light emitted from a arbitrarily oriented 2D circle of some radius. Can emit from one side or both.
  • Capsule Light - Light emitted from a tube/cylinder with spherical end-caps. Controlled by end points plus a radius.
  • Quad Light - Light emitted from an arbitrarily oriented 2D rectangle of some width and height. Can emit from one side or both. Quad lights have two rendering methods - a cheap approximation, and a more expensive and accurate version using linearly transformed cosines.

The area light sample allows you to setup a light and test it against any model and material. Multiple instances can quickly be created to test against a variety of metalness and roughness values since these impact the lighting result the most. image2020-12-9_14-42-10 Sample Menu:

Mesh Settings
image2020-12-9_14-43-27
Count - Allows up to 10 instances of the mesh to be shown side-by-side
Roughness - overrides the roughness value of the material. When Count is > 1, then a min and maximum roughness can be set to vary roughness on each instance.
Metallic - overrides the metallic value of the material. When Count is > 1, then a min and maximum metallic can be set to vary metallic on each instance.

Light Settings
image2020-12-9_14-43-57
Validate - This turns on validation for the area light, swapping out the normal algorithm for the light with hundreds of point lights on the surface of the light. This creates a very accurate (and expensive) result that the regular area light can be compared against. Keep in mind this doesn't work well against very smooth surfaces where each individual point light on the area light's surface can be discerned in the specular result.
Light Type - Choose the type of area light to test.
Lumens - The brightness of the light in lumens.
Color - The color of the light. Acts as a mask against the total intensity in lumens.
Position Offset - The light is by default placed slightly above the mesh, but this can be offset here.

Point Type (Spherical)
image2020-12-9_14-44-30
Radius - The radius of the sphere.
Disk Type
image2020-12-9_14-45-37 X Rotation - Rotation on the x axis.
Y Rotation - Rotation on the y axis.
Radius - Radius of the disk
Emit Both Directions - if light is emitted from both sides of the disk. If turned on, then the total lumens output is actually double to keep the light from changing brightness when this is turned on or off.

Capsule Type
image2020-12-9_14-46-1
X Rotation - Rotation on the x axis.
Y Rotation - Rotation on the y axis.
Radius - Radius of the capsule
Height - The distance between the end points of the capsule.

Quad Type
image2020-12-9_14-46-25
X Rotation - Rotation on the x axis.
Y Rotation - Rotation on the y axis.
Z Rotation - Rotation on the z axis.
Quad Dimensions - The width and height of the quad
Use Fast Approximation - whether to use high quality linearly transformed cosign quad lights, or a faster approximation that yields a less accurate result.
Emit Both Directions - if light is emitted from both sides of the quad. If turned on, then the total lumens output is actually double to keep the light from changing brightness when this is turned on or off.

MultiScattering
Override multiscattering on the material to be on or off. (this really should be moved to mesh settings)

Reveal Sidebar
image2020-12-9_14-39-53
The "Reveal Sidebar" button the top-left opens a sidebar that allows the material and model to be chosen. By default, a sphere with the illuminant material is used.

Bloom

Description
This example demonstrates the basic functionality of bloom post processing component.
Debug Menu
Capturebsa

Test Cases
Bloom disabled:
Capturebs

Bloom enabled: Capturebs2

Checkerboard

Description
The RPI Checkerboard example is for demonstrating how to setup passes for a checkerboard render pipeline. The sample doesn't have the best quality the checkerboard rendering can achieve.

Screenshot
image2020-8-31_16-53-59

The checkerboard render pipeline was modified from MainPipeline with several changes:

  • The raster passes which output multi-sample render targets, such as ForwardMSAA and DepthMSAA, are replaced by the passes which creates two attachment images which one for even frame and another one for odd frame.
  • A customized raster pass called CheckerboardPass was added to have the ability to maintain two render targets for one pass attachment and switch them between frames.
  • There is a new customized checkerboard resolve pass (a compute pass) and it resolves render targets which come from both current frame and last frame.

DepthOfField

Description
This example shows depth of field in a simple scene.


Debug Menu
You can check the details of each parameters here.
NW: Will add this info later, after I get all the other pages in.

Enable Debug Color
Enable coloring to see Depth of Field level. Allows to visualize the position of elements of the scene versus relative to the focus point.

Red - Back large blur
Orange - Back middle blur
Yellow - Back small blur
Green - On focus
Blue green - Front small blur
Blue - Front middle blur
Purple - Front large blur


Test Cases (with expected results and screenshots)
Check if Depth of Field is working work
Open RPI/DepthOfField sample in the Base Viewer. This screen should be displayed.

DOF_BaseViewer_1
Check if Depth of Field is working.
Make sure 'Enabled Depth of Field' is enabled.
Then check 'Enabled Debug Color'.
This figure should be displayed.
DOF_BaseViewer_3
If the debug color does not change, Depth of Field is not running.
If the debug color changes but there is no blur, The processing might have a issue. To confirm, check if there are any changes by modifying Aperture F or other parameters.

Check Depth of Field enable/disable switching This figure should be displayed when 'Enabled Depth of Field' is unchecked.
DOF_BaseViewer_2


Quality Level
Check that the blur changes.
The larger the value, the better the quality and the lower the performance.

The figure shows Quality Level = 0 (left) and 1 (right).
DOF_BaseViewer_4
DOF_BaseViewer_1

Aperture F
Check that the blur size changes when modifying the Aperture F value.

The figure shows Aperture F = 0.0, 0.5 and 1.0.
DOF_BaseViewer_7
DOF_BaseViewer_1
DOF_BaseViewer_5

The figure shows Aperture F = 0.0, 0.5 and 1.0 when debug color is enabled.
DOF_BaseViewer_8
DOF_BaseViewer_3
DOF_BaseViewer_6

Focus Distance
Check that the focus distance changes.
To perform this test, make sure that 'Enabled Auto Focus' is Disabled.

The figure shows the change in Focus Distance from foreground to background.
DOF_BaseViewer_10
DOF_BaseViewer_14
DOF_BaseViewer_3
DOF_BaseViewer_9
Auto focus
Check 'Enabled Auto Focus'.
Change the 'Screen Position' and check the focus change to the targeted position.
The 'Screen Position' value [0,0] correspond to the upper left corner of the screen and [1,1] to the lower right.

Check that the focus changes as you move the camera. The camera can be moved by right-click and drag.

The screen shots below show sample images for Screen Position = [0.0, 0.5], [0.5, 0.5], and [1.0, 0.5].
DOF_BaseViewer_12
DOF_BaseViewer_11
DOF_BaseViewer_13

Auto focus parameters
Check if the parameters for auto focus works properly.

Sensitivity
Higher value is more responsive.
Lower value require a greater difference in depth before refocusing.
When the value is 1.0, auto focus continuously refreshes.
Even if the value is 0.0, focus works if there is a big difference.

The movie shows the behavior when the sensitivity is changed. If the delay is 0, you can easily check.

https://user-images.githubusercontent.com/79114701/170112391-e9cd66e4-1953-46e4-bb34-995eeb395b49.mp4

Speed
The larger the value, the faster the focus speed. When 0, focus does not update.


Delay
The value is delay time for focus to shift from one target to another. The unit is in seconds.

DiffuseGI

Description
The DiffuseGI sample demonstrates Atom's real-time Diffuse Global Illumination system.

Diffuse Global Illumination in Atom uses ray-traced light probes to determine the lighting environment at regular intervals in the scene. Each probe casts hundreds of rays from its position into the scene to compute its total irradiance.

The sample consists of two scenes: Cornell Box and Bistro.
DiffuseGI Sample Cornell Box
DiffuseGI Sample Bistro

The sample has a number of controls for adjusting the diffuse probes and lights in the scene.
DiffuseGI Sample Sidebar

Scene- This controls the currently displayed scene in the sample, either Cornell Box or Bistro.

Enable Diffuse GI - Enables or Disables the diffuse global illumination. When disabled the scene will be rendered with direct lights only.
Diffuse GI Strength (not labeled) - The slider below the Enable Diffuse GI option provides a strength value for increasing or decreasing the contribution from diffuse global illumination to the scene.

View Bias and Normal Bias - Fine tuning adjustments for minimizing artifacts.

GI Shadows - Controls whether each ray from a probe casts a secondary ray toward each light to determine if it is occluded.

Grid Origin - Specifies the center position of the diffuse probe grid in the scene.

(Bistro Only) Directional Light - Controls the Pitch and Yaw of the directional light, which in turn controls the shadows, and the next two controls adjust the Color and Intensity of the light.

Point Light - Controls the position of the point light, and the next two controls adjust the Color and Intensity of the light.

Exposure

Description
This example demonstrates the Exposure feature. The sample scene contains a single point light to produce an environment with varying levels of brightness.

Debug Menu
Debug_Menu 01


The camera can be moved using WASDQE keys and the mouse.

The two main modes of operation are: using only manual exposure control, and using auto-exposure (while manual control can still be used for manual compensation).

Test Cases
Manual control only. The exposure should not change due to changes in the scene being captured by the camera. For example, as the camera is moved from looking at a bright spot of the scene, to a dark, and vice versa, the exposure should remain consistent.
Main

When Manual Compensation is adjusted lower, the exposure of the scene should decrease and hence the rendered scene should appear darker.
EyeAdaptation_Off 02

When Manual Compensation is adjusted higher, the rendered scene should appear brighter.
EyeAdaptation_Off 01

It should also be possible to change the limits of the exposure by modifying the Minimum Exposure and Maximum Exposure sliders.

When Minimum Exposure is increased, the scene should get brighter.
Range Min 01

Likewise when Maximum Exposure is decreased, the scene should get darker.
Range Max 01

When Eye Adaptation is enabled, the exposure of the scene is adjusted based on the brightness of the scene captured by the camera.

When looking at a relatively unlit portion of the scene with Eye Adaption turned off, it should appear fairly dim.
EyeAdaptation_On 01

When Eye Adaptation is enabled, the exposure value should gradually increase.
EyeAdaptation_On 02

Note than changes to Manual Compensation and Minimum and Maximum Exposure also affect the exposure value when Eye Adaptation is enabled.

LightCulling

Description
Atom implements a high-performance light culling system that divides the screen into small pixel tiles and then culls lights and decals against those tiles.

The Baseviewer LightCulling example is a place to spawn hundreds of lights and decals of different types in order to test correctness and measure performance improvements.

Note that there may be some squarish flickering if a huge number (~250) of lights overlap a single tile. This is to be expected.

Debug Menu
By default there is a large menu bar on the right hand side showing the following:
a. Performance metrics
b. Light spawn controls
c. Heatmap activation controls

Test Cases (with expected results and screenshots)
baseview

baseview HM active

Automation
The lights are always spawned in the same location, which should aid testing. However the framerate counter on the right hand side may complicate matters if the UI layer is taken for comparison.

Platform Support
This sample has been tested on D3D12 and Vulkan, on AMD and Nvidia hardware.

Parallax

Description
The sample demonstrates the effect of parallax mapping and pixel depth offset. By default you will see a cube embedded in rocky terrain with a directional light orbiting around it and casting a shadow.

Debug Menu
image2020-10-8_18-35-47

In Lighting menu, you can select different light type to see the effect. (Only 2 light types support shadows now, we can add other light types in the future)

In the Parallax Setting menu, you can enable/disable parallax to see the effect, all the menu below will be hidden if parallax is disabled.

When PDO is enabled, the parallax shifting is also applied to the depth and shadow shaders, giving a better visual appearance with higher cost.

Factor can be used to adjust the level of the parallax illusion, making the terrain appear deeper or more shallow.

You can chose between different algorithms, the lower ones are the more time consuming algorithms, which will produce better result.

The different Quality levels control the number of iterations used to evaluate the surface; the more steps you have, more accurate the result and the more costly the calculation.

Test Cases (with expected results and screenshots)

Automated
Run the script parallaxtest.bv.luac

Manual
https://user-images.githubusercontent.com/79114701/170117456-5bdb1ce4-4f62-4dae-a10c-2204b125a810.mp4

As shown in the video below...

  1. First increase the Factor value so you can see the depth effect really well.
  2. Observe the orbiting light.
  3. Rotate the camera and observe the terrain looks good, the cube is intersecting the terrain, deeper parts of the terrain disappear as they are occluded by closer higher parts of the terrain. https://user-images.githubusercontent.com/79114701/170117456-5bdb1ce4-4f62-4dae-a10c-2204b125a810.mp4
  4. Change to Spot Light. The results should be similar to the Directional Light but looks like a spot light of course.
  5. Turn off auto-rotation. The light should stop in a fixed position.
  6. Drag the Direction slider. The light short rotate according to your input.
  7. Toggle Enable Parallax. You should see the effect turn off and on. https://user-images.githubusercontent.com/79114701/170117479-99f08485-4c32-4377-ab8d-7eedd2bbc635.mp4
  8. Toggle Enable PDO. The terrain itself should still appear to have depth, but there won't be any shadows cast inside the terrain, and the cube and its shadow will look like they are floating above the terrain. https://user-images.githubusercontent.com/79114701/170117506-23d800de-1850-4e72-9d6d-745e82c797b1.mp4
  9. For the next couple steps, put the camera at a low angle; this will show the quality differences more clearly.
    A) Cycle through each of the Algorithm options and notice the quality increase as you go down the list (the bottom 2-3 algorithms may show only a subtle difference between them).
    B) Cycle through each of the Quality levels and notice the quality increase as you go down the list.
  10. Try dragging each of the Plane Setting sliders to some non-default position and observe changes in the shape, size, and orientation of the terrain. The important thing to look for here is unnatural distortions (if it doesn't look wildly broken, it's probably working right). https://user-images.githubusercontent.com/79114701/170117590-dcdeb558-c0e9-47c6-abe2-ed3446fa4924.mp4

Platform Support
Should be able to run on all platform.

Shadow

Description
This example shows shadows for directional and spot lights in a simple scene. It has more control options than the ShadowedBistro Example.

It contain two meshes (floor and bunny), a directional light with shadows, and three spot lights with shadows.

Debug Menu
You can move camera by mouse.

You can check the shadows with default setting, but this example has the following control options.
Shadow_Menu
Test Cases (with expected results and screenshots)
By mouse dragging with pressing middle or right button, or scrolling mouse wheel, you can move camera. The following screenshots are of the initial camera position. You can also stop the move of light by removing checks in "Auto Rotation" checkboxes in Directional Light and Spot Lights section.

The default setting with Directional Light → Direction is 0 deg and Spot Lights → Base Direction is 0 deg. We refer this setting by (0).

Shadow_dir0_spot0
From (0), setting Intensity to 0 of each Red/Green/Blue in Spot Lights section, you can see shadows of only directional light. We refer this setting by (0-D).

Shadow_only_directional

From (0), setting Intensity to 0 of Directional Light, you can see shadows of only spot lights. We refer this setting by (0-S). Shadow_only_spot

From (0-D), setting enabling "Debug Coloring" in Directional Light section, you can see how cascade is split.
Shadow_debug_color

From (0-D), setting FoVY to 20 deg in Camera section, you can see the shadows in a zoomed-in view. We refer this setting by (0-D-Z)
Shadow_zoomed

From (0-D-Z), setting Filtering to "ESM+PCF" and "Boundary Width in meter" to 0.1 in Directional Light section, you can see shadow boundary is soften. (This feature is disabled in MVP 0.5.)
Shadow_ESMPCF

From (0-S), disabling "Enable Shadow" checkboxes for Green and Blue in Spot Lights section, you can see only Red light has shadows.
Shadow_only_red_has_shadow

From (0-S), setting "Intensity" to 0 for Green and Blue in Spot Lights section, you can see only Red light appears with shadows.
Shadow_red_only

Platform Support
It was checked with DX12 and Vulkan on Windows OS PC.

It was not checked the other platform yet like macOS, iOS, or Android.

ShadowedBistro

Description
This example shows shadows for directional and spot lights in a relatively complex scene. It may contains more meshes and more spot lights, and lesser control options than Shadow Example. For the test for more detailed control of lights and shadows, use of Shadow Example is recommended.

It contain only a mesh, BistroExterior, a directional light with shadows, and variable count of spot lights with shadows.


Debug Menu
You can move camera by ASDWQE key and mouse.
You can check the shadows with default setting, but this example has the following control options.
ShadowedBistro_Menu

Test Cases (with expected results and screenshots)
By pressing ASDWQE keys and mouse, you can move camera to a location where you can see shadows of directional and spot lights. The following screenshots are of initial camera location.
The default setting.
ShadowedBistro_Default
By setting Directional Light's Intensity to 0, you can see lights and shadows of only spot lights.
ShadowedBistro_spotlightshadows
By setting Spot Light's Intensity to 0, you can see lights and shadows of only directional lights.
ShadowedBistro_directionallightshadows

By removing check of Spot Light's "Enable Shadow", you can see spot light without shadows. (We do not have the corresponding checkbox for directional lights.)
ShadowedBistro_wo_spotlightshadows

By changing Spot Light's Number, you can increase/decrease the number of spot lights. (The maximum number depend on the device. If the device does not have sufficient memory, it may crash. The screenshot below is of number 50.)
ShadowedBistro_50spotlights

Platform Support
It was checked with DX12 and Vulkan on Windows OS PC.
It was not checked the other platform yet like macOS, iOS, or Android.

SSAO

Description
The SSAO (Screen Space Ambient Occlusion) sample loads Bistro and outputs the computed SSAO values to the screen:
SSAO Pic 01

Debug Menu
The SSAO sample lists the following options in it's ImGui menu:

  • SSAO Strength: The strength of the SSAO effect - the higher this value the darker the SSAO will appear
  • Enable Blur: Whether a blur is applied to the computed SSAO buffer. Enabling with result in a smoother looking SSAO image
  • Blur Strength: How strong of a blur to apply to the SSAO. Weaker values will result in a sharper albeit more noisy image.
  • Blur Sharpness: The SSAO blur tries to respect geometric edges to avoid smearing the SSAO across edges or objects. Increasing this value will result in a sharper looking blur, whereas decreasing it will result in a softer looking SSAO blur.
  • Blur Edge Threshold: An edge threshold can be specified for the blur to ignore depth changes of a certain value. This has the most effect at small values.
  • Enable Downsample: Whether to downsample the depth buffer and perform SSAO and blur on the downsampled result before upsampling. This is an optimization that results in less detailed SSAO.

Test Cases
The sample should load the Bistro level and display SSAO similar to the image above. Each of the above listed parameters when modified should have the described effect.

Automation
There is no automated screenshot for SSAO yet but one will be added in the near future.

SSR

Description
The SSR example demonstrates Screenspace Reflections. It consists of a simple scene with three models and a ground plane, with the ability to adjust the material on the ground plane.

SSR Sample

The debug panel provides the following options:
SSR Sample Sidebar

  • Enable SSR. Enables or Disables the rendering of screenspace reflections in the scene.
  • Ground Plane Material. Selects the type of material used on the ground plane. Each option provides a material with a different roughness value.

Tonemapping

Description
This sample helps visualize how our ACES tone mapping will affect various colors and levels of brightness. The test pattern texture contains a wide range of colors which can be interpreted as sRGB, linear sRGB, ACEScg, or ACES2065. These colors are then put through our tone mapping pipeline and displayed on the screen.

Test Pattern
The test pattern is a 32 bit per channel texture allowing the full range of floating point values to be represented. The top section contains Ev100 values, and the bottom contains linear values. Each of those sections is split into 7 rows for various colors.

Top Row - EV100
image2021-2-25_12-55-50

The top row contains values related to EV100 stops, where EV of 0 represents medium gray, or 0.18 raw. The numbers at the top are the EV100 values, while the numbers on the bottom are the raw brightness values encoded in the texture.

Bottom Row - Linear
image2021-2-25_13-0-55

Input Color Space
The test pattern texture can be interpreted as being in several different color spaces. That color space is then converted to our working space (ACEScg) before going through the rest of the tonemapping pipeline.

sRGB color spaces - https://en.wikipedia.org/wiki/SRGB

  • sRGB - This is a perceptual space that many people are used to working with roughly corresponding to a gamma of 2.2. 1.0 represents white, and 0.5 represents medium gray.
  • Linear sRGB - Uses the same color primaries as sRGB, but without the gamma curve.
  • ACEScg - This is our working space, so no actual color transformation takes place in this mode - the color values from the texture are interpreted as-is. ACEScg is the recommended working space for use with rendering.
  • ACES2065 - This is the "standard" ACES color space using the AP0 primaries and recommended for long term storage of image data. ACES color spaces - https://en.wikipedia.org/wiki/Academy_Color_Encoding_System

Transparency

Description
The sample test for transparency material.
10 double sided quads are put in the scene, apply default transparency material with different color.

Test Cases (with expected results and screenshots)
A lua script is written to test the sample, take 2 screenshots from front and back of the quads queue.
image2020-10-8_13-54-46

Platform Support
Should be able to run on all platform.