mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 14:38:08 +02:00
correct particle count for systems without textures
This commit is contained in:
parent
27c6190665
commit
2663e5a876
1 changed files with 9 additions and 7 deletions
|
@ -75,22 +75,24 @@ void RenderableParticleEffectEntityItem::updateQuads(RenderArgs* args, bool text
|
||||||
vertices.reserve(getLivingParticleCount() * VERTS_PER_PARTICLE);
|
vertices.reserve(getLivingParticleCount() * VERTS_PER_PARTICLE);
|
||||||
|
|
||||||
if (textured) {
|
if (textured) {
|
||||||
positions.reserve(getLivingParticleCount());
|
textureCoords.reserve(getLivingParticleCount() * VERTS_PER_PARTICLE);
|
||||||
textureCoords.reserve(getLivingParticleCount() * VERTS_PER_PARTICLE);
|
}
|
||||||
|
positions.reserve(getLivingParticleCount());
|
||||||
for (quint32 i = _particleHeadIndex; i != _particleTailIndex; i = (i + 1) % _maxParticles) {
|
|
||||||
positions.append(_particlePositions[i]);
|
|
||||||
|
for (quint32 i = _particleHeadIndex; i != _particleTailIndex; i = (i + 1) % _maxParticles) {
|
||||||
|
positions.append(_particlePositions[i]);
|
||||||
|
if (textured) {
|
||||||
textureCoords.append(glm::vec2(0, 1));
|
textureCoords.append(glm::vec2(0, 1));
|
||||||
textureCoords.append(glm::vec2(1, 1));
|
textureCoords.append(glm::vec2(1, 1));
|
||||||
textureCoords.append(glm::vec2(1, 0));
|
textureCoords.append(glm::vec2(1, 0));
|
||||||
textureCoords.append(glm::vec2(0, 0));
|
textureCoords.append(glm::vec2(0, 0));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// sort particles back to front
|
// sort particles back to front
|
||||||
::zSortAxis = args->_viewFrustum->getDirection();
|
::zSortAxis = args->_viewFrustum->getDirection();
|
||||||
qSort(positions.begin(), positions.end(), zSort);
|
qSort(positions.begin(), positions.end(), zSort);
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < positions.size(); i++) {
|
for (int i = 0; i < positions.size(); i++) {
|
||||||
glm::vec3 pos = (textured) ? positions[i] : _particlePositions[i];
|
glm::vec3 pos = (textured) ? positions[i] : _particlePositions[i];
|
||||||
|
|
Loading…
Reference in a new issue