Plasma Engine  2.0
Loading...
Searching...
No Matches
PickingRenderPass.h
1#pragma once
2
3#include <EditorEngineProcessFramework/EngineProcess/ViewRenderSettings.h>
4#include <RendererCore/Pipeline/RenderPipelinePass.h>
5#include <RendererFoundation/Resources/RenderTargetSetup.h>
6
7class PL_EDITORENGINEPROCESSFRAMEWORK_DLL plPickingRenderPass : public plRenderPipelinePass
8{
9 PL_ADD_DYNAMIC_REFLECTION(plPickingRenderPass, plRenderPipelinePass);
10
11public:
14
15 plGALTextureHandle GetPickingIdRT() const;
16 plGALTextureHandle GetPickingDepthRT() const;
17
20 virtual void InitRenderPipelinePass(
22 virtual void Execute(const plRenderViewContext& renderViewContext, const plArrayPtr<plRenderPipelinePassConnection* const> inputs,
24
25 virtual void ReadBackProperties(plView* pView) override;
26
27 bool m_bPickSelected = true;
28 bool m_bPickTransparent = true;
29
30 plVec2 m_PickingPosition = plVec2(-1);
31 plUInt32 m_PickingIdOut = 0;
32 float m_PickingDepthOut = 0.0f;
33 plVec2 m_MarqueePickPosition0 = plVec2(-1);
34 plVec2 m_MarqueePickPosition1 = plVec2(-1);
35 plUInt32 m_uiMarqueeActionID = 0xFFFFFFFF; // used to prevent reusing an old result for a new marquee action
36 plUInt32 m_uiWindowWidth = 0;
37 plUInt32 m_uiWindowHeight = 0;
38
39private:
40 void CreateTarget();
41 void DestroyTarget();
42
43 void ReadBackPropertiesSinglePick(plView* pView);
44 void ReadBackPropertiesMarqueePick(plView* pView);
45
46private:
47 plRectFloat m_TargetRect;
48
49 plGALTextureHandle m_hPickingIdRT;
50 plGALTextureHandle m_hPickingDepthRT;
51 plGALRenderTargetSetup m_RenderTargetSetup;
52
53 plHashSet<plGameObjectHandle> m_SelectionSet;
54
55
57 plMat4 m_mPickingInverseViewProjectionMatrix = plMat4::MakeZero();
58
60 plDynamicArray<float> m_PickingResultsDepth;
61
63 plDynamicArray<plUInt32> m_PickingResultsID;
64};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition DynamicArray.h:81
Definition RenderTargetSetup.h:19
Definition RendererFoundationDLL.h:411
Definition HashSet.h:191
static plMat4Template< float > MakeZero()
Definition Mat4_inl.h:64
Definition PickingRenderPass.h:8
Definition RenderPipelinePass.h:26
virtual void InitRenderPipelinePass(const plArrayPtr< plRenderPipelinePassConnection *const > inputs, const plArrayPtr< plRenderPipelinePassConnection *const > outputs)
After GetRenderTargetDescriptions was called successfully for each pass, this function is called with...
Definition RenderPipelinePass.cpp:52
virtual void Execute(const plRenderViewContext &renderViewContext, const plArrayPtr< plRenderPipelinePassConnection *const > inputs, const plArrayPtr< plRenderPipelinePassConnection *const > outputs)=0
Render into outputs. Both inputs and outputs are passed in with actual texture handles....
virtual void ReadBackProperties(plView *pView)
Allows for the pass to write data back using plView::SetRenderPassReadBackProperty....
Definition RenderPipelinePass.cpp:56
virtual bool GetRenderTargetDescriptions(const plView &view, const plArrayPtr< plGALTextureCreationDescription *const > inputs, plArrayPtr< plGALTextureCreationDescription > outputs)=0
For a given input pin configuration, provide the output configuration of this node....
Encapsulates a view on the given world through the given camera and rendered with the specified Rende...
Definition View.h:21
Definition Declarations.h:51