Add M2 skeletal animation and fix terrain texture layers

- Implement GPU bone skinning for M2 doodads/creatures (gryphons, birds)
- Store bone hierarchy and animation keyframes per model
- Compute bone matrices per-instance with keyframe interpolation
- Upload bone weights/indices in vertex buffer, skinning in vertex shader
- Fix terrain texture rendering: restore sampler-to-unit uniform bindings
  removed during texture bind optimization (roads were invisible)
This commit is contained in:
Kelsi 2026-02-04 11:40:00 -08:00
parent 4bc5064515
commit 15fa055726
3 changed files with 197 additions and 20 deletions

View file

@ -301,6 +301,15 @@ void TerrainRenderer::render(const Camera& camera) {
// Use shader
shader->use();
// Bind sampler uniforms to texture units (constant, only needs to be set once per use)
shader->setUniform("uBaseTexture", 0);
shader->setUniform("uLayer1Texture", 1);
shader->setUniform("uLayer2Texture", 2);
shader->setUniform("uLayer3Texture", 3);
shader->setUniform("uLayer1Alpha", 4);
shader->setUniform("uLayer2Alpha", 5);
shader->setUniform("uLayer3Alpha", 6);
// Set view/projection matrices
glm::mat4 view = camera.getViewMatrix();
glm::mat4 projection = camera.getProjectionMatrix();