implement billboard shader and add new example

This commit is contained in:
ohyzha
2024-07-18 14:48:50 +03:00
parent 5023fe64ce
commit cfb8b76801
14 changed files with 406 additions and 12 deletions

View File

@@ -9,19 +9,21 @@
namespace OpenVulkano::Scene
{
void SimpleDrawable::Init(Shader* shader, Geometry* mesh, Material* material)
void SimpleDrawable::Init(Shader* shader, Geometry* mesh, Material* material, UniformBuffer* uniBuffer)
{
if (m_mesh || m_material) throw std::runtime_error("Drawable is already initialized.");
if (m_mesh || m_material || m_uniBuffer) throw std::runtime_error("Drawable is already initialized.");
m_mesh = mesh;
m_material = material;
m_uniBuffer = uniBuffer;
SetShader(shader);
}
void SimpleDrawable::Init(SimpleDrawable* drawable)
{
if (m_mesh || m_material) throw std::runtime_error("Drawable is already initialized.");
if (m_mesh || m_material || m_uniBuffer) throw std::runtime_error("Drawable is already initialized.");
m_mesh = drawable->m_mesh;
m_material = drawable->m_material;
m_uniBuffer = drawable->m_uniBuffer;
SetShader(drawable->GetShader());
}
}