implement billboard shader and add new example
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user