rework label shader
This commit is contained in:
@@ -25,22 +25,23 @@ namespace OpenVulkano::Scene
|
||||
Math::Vector4f backgroundColor = { 1, 0, 0, 1 };
|
||||
float horizontalOffset = 0.05f;
|
||||
float verticalOffset = 0.05f;
|
||||
float cornerRadius = 0.5f;
|
||||
float cornerRadius = 0.05f;
|
||||
float arrowLength = 0.5f;
|
||||
float arrowWidth = 0.2f;
|
||||
int32_t hasRoundedCorners = false;
|
||||
int32_t hasArrow = false;
|
||||
};
|
||||
|
||||
namespace
|
||||
struct LabelUniformData
|
||||
{
|
||||
struct LabelUniformData
|
||||
{
|
||||
Math::Vector2f textSize = { 0, 0 };
|
||||
float cornerRadius = 0.f;
|
||||
float arrowLength = 0.f;
|
||||
int32_t hasRoundedCorners = false;
|
||||
int32_t hasArrow = false;
|
||||
};
|
||||
Math::Vector4f textSize = { 0, 0, 0, 0 };
|
||||
Math::Vector4f color = { 0, 0, 0, 0 };
|
||||
Math::Vector4f bboxCenter = { 0, 0, 0, 0 };
|
||||
float cornerRadius = 0.f;
|
||||
float arrowLength = 0.f;
|
||||
float arrowWidth = 0.f;
|
||||
int32_t hasRoundedCorners = false;
|
||||
int32_t hasArrow = false;
|
||||
};
|
||||
|
||||
class LabelDrawable final : public Drawable
|
||||
@@ -56,7 +57,6 @@ namespace OpenVulkano::Scene
|
||||
LabelDrawableSettings& GetSettings() { return m_settings; }
|
||||
UniformBuffer* GetBillboardBuffer() { return &m_billboardBuffer; }
|
||||
UniformBuffer* GetLabelBuffer() { return &m_labelBuffer; }
|
||||
Geometry& GetBackgroundGeometry() { return m_backgroundGeometry; }
|
||||
BillboardControlBlock& GetBillboardSettings() { return m_billboardSettings; }
|
||||
Math::Vector3f& GetPosition() { return m_position; }
|
||||
bool IsBillboard() const { return m_isBillboard; }
|
||||
@@ -67,10 +67,8 @@ namespace OpenVulkano::Scene
|
||||
void SetupBuffers();
|
||||
private:
|
||||
Shader m_backgroundShader;
|
||||
Geometry m_backgroundGeometry;
|
||||
UniformBuffer m_billboardBuffer;
|
||||
UniformBuffer m_labelBuffer;
|
||||
std::vector<Shader> m_billboardTextShaders;
|
||||
// list over vector to prevent memory reallocation and crash
|
||||
std::list<TextDrawable> m_texts;
|
||||
Shader m_textShader;
|
||||
|
||||
Reference in New Issue
Block a user