Added KRMeshManager::KRENGINE_VBO_DATA_RANDOM_PARTICLES and KRMeshManager::KRENGINE_VBO_DATA_VOLUMETRIC_LIGHTING.
The random particle and volumetric lighting plane geometry is now static, computed on initialization, and no longer lazily initialized. Removed KRMeshManager::bindVBO function overload that accepted KRDataBlock's directly for index and vertex data. This was creating KRVBOData objects with KRVBOData::IMMEDIATE that were no longer being owned or de-allocated by KRMeshManager.
This commit is contained in:
@@ -63,7 +63,7 @@ KRCamera::KRCamera(KRScene &scene, std::string name) : KRNode(scene, name) {
|
|||||||
|
|
||||||
m_fade_color = Vector4::Zero();
|
m_fade_color = Vector4::Zero();
|
||||||
|
|
||||||
m_debug_text_vbo_data.init(m_pContext->getMeshManager(), m_debug_text_vertices, m_debug_text_indices, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA), true, KRMeshManager::KRVBOData::IMMEDIATE
|
m_debug_text_vbo_data.init(m_pContext->getMeshManager(), &m_debug_text_vertices, &m_debug_text_indices, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA), true, KRMeshManager::KRVBOData::IMMEDIATE
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, "Debug Text"
|
, "Debug Text"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -274,13 +274,9 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_PARTICLE_ORIGIN, Matrix4::DotWDiv(Matrix4::Invert(particleModelMatrix), Vector3::Zero()));
|
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_PARTICLE_ORIGIN, Matrix4::DotWDiv(Matrix4::Invert(particleModelMatrix), Vector3::Zero()));
|
||||||
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, m_dust_particle_size);
|
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, m_dust_particle_size);
|
||||||
pParticleShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, particleModelMatrix, &this_point_light, &this_directional_light, &this_spot_light, ri.renderPass);
|
pParticleShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, particleModelMatrix, &this_point_light, &this_directional_light, &this_spot_light, ri.renderPass);
|
||||||
|
|
||||||
KRDataBlock particle_index_data;
|
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, &m_pContext->getMeshManager()->KRENGINE_VBO_DATA_RANDOM_PARTICLES, 1.0f);
|
||||||
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, m_pContext->getMeshManager()->getRandomParticles(), particle_index_data, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA), true, 1.0f
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, "Light Particles"
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
vkCmdDraw(ri.commandBuffer, particle_count * 3, 1, 0, 0);
|
vkCmdDraw(ri.commandBuffer, particle_count * 3, 1, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,13 +325,8 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
pFogShader->setUniform(KRPipeline::KRENGINE_UNIFORM_SLICE_DEPTH_SCALE, Vector2::Create(slice_near, slice_spacing));
|
pFogShader->setUniform(KRPipeline::KRENGINE_UNIFORM_SLICE_DEPTH_SCALE, Vector2::Create(slice_near, slice_spacing));
|
||||||
pFogShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, (m_color * ri.camera->settings.volumetric_environment_intensity * m_intensity * -slice_spacing / 1000.0f));
|
pFogShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, (m_color * ri.camera->settings.volumetric_environment_intensity * m_intensity * -slice_spacing / 1000.0f));
|
||||||
pFogShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, Matrix4(), &this_point_light, &this_directional_light, &this_spot_light, KRNode::RENDER_PASS_VOLUMETRIC_EFFECTS_ADDITIVE);
|
pFogShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, Matrix4(), &this_point_light, &this_directional_light, &this_spot_light, KRNode::RENDER_PASS_VOLUMETRIC_EFFECTS_ADDITIVE);
|
||||||
|
|
||||||
KRDataBlock index_data;
|
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, &m_pContext->getMeshManager()->KRENGINE_VBO_DATA_VOLUMETRIC_LIGHTING, 1.0f);
|
||||||
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, m_pContext->getMeshManager()->getVolumetricLightingVertexes(), index_data, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX), true, 1.0f
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, "Participating Media"
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
vkCmdDraw(ri.commandBuffer, slice_count * 6, 1, 0, 0);
|
vkCmdDraw(ri.commandBuffer, slice_count * 6, 1, 0, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ void KRMesh::createDataBlocks(KRMeshManager::KRVBOData::vbo_type t)
|
|||||||
if((int)m_submeshes[iSubmesh]->vertex_data_blocks.size() <= vbo_index) {
|
if((int)m_submeshes[iSubmesh]->vertex_data_blocks.size() <= vbo_index) {
|
||||||
KRDataBlock *vertex_data_block = m_pData->getSubBlock(vertex_data_offset + start_vertex_offset * m_vertex_size, vertex_count * m_vertex_size);
|
KRDataBlock *vertex_data_block = m_pData->getSubBlock(vertex_data_offset + start_vertex_offset * m_vertex_size, vertex_count * m_vertex_size);
|
||||||
KRDataBlock *index_data_block = m_pData->getSubBlock(index_data_offset + start_index_offset * 2, index_count * 2);
|
KRDataBlock *index_data_block = m_pData->getSubBlock(index_data_offset + start_index_offset * 2, index_count * 2);
|
||||||
KRMeshManager::KRVBOData *vbo_data_block = new KRMeshManager::KRVBOData(getContext().getMeshManager(), *vertex_data_block, *index_data_block, vertex_attrib_flags, true, t
|
KRMeshManager::KRVBOData *vbo_data_block = new KRMeshManager::KRVBOData(getContext().getMeshManager(), vertex_data_block, index_data_block, vertex_attrib_flags, true, t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, m_lodBaseName.c_str()
|
, m_lodBaseName.c_str()
|
||||||
#endif
|
#endif
|
||||||
@@ -401,7 +401,7 @@ void KRMesh::createDataBlocks(KRMeshManager::KRVBOData::vbo_type t)
|
|||||||
if((int)m_submeshes[iSubmesh]->vertex_data_blocks.size() <= vbo_index) {
|
if((int)m_submeshes[iSubmesh]->vertex_data_blocks.size() <= vbo_index) {
|
||||||
KRDataBlock *index_data_block = NULL;
|
KRDataBlock *index_data_block = NULL;
|
||||||
KRDataBlock *vertex_data_block = m_pData->getSubBlock(vertex_data_offset + iBuffer * MAX_VBO_SIZE * vertex_size, vertex_size * cBufferVertexes);
|
KRDataBlock *vertex_data_block = m_pData->getSubBlock(vertex_data_offset + iBuffer * MAX_VBO_SIZE * vertex_size, vertex_size * cBufferVertexes);
|
||||||
KRMeshManager::KRVBOData *vbo_data_block = new KRMeshManager::KRVBOData(getContext().getMeshManager(), *vertex_data_block, *index_data_block, vertex_attrib_flags, true, t
|
KRMeshManager::KRVBOData *vbo_data_block = new KRMeshManager::KRVBOData(getContext().getMeshManager(), vertex_data_block, index_data_block, vertex_attrib_flags, true, t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, m_lodBaseName.c_str()
|
, m_lodBaseName.c_str()
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -79,13 +79,14 @@ void KRMeshManager::init() {
|
|||||||
memcpy(KRENGINE_VBO_3D_CUBE_VERTICES.getStart(), _KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(float) * 3 * 14);
|
memcpy(KRENGINE_VBO_3D_CUBE_VERTICES.getStart(), _KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(float) * 3 * 14);
|
||||||
KRENGINE_VBO_3D_CUBE_VERTICES.unlock();
|
KRENGINE_VBO_3D_CUBE_VERTICES.unlock();
|
||||||
|
|
||||||
KRENGINE_VBO_DATA_3D_CUBE_VERTICES.init(this, KRENGINE_VBO_3D_CUBE_VERTICES, KRENGINE_VBO_3D_CUBE_INDEXES, KRENGINE_VBO_3D_CUBE_ATTRIBS, false, KRVBOData::CONSTANT
|
KRENGINE_VBO_DATA_3D_CUBE_VERTICES.init(this, &KRENGINE_VBO_3D_CUBE_VERTICES, nullptr, KRENGINE_VBO_3D_CUBE_ATTRIBS, false, KRVBOData::CONSTANT
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, "Cube Mesh [built-in]"
|
, "Cube Mesh [built-in]"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
initRandomParticles();
|
||||||
|
initVolumetricLightingVertexes();
|
||||||
|
|
||||||
static const float _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
|
static const float _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
|
||||||
-1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
|
-1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
|
||||||
@@ -99,7 +100,7 @@ void KRMeshManager::init() {
|
|||||||
memcpy(KRENGINE_VBO_2D_SQUARE_VERTICES.getStart(), _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(float) * 5 * 4);
|
memcpy(KRENGINE_VBO_2D_SQUARE_VERTICES.getStart(), _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(float) * 5 * 4);
|
||||||
KRENGINE_VBO_2D_SQUARE_VERTICES.unlock();
|
KRENGINE_VBO_2D_SQUARE_VERTICES.unlock();
|
||||||
|
|
||||||
KRENGINE_VBO_DATA_2D_SQUARE_VERTICES.init(this, KRENGINE_VBO_2D_SQUARE_VERTICES, KRENGINE_VBO_2D_SQUARE_INDEXES, KRENGINE_VBO_2D_SQUARE_ATTRIBS, false, KRVBOData::CONSTANT
|
KRENGINE_VBO_DATA_2D_SQUARE_VERTICES.init(this, &KRENGINE_VBO_2D_SQUARE_VERTICES, nullptr, KRENGINE_VBO_2D_SQUARE_ATTRIBS, false, KRVBOData::CONSTANT
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, "Square Mesh [built-in]"
|
, "Square Mesh [built-in]"
|
||||||
#endif
|
#endif
|
||||||
@@ -310,22 +311,6 @@ void KRMeshManager::balanceVBOMemory(long &memoryRemaining, long &memoryRemainin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRMeshManager::bindVBO(VkCommandBuffer& commandBuffer, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, float lodCoverage
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, const char* debug_label
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// TODO - Vulkan refactoring... This will leak.. Update all call sites to own their own KRVBOData and then remove this function
|
|
||||||
KRVBOData *vbo_data = new KRVBOData(this, data, index_data, vertex_attrib_flags, static_vbo, KRVBOData::IMMEDIATE
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, debug_label
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
vbo_data->load(commandBuffer);
|
|
||||||
bindVBO(commandBuffer, vbo_data, lodCoverage);
|
|
||||||
}
|
|
||||||
|
|
||||||
long KRMeshManager::getMemUsed()
|
long KRMeshManager::getMemUsed()
|
||||||
{
|
{
|
||||||
return m_vboMemUsed;
|
return m_vboMemUsed;
|
||||||
@@ -340,7 +325,7 @@ long KRMeshManager::getMemActive()
|
|||||||
return mem_active;
|
return mem_active;
|
||||||
}
|
}
|
||||||
|
|
||||||
KRDataBlock &KRMeshManager::getVolumetricLightingVertexes()
|
void KRMeshManager::initVolumetricLightingVertexes()
|
||||||
{
|
{
|
||||||
if(m_volumetricLightingVertexData.getSize() == 0) {
|
if(m_volumetricLightingVertexData.getSize() == 0) {
|
||||||
m_volumetricLightingVertexData.expand(sizeof(VolumetricLightingVertexData) * KRENGINE_MAX_VOLUMETRIC_PLANES * 6);
|
m_volumetricLightingVertexData.expand(sizeof(VolumetricLightingVertexData) * KRENGINE_MAX_VOLUMETRIC_PLANES * 6);
|
||||||
@@ -379,12 +364,18 @@ KRDataBlock &KRMeshManager::getVolumetricLightingVertexes()
|
|||||||
iVertex++;
|
iVertex++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KRENGINE_VBO_DATA_VOLUMETRIC_LIGHTING.init(this, &m_volumetricLightingVertexData, nullptr, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX), false, KRVBOData::CONSTANT
|
||||||
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
|
, "Volumetric Lighting Planes [built-in]"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
m_volumetricLightingVertexData.unlock();
|
m_volumetricLightingVertexData.unlock();
|
||||||
}
|
}
|
||||||
return m_volumetricLightingVertexData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KRDataBlock &KRMeshManager::getRandomParticles()
|
void KRMeshManager::initRandomParticles()
|
||||||
{
|
{
|
||||||
if(m_randomParticleVertexData.getSize() == 0) {
|
if(m_randomParticleVertexData.getSize() == 0) {
|
||||||
m_randomParticleVertexData.expand(sizeof(RandomParticleVertexData) * KRENGINE_MAX_RANDOM_PARTICLES * 3);
|
m_randomParticleVertexData.expand(sizeof(RandomParticleVertexData) * KRENGINE_MAX_RANDOM_PARTICLES * 3);
|
||||||
@@ -419,9 +410,15 @@ KRDataBlock &KRMeshManager::getRandomParticles()
|
|||||||
vertex_data[iVertex].uva.y = -inscribed_circle_radius + equilateral_triangle_height;
|
vertex_data[iVertex].uva.y = -inscribed_circle_radius + equilateral_triangle_height;
|
||||||
iVertex++;
|
iVertex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KRENGINE_VBO_DATA_RANDOM_PARTICLES.init(this, &m_randomParticleVertexData, nullptr, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA), false, KRVBOData::CONSTANT
|
||||||
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
|
, "Random Particles [built-in]"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
m_randomParticleVertexData.unlock();
|
m_randomParticleVertexData.unlock();
|
||||||
}
|
}
|
||||||
return m_randomParticleVertexData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long KRMeshManager::getMemoryTransferedThisFrame()
|
long KRMeshManager::getMemoryTransferedThisFrame()
|
||||||
@@ -471,7 +468,7 @@ KRMeshManager::KRVBOData::KRVBOData()
|
|||||||
memset(m_allocations, 0, sizeof(AllocationInfo) * KRENGINE_MAX_GPU_COUNT);
|
memset(m_allocations, 0, sizeof(AllocationInfo) * KRENGINE_MAX_GPU_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
KRMeshManager::KRVBOData::KRVBOData(KRMeshManager *manager, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
KRMeshManager::KRVBOData::KRVBOData(KRMeshManager *manager, KRDataBlock *data, KRDataBlock *index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, const char* debug_label
|
, const char* debug_label
|
||||||
#endif
|
#endif
|
||||||
@@ -488,7 +485,7 @@ KRMeshManager::KRVBOData::KRVBOData(KRMeshManager *manager, KRDataBlock &data, K
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRMeshManager::KRVBOData::init(KRMeshManager *manager, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
void KRMeshManager::KRVBOData::init(KRMeshManager *manager, KRDataBlock *data, KRDataBlock *index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, const char* debug_label
|
, const char* debug_label
|
||||||
#endif
|
#endif
|
||||||
@@ -500,8 +497,8 @@ void KRMeshManager::KRVBOData::init(KRMeshManager *manager, KRDataBlock &data, K
|
|||||||
m_manager = manager;
|
m_manager = manager;
|
||||||
m_type = t;
|
m_type = t;
|
||||||
m_static_vbo = static_vbo;
|
m_static_vbo = static_vbo;
|
||||||
m_data = &data;
|
m_data = data;
|
||||||
m_index_data = &index_data;
|
m_index_data = index_data;
|
||||||
m_vertex_attrib_flags = vertex_attrib_flags;
|
m_vertex_attrib_flags = vertex_attrib_flags;
|
||||||
|
|
||||||
m_size = m_data->getSize();
|
m_size = m_data->getSize();
|
||||||
|
|||||||
@@ -81,12 +81,12 @@ public:
|
|||||||
} vbo_type;
|
} vbo_type;
|
||||||
|
|
||||||
KRVBOData();
|
KRVBOData();
|
||||||
KRVBOData(KRMeshManager *manager, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
KRVBOData(KRMeshManager *manager, KRDataBlock *data, KRDataBlock *index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, const char* debug_label
|
, const char* debug_label
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
void init(KRMeshManager *manager, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
void init(KRMeshManager *manager, KRDataBlock *data, KRDataBlock *index_data, int vertex_attrib_flags, bool static_vbo, vbo_type t
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
#if KRENGINE_DEBUG_GPU_LABELS
|
||||||
, const char* debug_label
|
, const char* debug_label
|
||||||
#endif
|
#endif
|
||||||
@@ -151,11 +151,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void bindVBO(VkCommandBuffer& commandBuffer, KRVBOData *vbo_data, float lodCoverage);
|
void bindVBO(VkCommandBuffer& commandBuffer, KRVBOData *vbo_data, float lodCoverage);
|
||||||
void bindVBO(VkCommandBuffer& commandBuffer, KRDataBlock &data, KRDataBlock &index_data, int vertex_attrib_flags, bool static_vbo, float lodCoverage
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, const char* debug_label
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
long getMemUsed();
|
long getMemUsed();
|
||||||
long getMemActive();
|
long getMemActive();
|
||||||
|
|
||||||
@@ -166,12 +161,7 @@ public:
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Vector3 vertex;
|
Vector3 vertex;
|
||||||
} VolumetricLightingVertexData;
|
} VolumetricLightingVertexData;
|
||||||
|
|
||||||
|
|
||||||
KRDataBlock &getRandomParticles();
|
|
||||||
KRDataBlock &getVolumetricLightingVertexes();
|
|
||||||
|
|
||||||
|
|
||||||
long getMemoryTransferedThisFrame();
|
long getMemoryTransferedThisFrame();
|
||||||
|
|
||||||
@@ -191,13 +181,16 @@ public:
|
|||||||
|
|
||||||
KRVBOData KRENGINE_VBO_DATA_3D_CUBE_VERTICES;
|
KRVBOData KRENGINE_VBO_DATA_3D_CUBE_VERTICES;
|
||||||
KRVBOData KRENGINE_VBO_DATA_2D_SQUARE_VERTICES;
|
KRVBOData KRENGINE_VBO_DATA_2D_SQUARE_VERTICES;
|
||||||
|
KRVBOData KRENGINE_VBO_DATA_RANDOM_PARTICLES;
|
||||||
|
KRVBOData KRENGINE_VBO_DATA_VOLUMETRIC_LIGHTING;
|
||||||
|
|
||||||
|
|
||||||
void doStreaming(long &memoryRemaining, long &memoryRemainingThisFrame);
|
void doStreaming(long &memoryRemaining, long &memoryRemainingThisFrame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KRDataBlock KRENGINE_VBO_3D_CUBE_VERTICES, KRENGINE_VBO_3D_CUBE_INDEXES;
|
KRDataBlock KRENGINE_VBO_3D_CUBE_VERTICES;
|
||||||
__int32_t KRENGINE_VBO_3D_CUBE_ATTRIBS;
|
__int32_t KRENGINE_VBO_3D_CUBE_ATTRIBS;
|
||||||
KRDataBlock KRENGINE_VBO_2D_SQUARE_VERTICES, KRENGINE_VBO_2D_SQUARE_INDEXES;
|
KRDataBlock KRENGINE_VBO_2D_SQUARE_VERTICES;
|
||||||
__int32_t KRENGINE_VBO_2D_SQUARE_ATTRIBS;
|
__int32_t KRENGINE_VBO_2D_SQUARE_ATTRIBS;
|
||||||
|
|
||||||
unordered_multimap<std::string, KRMesh *> m_models; // Multiple models with the same name/key may be inserted, representing multiple LOD levels of the model
|
unordered_multimap<std::string, KRMesh *> m_models; // Multiple models with the same name/key may be inserted, representing multiple LOD levels of the model
|
||||||
@@ -225,4 +218,7 @@ private:
|
|||||||
|
|
||||||
void primeVBO(KRVBOData *vbo_data);
|
void primeVBO(KRVBOData *vbo_data);
|
||||||
|
|
||||||
|
void initRandomParticles();
|
||||||
|
void initVolumetricLightingVertexes();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,13 +107,8 @@ void KRParticleSystemNewtonian::render(RenderInfo& ri) {
|
|||||||
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, 1.0f);
|
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, 1.0f);
|
||||||
pParticleShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, getModelMatrix(), &ri.point_lights, &ri.directional_lights, &ri.spot_lights, ri.renderPass);
|
pParticleShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, getModelMatrix(), &ri.point_lights, &ri.directional_lights, &ri.spot_lights, ri.renderPass);
|
||||||
|
|
||||||
KRDataBlock index_data;
|
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, &m_pContext->getMeshManager()->KRENGINE_VBO_DATA_RANDOM_PARTICLES, 1.0f);
|
||||||
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, m_pContext->getMeshManager()->getRandomParticles(), index_data, (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA), false, 1.0f
|
|
||||||
|
|
||||||
#if KRENGINE_DEBUG_GPU_LABELS
|
|
||||||
, "Newtonian Particles"
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
vkCmdDraw(ri.commandBuffer, particle_count * 3, 1, 0, 0);
|
vkCmdDraw(ri.commandBuffer, particle_count * 3, 1, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user