Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::SkyboxBackground Class Reference

#include <Skybox.hpp>

Inheritance diagram for castor3d::SkyboxBackground:
Inheritance graph
[legend]
Collaboration diagram for castor3d::SkyboxBackground:
Collaboration graph
[legend]

Public Member Functions

C3D_API SkyboxBackground (Engine &engine, Scene &scene, castor::String const &name=castor::String{})
 Constructor.
 
C3D_API void accept (BackgroundVisitor &visitor) override
 Visitor acceptance function.
 
C3D_API void accept (ConfigurationVisitorBase &visitor) override
 Visitor acceptance function.
 
C3D_API bool write (castor::String const &tabs, castor::Path const &folder, castor::StringStream &stream) const override
 Writes the background to a text stream.
 
C3D_API void setLeftImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's left face texture.
 
C3D_API void setRightImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's right face texture.
 
C3D_API void setTopImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's top face texture.
 
C3D_API void setBottomImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's bottom face texture.
 
C3D_API void setFrontImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's front face texture.
 
C3D_API void setBackImage (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's back face texture.
 
C3D_API void setFaceTexture (castor::Path const &folder, castor::Path const &relative, SkyboxFace face)
 Sets a skybox's face texture.
 
C3D_API void setEquiTexture (castor::Path const &folder, castor::Path const &relative, uint32_t size)
 Sets the skybox's equirectangular texture.
 
C3D_API void setEquiSize (uint32_t size)
 Sets the size of the skybox generated from the equirectangular texture.
 
C3D_API void setCrossTexture (castor::Path const &folder, castor::Path const &relative)
 Sets the skybox's cross texture.
 
castor::Path const & getEquiTexturePath () const
 
castor::Size const & getEquiSize () const
 
castor::Path const & getCrossTexturePath () const
 
castor::Array< castor::Path, 6u > const & getLayerTexturePath () const
 
- Public Member Functions inherited from castor3d::SceneBackground
C3D_API SceneBackground (Engine &engine, Scene &scene, castor::String const &name, castor::String type, bool hasIBLSupport)
 Constructor.
 
virtual C3D_API ~SceneBackground ()
 Destructor.
 
C3D_API bool initialise (RenderDevice const &device)
 Initialisation function.
 
C3D_API void cleanup ()
 Cleanup function.
 
C3D_API void update (CpuUpdater &updater) const
 Updates the background, CPU side.
 
C3D_API void update (GpuUpdater &updater) const
 Updates the background, GPU side.
 
C3D_API void upload (UploadData &uploader)
 Uploads image data to the texture buffer.
 
C3D_API void notifyChanged ()
 Notifies a change to apply on GPU for the background.
 
virtual C3D_API crg::FramePass & createBackgroundPass (crg::FramePassGroup &graph, RenderDevice const &device, ProgressBar *progress, VkExtent2D const &size, crg::ImageViewIdArray const &colour, crg::ImageViewIdArray const &depth, crg::ImageViewId const *depthObj, UniformBufferOffsetT< ModelBufferConfiguration > const &modelUbo, CameraUbo const &cameraUbo, HdrConfigUbo const &hdrConfigUbo, SceneUbo const &sceneUbo, bool clearColour, bool clearDepth, bool forceVisible, BackgroundPassBase *&backgroundPass)
 Creates the background render pass.
 
C3D_API void addPassBindings (crg::FramePass &pass, crg::ImageViewIdArray const &targetImage, uint32_t &index) const
 Adds the background specific bindings to a frame pass.
 
C3D_API void addBindings (ashes::VkDescriptorSetLayoutBindingArray &bindings, VkShaderStageFlags shaderStages, uint32_t &index) const
 Adds the background specific bindings.
 
C3D_API void addDescriptors (ashes::WriteDescriptorSetArray &descriptorWrites, crg::ImageViewIdArray const &targetImage, uint32_t &index) const
 Adds the background specific descriptors.
 
virtual C3D_API castor::String const & getModelName () const
 
C3D_API BackgroundModelID getModelID () const
 
void setVisible (bool v) noexcept
 
virtual bool isDepthSampled () const noexcept
 
virtual bool hasScattering () const noexcept
 
ScenegetScene () const noexcept
 
castor::String const & getType () const noexcept
 
TextureLayoutgetTexture () const noexcept
 
ashes::Image const & getImage () const
 
bool isHdr () const noexcept
 
bool isSRGB () const noexcept
 
bool hasIbl () const noexcept
 
bool isInitialised () const noexcept
 
bool isVisible () const noexcept
 
IblTextures const & getIbl () const noexcept
 
Sampler const & getSampler () const noexcept
 
uint32_t const & getPassIndex (bool forceVisible) const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Additional Inherited Members

- Public Attributes inherited from castor3d::SceneBackground
OnBackgroundChanged onChanged
 
- Static Public Attributes inherited from castor3d::SceneBackground
static uint32_t constexpr VisiblePassIndex = 0u
 
static uint32_t constexpr HiddenPassIndex = 1u
 
- Protected Member Functions inherited from castor::OwnedBy< Engine >
 OwnedBy (Engine &owner)
 Constructor.
 
- Static Protected Member Functions inherited from castor3d::SceneBackground
static C3D_API castor::PxBufferBaseUPtr adaptBuffer (castor::PxBufferBase const &buffer, castor::String const &name, bool generateMips)
 
static C3D_API castor::ImageUPtr loadImage (Engine &engine, castor::String const &name, castor::Path const &folder, castor::Path const &relative, bool generateMips)
 
- Protected Attributes inherited from castor3d::SceneBackground
Scenem_scene
 
castor::String m_type
 
std::atomic_bool m_initialised { false }
 
bool m_hdr { true }
 
bool m_srgb { false }
 
Texture m_textureId
 
TextureLayoutUPtr m_texture
 
SamplerObs m_sampler {}
 
castor::RawUniquePtr< IblTexturesm_ibl
 
bool m_hasIBLSupport
 
bool m_visible { true }
 
uint32_t m_passIndex { 0u }
 
bool m_needsUpload {}
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Constructor & Destructor Documentation

◆ SkyboxBackground()

C3D_API castor3d::SkyboxBackground::SkyboxBackground ( Engine & engine,
Scene & scene,
castor::String const & name = castor::String{} )
explicit

Constructor.

Parameters
[in]engineThe engine.
[in]sceneThe parent scene.
nameThe background name.

Member Function Documentation

◆ accept() [1/2]

C3D_API void castor3d::SkyboxBackground::accept ( BackgroundVisitor & visitor)
overridevirtual

Visitor acceptance function.

Parameters
visitorThe visitor.

Implements castor3d::SceneBackground.

◆ accept() [2/2]

C3D_API void castor3d::SkyboxBackground::accept ( ConfigurationVisitorBase & visitor)
overridevirtual

Visitor acceptance function.

Parameters
visitorThe visitor.

Implements castor3d::SceneBackground.

◆ getCrossTexturePath()

castor::Path const & castor3d::SkyboxBackground::getCrossTexturePath ( ) const
inline

◆ getEquiSize()

castor::Size const & castor3d::SkyboxBackground::getEquiSize ( ) const
inline

◆ getEquiTexturePath()

castor::Path const & castor3d::SkyboxBackground::getEquiTexturePath ( ) const
inline

name Getters.

◆ getLayerTexturePath()

castor::Array< castor::Path, 6u > const & castor3d::SkyboxBackground::getLayerTexturePath ( ) const
inline

◆ setBackImage()

C3D_API void castor3d::SkyboxBackground::setBackImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's back face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setBottomImage()

C3D_API void castor3d::SkyboxBackground::setBottomImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's bottom face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setCrossTexture()

C3D_API void castor3d::SkyboxBackground::setCrossTexture ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's cross texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setEquiSize()

C3D_API void castor3d::SkyboxBackground::setEquiSize ( uint32_t size)

Sets the size of the skybox generated from the equirectangular texture.

Parameters
[in]sizeThe wanted skybox dimensions.

◆ setEquiTexture()

C3D_API void castor3d::SkyboxBackground::setEquiTexture ( castor::Path const & folder,
castor::Path const & relative,
uint32_t size )

Sets the skybox's equirectangular texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.
[in]sizeThe wanted skybox dimensions.

◆ setFaceTexture()

C3D_API void castor3d::SkyboxBackground::setFaceTexture ( castor::Path const & folder,
castor::Path const & relative,
SkyboxFace face )

Sets a skybox's face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.
[in]faceThe face into which the image will be loaded.

◆ setFrontImage()

C3D_API void castor3d::SkyboxBackground::setFrontImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's front face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setLeftImage()

C3D_API void castor3d::SkyboxBackground::setLeftImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's left face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setRightImage()

C3D_API void castor3d::SkyboxBackground::setRightImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's right face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ setTopImage()

C3D_API void castor3d::SkyboxBackground::setTopImage ( castor::Path const & folder,
castor::Path const & relative )

Sets the skybox's top face texture.

Parameters
[in]folderThe image folder.
[in]relativeThe image file path, relative to folder.

◆ write()

C3D_API bool castor3d::SkyboxBackground::write ( castor::String const & tabs,
castor::Path const & folder,
castor::StringStream & stream ) const
overridevirtual

Writes the background to a text stream.

Parameters
tabsThe current indentation.
folderThe working folder.
streamThe text stream.

Implements castor3d::SceneBackground.


The documentation for this class was generated from the following file: