Graphics/ForwardRenderTechnique: Optimize sprite rendering

This commit is contained in:
Lynix
2018-06-06 21:38:40 +02:00
parent 056bd0efdd
commit e9f0bdeb25
2 changed files with 90 additions and 95 deletions

View File

@@ -83,9 +83,17 @@ namespace Nz
int textureOverlay;
};
struct SpriteBatch
{
std::size_t spriteCount;
const Material* material;
const Texture* overlayTexture;
Recti scissorRect;
};
mutable std::unordered_map<const Shader*, ShaderUniforms> m_shaderUniforms;
mutable std::vector<LightIndex> m_lights;
mutable std::vector<std::pair<const VertexStruct_XYZ_Color_UV*, std::size_t>> m_spriteChains;
mutable std::vector<SpriteBatch> m_spriteBatches;
Buffer m_vertexBuffer;
mutable BasicRenderQueue m_renderQueue;
TextureRef m_whiteCubemap;