![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <RenderingComponent.h>
Classes | |
struct | DrawCommands |
struct | PackageEntry |
Public Types | |
enum class | RenderOptions : U16 { RENDER_GEOMETRY = toBit(1) , RENDER_WIREFRAME = toBit(2) , RENDER_SKELETON = toBit(3) , RENDER_SELECTION = toBit(4) , RENDER_AXIS = toBit(5) , CAST_SHADOWS = toBit(6) , RECEIVE_SHADOWS = toBit(7) , IS_VISIBLE = toBit(8) } |
Public Member Functions | |
RenderingComponent (SceneGraphNode *parentSGN, PlatformContext &context) | |
~RenderingComponent () override | |
bool | renderOptionEnabled (RenderOptions option) const noexcept |
Returns true if the specified render option is enabled. | |
void | toggleRenderOption (RenderOptions option, bool state, bool recursive=true) |
void | setMinRenderRange (F32 minRange) noexcept |
void | setMaxRenderRange (F32 maxRange) noexcept |
void | setRenderRange (const F32 minRange, const F32 maxRange) noexcept |
vec2< F32 > | renderRange () const noexcept |
bool | lodLocked (const RenderStage stage) const noexcept |
void | lockLoD (const U8 level) |
void | unlockLoD () |
void | lockLoD (const RenderStage stage, U8 level) noexcept |
void | unlockLoD (const RenderStage stage) noexcept |
U8 | getLoDLevel (RenderStage renderStage) const noexcept |
U8 | getLoDLevel (const F32 distSQtoCenter, RenderStage renderStage, vec4< U16 > lodThresholds) |
void | setLoDIndexOffset (U8 lodIndex, size_t indexOffset, size_t indexCount) noexcept |
void | getMaterialData (NodeMaterialData &dataOut) const |
void | rebuildMaterial () |
void | instantiateMaterial (Handle< Material > material) |
Handle< Material > | getMaterialInstance () const noexcept |
DrawCommands & | drawCommands () noexcept |
void | setReflectionCallback (const RenderCallback &cbk, const ReflectorType reflectType) |
void | setRefractionCallback (const RenderCallback &cbk, const RefractorType refractType) |
bool | canDraw (const RenderStagePass &renderStagePass) |
void | drawDebugAxis () |
Draw the axis arrow gizmo. | |
void | drawSelectionGizmo () |
Draw some kind of selection doodad. May differ if editor is running or not. | |
void | drawSkeleton () |
void | drawBounds (bool AABB, bool OBB, bool Sphere) |
PROPERTY_R (bool, showAxis, false) | |
PROPERTY_R (bool, receiveShadows, false) | |
PROPERTY_RW (bool, primitiveRestartRequired, false) | |
PROPERTY_R (bool, castsShadows, false) | |
PROPERTY_RW (bool, occlusionCull, true) | |
PROPERTY_RW (F32, dataFlag, 1.0f) | |
PROPERTY_R_IW (bool, isInstanced, false) | |
PROPERTY_R_IW (bool, rebuildDrawCommands, false) | |
Static Public Attributes | |
static constexpr U8 | MAX_LOD_LEVEL = 4u |
Protected Types | |
using | PackagesPerIndex = vector< PackageEntry > |
using | PackagesPerPassIndex = std::array< PackagesPerIndex, to_base(RenderStagePass::PassIndex::COUNT)> |
using | PackagesPerVariant = std::array< PackagesPerPassIndex, to_base(RenderStagePass::VariantType::COUNT)> |
using | PackagesPerPassType = std::array< PackagesPerVariant, to_base(RenderPassType::COUNT)> |
Protected Member Functions | |
void | getCommandBuffer (RenderPackage *const pkg, GFX::CommandBuffer &bufferInOut) |
RenderPackage & | getDrawPackage (const RenderStagePass &renderStagePass) |
U8 | getLoDLevelInternal (const F32 distSQtoCenter, RenderStage renderStage, vec4< U16 > lodThresholds) |
void | toggleBoundsDraw (bool showAABB, bool showBS, bool showOBB, bool recursive) |
void | onRenderOptionChanged (RenderOptions option, bool state) |
void | clearDrawPackages (const RenderStage stage, const RenderPassType pass) |
void | clearDrawPackages () |
void | updateReflectRefractDescriptors (bool reflectState, bool refractState) |
bool | hasDrawCommands () noexcept |
void | retrieveDrawCommands (const RenderStagePass &stagePass, const U32 cmdOffset, DrawCommandContainer &cmdsInOut) |
void | postRender (const SceneRenderState &sceneRenderState, const RenderStagePass &renderStagePass, GFX::CommandBuffer &bufferInOut) |
Called after the parent node was rendered. | |
bool | prepareDrawPackage (const CameraSnapshot &cameraSnapshot, const SceneRenderState &sceneRenderState, const RenderStagePass &renderStagePass, GFX::MemoryBarrierCommand &postDrawMemCmd, bool refreshData) |
bool | updateReflection (U16 reflectionIndex, bool inBudget, Camera *camera, const SceneRenderState &renderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
bool | updateRefraction (U16 refractionIndex, bool inBudget, Camera *camera, const SceneRenderState &renderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | updateNearestProbes (const vec3< F32 > &position) |
void | onParentUsageChanged (NodeUsageContext context) const |
void | OnData (const ECS::CustomEvent &data) override |
Private Types | |
using | Parent = BaseComponentType< RenderingComponent, ComponentType::RENDERING > |
Friends | |
class | RenderingSystem |
class | Attorney::RenderingCompRenderPass |
class | Attorney::RenderingCompGFXDevice |
class | Attorney::RenderingCompRenderBin |
class | Attorney::RenderingCompRenderPassExecutor |
class | Attorney::RenderingComponentSGN |
Definition at line 106 of file RenderingComponent.h.
|
protected |
Definition at line 238 of file RenderingComponent.h.
|
protected |
Definition at line 239 of file RenderingComponent.h.
|
protected |
Definition at line 241 of file RenderingComponent.h.
|
protected |
Definition at line 240 of file RenderingComponent.h.
|
private |
Definition at line 106 of file RenderingComponent.h.
|
strong |
Enumerator | |
---|---|
RENDER_GEOMETRY | |
RENDER_WIREFRAME | |
RENDER_SKELETON | |
RENDER_SELECTION | |
RENDER_AXIS | |
CAST_SHADOWS | |
RECEIVE_SHADOWS | |
IS_VISIBLE |
Definition at line 116 of file RenderingComponent.h.
|
explicit |
Definition at line 61 of file RenderingComponent.cpp.
|
override |
Definition at line 147 of file RenderingComponent.cpp.
bool Divide::RenderingComponent::canDraw | ( | const RenderStagePass & | renderStagePass | ) |
Definition at line 263 of file RenderingComponent.cpp.
|
protected |
Definition at line 242 of file RenderingComponent.cpp.
|
protected |
Definition at line 219 of file RenderingComponent.cpp.
void Divide::RenderingComponent::drawBounds | ( | bool | AABB, |
bool | OBB, | ||
bool | Sphere | ||
) |
Definition at line 903 of file RenderingComponent.cpp.
|
inlinenoexcept |
Definition at line 161 of file RenderingComponent.h.
void Divide::RenderingComponent::drawDebugAxis | ( | ) |
Draw the axis arrow gizmo.
Definition at line 849 of file RenderingComponent.cpp.
void Divide::RenderingComponent::drawSelectionGizmo | ( | ) |
Draw some kind of selection doodad. May differ if editor is running or not.
Definition at line 824 of file RenderingComponent.cpp.
void Divide::RenderingComponent::drawSkeleton | ( | ) |
Definition at line 884 of file RenderingComponent.cpp.
|
protected |
Definition at line 645 of file RenderingComponent.cpp.
|
protected |
Definition at line 664 of file RenderingComponent.cpp.
U8 Divide::RenderingComponent::getLoDLevel | ( | const F32 | distSQtoCenter, |
RenderStage | renderStage, | ||
vec4< U16 > | lodThresholds | ||
) |
Definition at line 389 of file RenderingComponent.cpp.
|
noexcept |
Definition at line 383 of file RenderingComponent.cpp.
|
protected |
Definition at line 394 of file RenderingComponent.cpp.
void Divide::RenderingComponent::getMaterialData | ( | NodeMaterialData & | dataOut | ) | const |
Definition at line 329 of file RenderingComponent.cpp.
Definition at line 159 of file RenderingComponent.h.
|
protectednoexcept |
Definition at line 323 of file RenderingComponent.cpp.
Definition at line 153 of file RenderingComponent.cpp.
|
inlinenoexcept |
Definition at line 149 of file RenderingComponent.h.
|
inline |
Definition at line 147 of file RenderingComponent.h.
|
inlinenoexcept |
Definition at line 146 of file RenderingComponent.h.
|
overrideprotected |
Definition at line 946 of file RenderingComponent.cpp.
|
protected |
Definition at line 287 of file RenderingComponent.cpp.
|
protected |
Definition at line 50 of file RenderingComponentState.cpp.
|
protected |
Called after the parent node was rendered.
Called after the current node was rendered.
Definition at line 340 of file RenderingComponent.cpp.
|
protected |
Definition at line 415 of file RenderingComponent.cpp.
Divide::RenderingComponent::PROPERTY_R | ( | bool | , |
castsShadows | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_R | ( | bool | , |
receiveShadows | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_R | ( | bool | , |
showAxis | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_R_IW | ( | bool | , |
isInstanced | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_R_IW | ( | bool | , |
rebuildDrawCommands | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_RW | ( | bool | , |
occlusionCull | , | ||
true | |||
) |
Divide::RenderingComponent::PROPERTY_RW | ( | bool | , |
primitiveRestartRequired | , | ||
false | |||
) |
Divide::RenderingComponent::PROPERTY_RW | ( | F32 | , |
dataFlag | , | ||
1. | 0f | ||
) |
void Divide::RenderingComponent::rebuildMaterial | ( | ) |
Definition at line 295 of file RenderingComponent.cpp.
|
noexcept |
Returns true if the specified render option is enabled.
Definition at line 30 of file RenderingComponentState.cpp.
Definition at line 144 of file RenderingComponent.h.
|
protected |
Definition at line 609 of file RenderingComponent.cpp.
|
noexcept |
Definition at line 315 of file RenderingComponent.cpp.
|
noexcept |
Definition at line 214 of file RenderingComponent.cpp.
|
noexcept |
Definition at line 209 of file RenderingComponent.cpp.
|
inline |
Definition at line 163 of file RenderingComponent.h.
|
inline |
Definition at line 164 of file RenderingComponent.h.
|
inlinenoexcept |
Definition at line 143 of file RenderingComponent.h.
|
protected |
Definition at line 34 of file RenderingComponentState.cpp.
void Divide::RenderingComponent::toggleRenderOption | ( | RenderOptions | option, |
bool | state, | ||
bool | recursive = true |
||
) |
Definition at line 11 of file RenderingComponentState.cpp.
|
inline |
Definition at line 148 of file RenderingComponent.h.
|
inlinenoexcept |
Definition at line 150 of file RenderingComponent.h.
Definition at line 777 of file RenderingComponent.cpp.
|
protected |
Definition at line 697 of file RenderingComponent.cpp.
|
protected |
Definition at line 236 of file RenderingComponent.cpp.
|
protected |
Definition at line 738 of file RenderingComponent.cpp.
|
friend |
Definition at line 108 of file RenderingComponent.h.
|
friend |
Definition at line 111 of file RenderingComponent.h.
|
friend |
Definition at line 109 of file RenderingComponent.h.
|
friend |
Definition at line 107 of file RenderingComponent.h.
|
friend |
Definition at line 110 of file RenderingComponent.h.
|
friend |
Definition at line 106 of file RenderingComponent.h.
|
protected |
Definition at line 249 of file RenderingComponent.h.
|
protected |
Definition at line 230 of file RenderingComponent.h.
|
protected |
Definition at line 274 of file RenderingComponent.h.
|
protected |
Definition at line 276 of file RenderingComponent.h.
|
protected |
Definition at line 255 of file RenderingComponent.h.
|
protected |
Definition at line 275 of file RenderingComponent.h.
|
protected |
Definition at line 243 of file RenderingComponent.h.
|
protected |
Definition at line 229 of file RenderingComponent.h.
Definition at line 266 of file RenderingComponent.h.
|
protected |
Definition at line 260 of file RenderingComponent.h.
|
protected |
Definition at line 259 of file RenderingComponent.h.
|
protected |
Definition at line 261 of file RenderingComponent.h.
|
protected |
Definition at line 245 of file RenderingComponent.h.
|
protected |
Definition at line 279 of file RenderingComponent.h.
|
protected |
Definition at line 246 of file RenderingComponent.h.
|
protected |
Definition at line 256 of file RenderingComponent.h.
|
protected |
Definition at line 268 of file RenderingComponent.h.
|
protected |
Definition at line 270 of file RenderingComponent.h.
|
protected |
Definition at line 247 of file RenderingComponent.h.
|
protected |
Definition at line 257 of file RenderingComponent.h.
|
protected |
Definition at line 271 of file RenderingComponent.h.
|
protected |
Definition at line 267 of file RenderingComponent.h.
|
protected |
Definition at line 262 of file RenderingComponent.h.
|
protected |
Definition at line 253 of file RenderingComponent.h.
Definition at line 264 of file RenderingComponent.h.
|
protected |
Definition at line 251 of file RenderingComponent.h.
|
protected |
Definition at line 273 of file RenderingComponent.h.
|
protected |
Definition at line 250 of file RenderingComponent.h.
|
protected |
Definition at line 277 of file RenderingComponent.h.
|
protected |
Definition at line 278 of file RenderingComponent.h.
|
staticconstexpr |
Definition at line 114 of file RenderingComponent.h.