ssao - ryzom/ryzomcore GitHub Wiki


title: Notes on SSAO description: published: true date: 2023-09-27T05:41:42.621Z tags: editor: markdown dateCreated: 2023-09-27T04:46:17.751Z

References

https://learnopengl.com/Advanced-Lighting/SSAO https://developer.nvidia.com/rendering-technologies/horizon-based-ambient-occlusion-plus

Notes

could do SSAO in ryzom with a depth prepass (materials need to have a pass for that) in the scene, and then use the ssao ambient occlusion map when rendering the ambient pass (adds multiplier to ambient maps) (may also open up the way to a deferred renderer option)

SSAO should only affect ambient lighting (most prominent at night time), so it does not affect the current lightmaps which only affect diffuse lighting. currently ambient lighting is entirely flat

Landscape

Landscape LOD fade needs custom shader to render the depth with alpha blend.

Foliage

SSAO generally doesn't affect shapes with alpha (alpha test is fine though) ground foliage (veget) is using alpha, affect or just ignore? don't want glowing vegetation... ignore during depth pass and just render with whatever is in the occlusion map? should be fine, implies the lighting on the vegetation is a bit translucent!

LOD billboard fades

Since SSAO won't apply on alpha this may be an issue? Alternatively see if same trick as landscape can be done. Need to render the fade stages as part of unit test as well.

If we add dither-based fading for LOD to allow GPU animation, this'll be affected in the same way.

Visual asset issues

AO is hand painted into some tiling textures that touch the ground and maybe into vertex color channels of some meshes! These need to be identified and re-done. (Maybe a flag to disable vertex color if AO is on? And a map switch that checks AO?)

Unit testing

Check if the package of unit test meshes is useful, maybe only for particle systems.

Need to test all common material types and shaders with some fun test meshes.

  • Landscape (fancy alpha)
  • Rendering 2D quads
  • FXAA effect
  • Bloom effect
  • Alpha
  • Alpha test
  • Vegetation on landscape (how does SSAO affect landscape vegetation? not?) (foliage)
  • Particle systems
  • Wind tree
  • Tree center normal

Software rendering

  • D3D9 on Windows using WARP?
  • OpenGL on Linux using Mesa3D's llvmpipe or softpipe?

Tracing

Add detailed tracing in the graphics drivers that can be enabled as a compiler switch that logs all function calls and outputs an encoded bitfield and enums of all graphics states along with it. Implement a viewer tool to see the trace alongside all states.

⚠️ **GitHub.com Fallback** ⚠️