Plasma Engine  2.0
Loading...
Searching...
No Matches
ProcGenNodes.h
1#pragma once
2
3#include <Foundation/CodeUtils/Expression/ExpressionAST.h>
4#include <Foundation/Types/TagSet.h>
5#include <ProcGenPlugin/Resources/ProcGenGraphSharedData.h>
6#include <RendererCore/Pipeline/RenderPipelineNode.h>
7
9{
10 PL_ADD_DYNAMIC_REFLECTION(plProcGenNodeBase, plReflectedClass);
11
12public:
14 {
15 enum OutputType
16 {
17 Unknown,
18 Placement,
19 Color,
20 };
21
23 plHybridArray<plUInt8, 4> m_VolumeTagSetIndices;
24 OutputType m_OutputType = OutputType::Unknown;
25 };
26
27 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) = 0;
28};
29
31
33{
34 PL_ADD_DYNAMIC_REFLECTION(plProcGenOutput, plProcGenNodeBase);
35
36public:
37 bool m_bActive = true;
38
39 void Save(plStreamWriter& inout_stream);
40
41 plString m_sName;
42
43 plHybridArray<plUInt8, 4> m_VolumeTagSetIndices;
44};
45
47
49{
50 PL_ADD_DYNAMIC_REFLECTION(plProcGen_PlacementOutput, plProcGenOutput);
51
52public:
53 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
54
55 void Save(plStreamWriter& inout_stream);
56
57 plHybridArray<plString, 4> m_ObjectsToPlace;
58
59 float m_fFootprint = 1.0f;
60
61 plVec3 m_vMinOffset = plVec3(0);
62 plVec3 m_vMaxOffset = plVec3(0);
63
64 plAngle m_YawRotationSnap = plAngle::MakeFromRadian(0.0f);
65 float m_fAlignToNormal = 1.0f;
66
67 plVec3 m_vMinScale = plVec3(1);
68 plVec3 m_vMaxScale = plVec3(1);
69
70 float m_fCullDistance = 30.0f;
71
72 plUInt32 m_uiCollisionLayer = 0;
73
74 plString m_sSurface;
75
76 plString m_sColorGradient;
77
78 plEnum<plProcPlacementMode> m_PlacementMode;
79 plEnum<plProcPlacementPattern> m_PlacementPattern;
80
83 plRenderPipelineNodeInputPin m_ColorIndexPin;
84 plRenderPipelineNodeInputPin m_ObjectIndexPin;
85};
86
88
90{
91 PL_ADD_DYNAMIC_REFLECTION(plProcGen_VertexColorOutput, plProcGenOutput);
92
93public:
94 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
95
96 void Save(plStreamWriter& inout_stream);
97
102};
103
105
107{
108 PL_ADD_DYNAMIC_REFLECTION(plProcGen_Random, plProcGenNodeBase);
109
110public:
111 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
112
113 plInt32 m_iSeed = -1;
114
115 float m_fOutputMin = 0.0f;
116 float m_fOutputMax = 1.0f;
117
118 plRenderPipelineNodeOutputPin m_OutputValuePin;
119
120private:
121 void OnObjectCreated(const plAbstractObjectNode& node);
122
123 plUInt32 m_uiAutoSeed;
124};
125
127
129{
130 PL_ADD_DYNAMIC_REFLECTION(plProcGen_PerlinNoise, plProcGenNodeBase);
131
132public:
133 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
134
135 plVec3 m_Scale = plVec3(10);
136 plVec3 m_Offset = plVec3::MakeZero();
137 plUInt32 m_uiNumOctaves = 3;
138
139 float m_fOutputMin = 0.0f;
140 float m_fOutputMax = 1.0f;
141
142 plRenderPipelineNodeOutputPin m_OutputValuePin;
143};
144
146
148{
149 PL_ADD_DYNAMIC_REFLECTION(plProcGen_Blend, plProcGenNodeBase);
150
151public:
152 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
153
155 float m_fInputValueA = 1.0f;
156 float m_fInputValueB = 1.0f;
157 bool m_bClampOutput = false;
158
159 plRenderPipelineNodeInputPin m_InputValueAPin;
160 plRenderPipelineNodeInputPin m_InputValueBPin;
161 plRenderPipelineNodeOutputPin m_OutputValuePin;
162};
163
165
167{
168 PL_ADD_DYNAMIC_REFLECTION(plProcGen_Height, plProcGenNodeBase);
169
170public:
171 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
172
173 float m_fMinHeight = 0.0f;
174 float m_fMaxHeight = 1000.0f;
175 float m_fLowerFade = 0.2f;
176 float m_fUpperFade = 0.2f;
177
178 plRenderPipelineNodeOutputPin m_OutputValuePin;
179};
180
182
184{
185 PL_ADD_DYNAMIC_REFLECTION(plProcGen_Slope, plProcGenNodeBase);
186
187public:
188 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
189
190 plAngle m_MinSlope = plAngle::MakeFromDegree(0.0f);
191 plAngle m_MaxSlope = plAngle::MakeFromDegree(30.0f);
192 float m_fLowerFade = 0.0f;
193 float m_fUpperFade = 0.2f;
194
195 plRenderPipelineNodeOutputPin m_OutputValuePin;
196};
197
199
201{
202 PL_ADD_DYNAMIC_REFLECTION(plProcGen_MeshVertexColor, plProcGenNodeBase);
203
204public:
205 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
206
211};
212
214
216{
217 PL_ADD_DYNAMIC_REFLECTION(plProcGen_ApplyVolumes, plProcGenNodeBase);
218
219public:
220 virtual plExpressionAST::Node* GenerateExpressionASTNode(plTempHashedString sOutputName, plArrayPtr<plExpressionAST::Node*> inputs, plExpressionAST& out_ast, GraphContext& ref_context) override;
221
222 float m_fInputValue = 0.0f;
223
224 plTagSet m_IncludeTags;
225
226 plEnum<plProcVolumeImageMode> m_ImageVolumeMode;
227 plColorGammaUB m_RefColor;
228
229 plRenderPipelineNodeInputPin m_InputValuePin;
230 plRenderPipelineNodeOutputPin m_OutputValuePin;
231};
Definition AbstractObjectGraph.h:17
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
static constexpr plAngle MakeFromDegree(float fDegree)
Creates an instance of plAngle that was initialized from degree. (Performs a conversion)
Definition Angle_inl.h:33
static constexpr plAngle MakeFromRadian(float fRadian)
Creates an instance of plAngle that was initialized from radian. (No need for any conversion)
Definition Angle_inl.h:38
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
A 8bit per channel unsigned normalized (values interpreted as 0-1) color storage format that represen...
Definition Color8UNorm.h:99
Definition ExpressionAST.h:9
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition ProcGenNodes.h:216
Definition ProcGenNodes.h:148
Definition ProcGenNodes.h:167
Definition ProcGenNodes.h:201
Definition ProcGenNodes.h:129
Definition ProcGenNodes.h:49
Definition ProcGenNodes.h:107
Definition ProcGenNodes.h:184
Definition ProcGenNodes.h:90
Definition ProcGenGraphSharedData.h:10
Definition ProcGenNodes.h:9
Definition ProcGenNodes.h:33
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Interface for binary out (write) streams.
Definition Stream.h:107
A dynamic collection of tags featuring fast lookups.
Definition TagSet.h:23
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
static plVec3Template< float > MakeZero()
Definition Vec3.h:38
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition ExpressionAST.h:195
Definition ProcGenNodes.h:14
Definition RenderPipelineNode.h:44
Definition RenderPipelineNode.h:51