|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Skinned meshes posed once a frame by a compute shader, into vertices every pass then draws as they are. More...
#include "../../core/Types.hpp"#include "../../ecs/Entity.hpp"#include "../../math/Math.hpp"#include "../rhi/GfxEnums.hpp"#include <memory>#include <unordered_map>#include <vector>

Go to the source code of this file.
Classes | |
| struct | esengine::SkinCacheSettings |
| The project's skin cache settings. More... | |
| class | esengine::SkinCache |
Namespaces | |
| namespace | esengine |
Enumerations | |
| enum class | esengine::SkinCacheBehavior : u8 { esengine::Inclusive = 0 , esengine::Exclusive = 1 } |
| Which skinned meshes go through the cache when their own MeshSkin says Auto. More... | |
| enum class | esengine::SkinCacheUsage : u8 { esengine::Auto = 0 , esengine::Disabled = 1 , esengine::Enabled = 2 } |
| A mesh's own word on the cache (MeshSkin::skinCache). More... | |
Skinned meshes posed once a frame by a compute shader, into vertices every pass then draws as they are.
Without it a skinned mesh is posed in the vertex stage of every draw of it: each shadow cascade, the depth prepass, the colour pass. With it a compute shader poses the mesh once, before the frame's passes, into a copy of its own vertices in which the position, the normal and the tangent are rewritten in world space; every pass then draws that copy as unskinned geometry, so any program a static mesh has draws it, a material's included, and a skin of any number of bones is one draw. A device without compute (WebGL2) poses in the vertex stage as before.
The project decides which meshes go through it (SkinCacheSettings: on or off, every mesh unless it opts out or none unless it opts in) and how much memory it may hold; a mesh's own MeshSkin says Auto, Disabled or Enabled. Meshes enter first come, first served, and one that would take the cache past its budget is posed in the vertex stage. The motion pass still poses in the vertex stage: it needs last frame's pose beside this one.
Definition in file SkinCache.hpp.