mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
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:
parent
4bc5064515
commit
15fa055726
3 changed files with 197 additions and 20 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue