NAP
Public Member Functions | Public Attributes | List of all members
RenderSkyBoxComponent Class Reference

#include <renderskyboxcomponent.h>

Public Member Functions

void getDependentComponents (std::vector< rtti::TypeInfo > &components) const override
 
- Public Member Functions inherited from Component
virtual const rtti::TypeInfo getInstanceType () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

ResourcePtr< TextureCubemCubeTexture
 
RGBColorFloat mColor = { 1.0f, 1.0f, 1.0f }
 Sky box color, defaults to white. More...
 
float mOpacity = 1.0f
 Sky box alpha, only available when 'BlendMode' is set to 'AlphaBlend'. More...
 
EBlendMode mBlendMode = EBlendMode::Opaque
 Sky box blend mode, change to 'AlphaBlend' to enable opacity. More...
 
- Public Attributes inherited from RenderableComponent
bool mVisible = true
 Property: 'Visible' if this object is rendered to target by the render service. More...
 
ResourcePtr< RenderLayermLayer
 Property: 'Layer' the render layer assigned to this component. More...
 
std::vector< ResourcePtr< RenderTag > > mTags
 Property: 'Tags' List of tags specifying the category this render component belongs to. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Resource part of RenderSkyBoxComponent

Renders a skybox using a cube texture. Creates a nap::BoxMesh with front-face culling enabled internally. The default skybox shader negates the translational component of the view matrix to fake unlimited depth. This object should be rendered first to fill the background; to do this, ensure it is in the back layer. You may also want to exclude this object from a shadow rendering pass using tags. The shader variables are set automatically from this component's properties.

Inheritance diagram for RenderSkyBoxComponent:
[legend]
Collaboration diagram for RenderSkyBoxComponent:
[legend]

Member Function Documentation

◆ getDependentComponents()

void getDependentComponents ( std::vector< rtti::TypeInfo > &  components) const
overridevirtual

Populates a list of components this component depends on. Every component dependency, when found, is initialized before this component. A dependency is NOT a hard requirement. Serialization will not fail if the dependent component isn't declared in JSON. It only means that when a component is declared under the same entity, and that component is tagged as a dependency of this component, it is initialized before this component. It is your responsibility to return false on initialization if the dependency is a hard requirement and can't be found. To ensure the right order of initialization based on a hard requirement it is advised to use a nap::ComponentPtr instead.

Parameters
componentslist of component types this resource depends on.

Reimplemented from Component.

Member Data Documentation

◆ mBlendMode

Sky box blend mode, change to 'AlphaBlend' to enable opacity.

◆ mColor

RGBColorFloat mColor = { 1.0f, 1.0f, 1.0f }

Sky box color, defaults to white.

◆ mCubeTexture

ResourcePtr<TextureCube> mCubeTexture

◆ mOpacity

float mOpacity = 1.0f

Sky box alpha, only available when 'BlendMode' is set to 'AlphaBlend'.