3#include <Core/World/World.h>
4#include <RendererCore/Components/RenderComponent.h>
5#include <RendererCore/Material/MaterialResource.h>
6#include <RendererCore/Meshes/MeshResource.h>
7#include <RendererCore/Pipeline/RenderData.h>
17 virtual void FillBatchIdAndSortingKey();
23 plUInt32 m_uiSubMeshIndex : 30;
24 plUInt32 m_uiFlipWinding : 1;
25 plUInt32 m_uiUniformScale : 1;
27 plUInt32 m_uiUniqueID = 0;
30 PL_FORCE_INLINE
void FillBatchIdAndSortingKeyInternal(plUInt32 uiAdditionalBatchData)
32 m_uiFlipWinding = m_GlobalTransform.HasMirrorScaling() ? 1 : 0;
33 m_uiUniformScale = m_GlobalTransform.ContainsUniformScale() ? 1 : 0;
39 plUInt32 data[] = {uiMeshIDHash, uiMaterialIDHash, m_uiSubMeshIndex, m_uiFlipWinding, uiAdditionalBatchData};
43 m_uiSortingKey = (uiMaterialIDHash << 16) | ((uiMeshIDHash + m_uiSubMeshIndex) & 0xFFFE) | m_uiFlipWinding;
52 void SetMaterialFile(
const char* szFile);
53 const char* GetMaterialFile()
const;
59 plUInt32 m_uiMaterialSlot = 0xFFFFFFFFu;
61 virtual void Serialize(
plStreamWriter& inout_stream)
const override;
62 virtual void Deserialize(
plStreamReader& inout_stream, plUInt8 uiTypeVersion)
override;
74 virtual void SerializeComponent(
plWorldWriter& inout_stream)
const override;
75 virtual void DeserializeComponent(
plWorldReader& inout_stream)
override;
98 void SetMeshFile(
const char* szFile);
99 const char* GetMeshFile()
const;
102 void SetColor(
const plColor& color);
103 const plColor& GetColor()
const;
108 void SetSortingDepthOffset(
float fOffset);
109 float GetSortingDepthOffset()
const;
117 plUInt32 Materials_GetCount()
const;
118 const char* Materials_GetValue(plUInt32 uiIndex)
const;
119 void Materials_SetValue(plUInt32 uiIndex,
const char* value);
120 void Materials_Insert(plUInt32 uiIndex,
const char* value);
121 void Materials_Remove(plUInt32 uiIndex);
128 float m_fSortingDepthOffset = 0.0f;
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
static const plColor White
#FFFFFF
Definition Color.h:194
Definition DynamicArray.h:81
static plUInt32 xxHash32(const void *pKey, size_t uiSizeInByte, plUInt32 uiSeed=0)
Calculates the 32bit xxHash of the given key.
Definition HashingUtils.cpp:209
static constexpr plUInt32 StringHashTo32(plUInt64 uiHash)
Truncates a 64 bit string hash to 32 bit.
Definition HashingUtils_inl.h:138
Base class for components that render static or animated meshes.
Definition MeshComponentBase.h:67
Definition MeshComponentBase.h:13
Base class for all message types. Each message type has it's own id which is used to dispatch message...
Definition Message.h:22
Base class for objects that should be rendered.
Definition RenderComponent.h:9
Base class for all render data. Render data must contain all information that is needed to render the...
Definition RenderData.h:14
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
PL_ALWAYS_INLINE bool IsValid() const
Returns whether the handle stores a valid pointer to a resource.
Definition ResourceHandle.h:206
PL_ALWAYS_INLINE plUInt64 GetResourceIDHash() const
Returns the Resource ID hash of the exact resource that this handle points to, without acquiring the ...
Definition ResourceHandle.h:216
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
Definition InstanceDataProvider.h:12
A message to modify the main color of some thing.
Definition SetColorMessage.h:32
This message is used to replace the material on a mesh.
Definition MeshComponentBase.h:49
plMaterialResourceHandle m_hMaterial
The material to be used.
Definition MeshComponentBase.h:56
Definition UpdateLocalBoundsMessage.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54