Skip to content

enh(viz): make viz::scene3d::vr great again

Description

IVolumeRenderer

  • IVolumeRenderer::update has been introduced to solve the problem of the initial issue (calls to virtual function from constructor). This member is public and virtual, and overriden in RayTracingVolumeRenderer. Base implementation simply calls setSampling(m_nbSlices) and sets a flag to false.

RayTracingVolumeRenderer

Data management

  • Before this MR, the image resources was managed by both the service and the library. This is not the case anymore. The service now knows almost nothing about the data. Consequently, what was weak_ptr previously in the library are now shared_ptr or even unique_ptr.
  • The following are now set upon construction:
    • Raytracing fragment shader source file,
    • Ambient occlusion parameters,
    • Preintegration parameters,
    • Shadows parameters,
    • SAT parameters,
  • There used to be duplicated attributes in the service and the library, which represented the same flags but where not updated simultaneously. This is not the case anymore. Actually, this was the main cause of - #756 (closed), #791 (closed) and #792 (closed)).

Misc

  • As RayTracingVolumeRenderer::initEntryPoints must only be called once, there is now a check it has not been called before.
  • New structs wrapping attributes:
    • shadows_parameters_t (public), which holds the shadow parameters (soft shadows, ambient occlusion and colour bleeding.)
    • shadows_data_t (public), which holds the current parameters and a convenience Ogre::Vector4 holding the current parameters.
    • defines (protected), which really just contains the defines previously stored in the .cpp. This avoids duplicated code in inherited classes.
    • options_t (protected), which holds the shader options. It replaces a std::tuple in order to have named parameters.
    • material_light_t (protected), is used to pass Phong lighting parameters for materials.
  • setMaterialLightParams is now protected static and has a second argument allowing the user to specify lighting parameters (or not, in that case it uses the current values as default).
  • createRayTracingMaterial is now updateRayTracingMaterial, and does not take any parameter.
  • Some functions were renamed to something explaining what they actually do.

SVolumeRender

Data management

Same as above, but in case you missed it:

  • Before this MR, the image resources was managed by both the service and the library. This is not the case anymore. The service now knows almost nothing about the data.
  • There used to be duplicated attributes in the service and the library, which represented the same flags but where not updated simultaneously. This is not the case anymore. Actually, this was the main cause of - #756 (closed), #791 (closed) and #792 (closed)).

Misc

  • The configuration is now stored in a struct with named parameters instead of separated attributes. This allows to show they are linked.
  • Slot keys are now stored in a struct too.
  • Some integer values are now unsigned in order to ease some asserts.
  • Renamed some attributes as they role changed.
  • Wrapped raw pointers in smart pointers.

GridProxyGeometry

  • Fixed leak upon update.
  • Moved some defines to the header.

IllumAmbientOcclusionSAT

  • Wrapped attributes into a struct.
  • Refactor related to changes in related classes.

SummedAreaTable

  • Listeners are now nested classes. I don't really remember why I decided to do that but here it is.
  • constness, avoid using the same variable for different purposes, etc.
  • Asserts on certain parameters.

Misc

  • Replaced C-style arrays by std::array in IVolumeRenderer, which will facilitate usage in subclasses (I am quite concerned by this)
  • Fixed a warning about a pointer potentially being nullptr by testing it.

Issues handled

Closes #804 (closed) #756 (closed) #791 (closed) #792 (closed)

How to test it?

  • Checkout the associated branch.
  • Compile sight.
  • Launch SightViewer.
  • Everything works as expected. What was broken before may or may not still be broken.

Some results

Ambient Occlusion fixed

image

Colour bleeding fixed

image

Ambient occlusion, Colour bleeding and Preintegration combined

image

Additional tests/tasks to run

Night counterpart.

Edited by Flavien BRIDAULT

Merge request reports