Add material render metadata and loader parsing
This commit is contained in:
@@ -14,6 +14,14 @@
|
||||
namespace XCEngine {
|
||||
namespace Resources {
|
||||
|
||||
enum class MaterialRenderQueue : Core::int32 {
|
||||
Background = 1000,
|
||||
Geometry = 2000,
|
||||
AlphaTest = 2450,
|
||||
Transparent = 3000,
|
||||
Overlay = 4000
|
||||
};
|
||||
|
||||
enum class MaterialPropertyType {
|
||||
Float, Float2, Float3, Float4,
|
||||
Int, Int2, Int3, Int4,
|
||||
@@ -52,6 +60,20 @@ public:
|
||||
|
||||
void SetShader(const ResourceHandle<class Shader>& shader);
|
||||
class Shader* GetShader() const { return m_shader.Get(); }
|
||||
|
||||
void SetRenderQueue(Core::int32 renderQueue);
|
||||
void SetRenderQueue(MaterialRenderQueue renderQueue);
|
||||
Core::int32 GetRenderQueue() const { return m_renderQueue; }
|
||||
|
||||
void SetShaderPass(const Containers::String& shaderPass);
|
||||
const Containers::String& GetShaderPass() const { return m_shaderPass; }
|
||||
|
||||
void SetTag(const Containers::String& name, const Containers::String& value);
|
||||
Containers::String GetTag(const Containers::String& name) const;
|
||||
bool HasTag(const Containers::String& name) const;
|
||||
void RemoveTag(const Containers::String& name);
|
||||
void ClearTags();
|
||||
Core::uint32 GetTagCount() const { return static_cast<Core::uint32>(m_tags.Size()); }
|
||||
|
||||
void SetFloat(const Containers::String& name, float value);
|
||||
void SetFloat2(const Containers::String& name, const Math::Vector2& value);
|
||||
@@ -72,7 +94,8 @@ public:
|
||||
|
||||
const Containers::Array<Core::uint8>& GetConstantBufferData() const { return m_constantBufferData; }
|
||||
void UpdateConstantBuffer();
|
||||
|
||||
void RecalculateMemorySize();
|
||||
|
||||
bool HasProperty(const Containers::String& name) const;
|
||||
void RemoveProperty(const Containers::String& name);
|
||||
void ClearAllProperties();
|
||||
@@ -81,6 +104,13 @@ private:
|
||||
void UpdateMemorySize();
|
||||
|
||||
ResourceHandle<class Shader> m_shader;
|
||||
Core::int32 m_renderQueue = static_cast<Core::int32>(MaterialRenderQueue::Geometry);
|
||||
Containers::String m_shaderPass;
|
||||
struct TagEntry {
|
||||
Containers::String name;
|
||||
Containers::String value;
|
||||
};
|
||||
Containers::Array<TagEntry> m_tags;
|
||||
Containers::HashMap<Containers::String, MaterialProperty> m_properties;
|
||||
Containers::Array<Core::uint8> m_constantBufferData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user