33 namespace ReflectionUtil
55 namespace RefractionUtil
59 [[nodiscard]]
bool isInBudget() noexcept
63 void resetBudget() noexcept
67 void updateBudget() noexcept
71 [[nodiscard]]
U16 currentEntry() noexcept
79 : _dependencies( dependencies )
82 , _config( context.context().config() )
83 , _name( TypeUtil::RenderStageToString( renderStage ) )
84 , _stageFlag( renderStage )
115 params._passName =
"MainRenderPass";
120 params._targetDescriptorPrePass._keepMSAADataAfterResolve =
true;
123 params._targetDescriptorMainPass._autoResolveMSAA =
false;
124 params._targetDescriptorMainPass._keepMSAADataAfterResolve =
true;
131 STUBBED(
"TODO: Figure out why we need to clear the main render target in order to avoid NAN/INF issues in SSR -Ionut");
143 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"Main Display Pass";
149 GFX::EnqueueCommand<GFX::PushCameraCommand>( bufferInOut )->_cameraSnapshot = camSnapshot;
152 beginRenderPassCmd->
_name =
"DO_POST_RENDER_PASS";
156 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"Debug Draw Pass";
158 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
165 GFX::EnqueueCommand<GFX::EndRenderPassCommand>( bufferInOut );
167 GFX::EnqueueCommand<GFX::PopCameraCommand>( bufferInOut );
169 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
177 if (editor.running() && editor.nodePreviewWindowVisible())
195 const CameraSnapshot& camSnapshot = editor.nodePreviewCamera()->snapshot();
196 GFX::EnqueueCommand<GFX::PushCameraCommand>( bufferInOut )->_cameraSnapshot = camSnapshot;
199 beginRenderPassCmd->
_name =
"DO_POST_RENDER_PASS";
205 GFX::EnqueueCommand<GFX::EndRenderPassCommand>( bufferInOut );
207 GFX::EnqueueCommand<GFX::PopCameraCommand>( bufferInOut );
221 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"Shadow Render Stage";
225 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
234 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"Reflection Pass";
243 for (
const auto& probe : probes )
260 ReflectionUtil::resetBudget();
261 for (
size_t i = 0; i < s_Nodes.
size(); ++i )
266 ReflectionUtil::currentEntry(),
267 ReflectionUtil::isInBudget(),
273 ReflectionUtil::updateBudget();
277 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
285 GFX::EnqueueCommand<GFX::BeginDebugScopeCommand>( bufferInOut )->_scopeName =
"Refraction Pass";
294 RefractionUtil::resetBudget();
295 for (
size_t i = 0; i < s_Nodes.
size(); ++i )
300 RefractionUtil::currentEntry(),
301 RefractionUtil::isInBudget(),
307 RefractionUtil::updateBudget();
312 GFX::EnqueueCommand<GFX::EndDebugScopeCommand>( bufferInOut );
#define PROFILE_SCOPE_AUTO(CATEGORY)
#define PROFILE_SCOPE(NAME, CATEGORY)
static void postRender(Editor &editor, const RenderStage stage, const CameraSnapshot &cameraSnapshot, const RenderTargetID target, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static Camera * playerCamera(const Divide::ProjectManager *mgr, const bool skipOverride=false) noexcept
static LightPool & lightPool(Divide::ProjectManager *mgr)
static void debugDraw(Divide::ProjectManager *mgr, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static bool updateRefraction(RenderingComponent &renderable, const U16 refractionIndex, const bool inBudget, Camera *camera, const SceneRenderState &renderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static bool updateReflection(RenderingComponent &renderable, const U16 reflectionIndex, const bool inBudget, Camera *camera, const SceneRenderState &renderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static SceneEnvironmentProbePool * getEnvProbes(Scene *scene) noexcept
const CameraSnapshot & snapshot() const noexcept
Returns the internal camera snapshot data (eye, orientation, etc)
const RenderTargetHandle & getNodePreviewTarget() const noexcept
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
Kernel & parent() noexcept
void generateShadowMaps(const Camera &playerCamera, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
void sortLightData(RenderStage stage, const CameraSnapshot &cameraSnapshot)
PlatformContext & context() noexcept
Editor & editor() noexcept
void getSortedReflectiveNodes(const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const
get the full list of reflective nodes
void getSortedRefractiveNodes(const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const
get the full list of refractive nodes
PassData getPassData() const noexcept
U32 _transformIndexOffset
void render(PlayerIndex idx, const Task &parentTask, const SceneRenderState &renderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) const
RenderPassManager & _parent
RenderPass(RenderPassManager &parent, GFXDevice &context, RenderStage renderStage, const vector< RenderStage > &dependencies)
void doCustomPass(Camera *const camera, RenderPassParams params, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
void unlockProbeList() const noexcept
const EnvironmentProbeList & sortAndGetLocked(const vec3< F32 > &position)
static void Prepare(GFX::CommandBuffer &bufferInOut)
void lockProbeList() const noexcept
FORCE_INLINE T * get() const
Returns a pointer to a specific component. Returns null if the SGN does not have the component reques...
void set(const T *v) noexcept
set the 3 components of the vector manually using a source pointer to a (large enough) array
constexpr bool ENABLE_EDITOR
constexpr U8 MAX_REFLECTIVE_PROBES_PER_PASS
Maximum number of environment probes we are allowed to update per frame.
constexpr U16 MAX_VISIBLE_NODES
Estimated maximum number of visible objects per render pass (this includes debug primitives)
constexpr Optick::Category::Type Scene
void updateBudget() noexcept
U16 currentEntry() noexcept
bool isInBudget() noexcept
void resetBudget() noexcept
Handle console commands that start with a forward slash.
static constexpr U32 RT_DEPTH_ATTACHMENT_IDX
void SetDefaultDrawDescriptor(RenderPassParams ¶ms)
eastl::vector< Type > vector
static constexpr U8 TotalPassCountForStage(const RenderStage renderStage)
RTClearEntry DEFAULT_CLEAR_ENTRY
vector< EnvironmentProbeComponent * > EnvironmentProbeList
static const vec4< F32 > VECTOR4_ZERO
constexpr auto to_base(const Type value) -> Type
struct Divide::Configuration::Rendering::ShadowMapping shadowMapping
struct Divide::Configuration::Rendering rendering
RTDrawDescriptor _descriptor
static constexpr RTColourAttachmentSlot ALBEDO
static constexpr RTColourAttachmentSlot NORMALS
static constexpr RTColourAttachmentSlot VELOCITY
bool _keepMSAADataAfterResolve
RTClearDescriptor _clearDescriptorPrePass
I64 _singleNodeRenderGUID
RTDrawDescriptor _targetDescriptorPrePass
RTDrawDescriptor _targetDescriptorMainPass
RenderStagePass _stagePass
RTClearDescriptor _clearDescriptorMainPass
static RenderTargetID HI_Z
static RenderTargetID OIT
static RenderTargetID SCREEN
size_t size() const noexcept
const T & node(const size_t idx) const noexcept