Plasma Engine  2.0
Loading...
Searching...
No Matches
QuadParticleRenderer.h
1#pragma once
2
3#include <ParticlePlugin/Declarations.h>
4#include <ParticlePlugin/Renderer/ParticleRenderer.h>
5#include <RendererCore/Pipeline/Declarations.h>
6#include <RendererCore/Pipeline/RenderData.h>
7
8#include <RendererCore/../../../Data/Base/Shaders/Particles/BillboardQuadParticleShaderData.h>
9#include <RendererCore/../../../Data/Base/Shaders/Particles/TangentQuadParticleShaderData.h>
10
11class PL_PARTICLEPLUGIN_DLL plParticleQuadRenderData final : public plRenderData
12{
13 PL_ADD_DYNAMIC_REFLECTION(plParticleQuadRenderData, plRenderData);
14
15public:
18 plArrayPtr<plBaseParticleShaderData> m_BaseParticleData;
21 plTime m_TotalEffectLifeTime;
22 bool m_bApplyObjectTransform = true;
23 plUInt8 m_uiNumVariationsX = 1;
24 plUInt8 m_uiNumVariationsY = 1;
25 plUInt8 m_uiNumFlipbookAnimationsX = 1;
26 plUInt8 m_uiNumFlipbookAnimationsY = 1;
27
28 plTexture2DResourceHandle m_hDistortionTexture;
29 float m_fDistortionStrength = 0;
30 plTempHashedString m_QuadModePermutation;
31
32 plEnum<plParticleLightingMode> m_LightingMode;
33 float m_fNormalCurvature = 0.5f;
34 float m_fLightDirectionality = 0.5f;
35};
36
38class PL_PARTICLEPLUGIN_DLL plParticleQuadRenderer final : public plParticleRenderer
39{
40 PL_ADD_DYNAMIC_REFLECTION(plParticleQuadRenderer, plParticleRenderer);
41 PL_DISALLOW_COPY_AND_ASSIGN(plParticleQuadRenderer);
42
43public:
46
47 virtual void GetSupportedRenderDataTypes(plHybridArray<const plRTTI*, 8>& ref_types) const override;
48 virtual void RenderBatch(
49 const plRenderViewContext& renderContext, const plRenderPipelinePass* pPass, const plRenderDataBatch& batch) const override;
50
51
52protected:
53 void ConfigureRenderMode(const plParticleQuadRenderData* pRenderData, plRenderContext* pRenderContext) const;
54
55 static const plUInt32 s_uiParticlesPerBatch = 1024;
56 plGALBufferHandle m_hBaseDataBuffer;
57 plGALBufferHandle m_hBillboardDataBuffer;
58 plGALBufferHandle m_hTangentDataBuffer;
59};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition RendererFoundationDLL.h:418
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition QuadParticleRenderer.h:12
Implements rendering of particle systems.
Definition QuadParticleRenderer.h:39
Implements rendering of particle systems.
Definition ParticleRenderer.h:16
Definition RenderContext.h:30
Definition RenderDataBatch.h:6
Base class for all render data. Render data must contain all information that is needed to render the...
Definition RenderData.h:14
Definition RenderPipelinePass.h:26
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition Declarations.h:51
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12