Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
SkinConstants.hpp File Reference

The pose one skinned draw is deformed by: a bone matrix per joint. More...

Include dependency graph for SkinConstants.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esengine::SkinConstants
 std140 mirror of the block. One mat4 per joint, MESH_MAX_BONES of them. More...

Namespaces

namespace  esengine

Variables

constexpr u32 esengine::SKIN_CONSTANTS_BINDING = 5
 Indexed UBO binding point for the per-draw SkinConstants block.
constexpr const char * esengine::SKIN_CONSTANTS_BLOCK = "SkinConstants"
 GLSL block name; must match the shader's declaration + Shader::compile lookup.

Detailed Description

The pose one skinned draw is deformed by: a bone matrix per joint.

Per DRAW, unlike the frame's lights and the material's parameters, so it is uploaded and bound immediately before the draw that reads it — the same shape the engine's other blocks have, at the next binding point. A uniform block rather than a texture because a bind group's textures are visible to the fragment stage alone on WebGPU, while its buffers are already visible to both.

Each matrix is jointWorld * inverseBind: world space, because a skinned mesh's own transform is ignored (glTF requires it) — the joints are already placed, so the vertices they move are too.

Definition in file SkinConstants.hpp.