Bug Report - MeshComponent is clipped along its direction of travel when its transform is updated every frame
Bug Report - MeshComponent is clipped along its direction of travel when its transform is updated every frame
Summary
A MeshComponent whose world transform is rewritten with SetWorldTM() every tick is drawn, but then cut off at one end. The clip is one-dimensional and always perpendicular to the direction of motion. The mesh's extent across the direction of travel is never affected.
Static meshes in the same scene, built identically and sharing the same material, render perfectly and permanently. The single moving mesh is the only thing affected.
This is a behaviour-level report: I have measured it thoroughly from a project and cannot explain it from project code. Everything below is measurement, including the theories of mine that this falsified.
Environment
| Engine | 2605.0 release (engine.json version 2.6.0), unmodified source |
| Commit | n/a — the source tree I built from has no .git, so I cannot give a SHA |
| Build | profile config, Ninja Multi-Config, clang 22, ccache, Linux x86-64 |
| RHI | Vulkan (Atom using vulkan RHI), RADV |
| GPU / CPU | AMD Radeon Pro W7900 / Ryzen 9 7950X3D |
| Resolution / rate | 1920x1080, 10-20 fps |
Setup
Top-down orthographic driving game. Four meshes, all created at runtime and activated with GameEntityContextRequestBus::ActivateGameEntity, all using the same shared StandardPBR material with vertexColor.enable = true:
- three static meshes — a 3.2 km ground plane, a road network, ~79k building triangles
- one moving mesh — the player's car, 168 triangles, whose world transform is rewritten every tick from the vehicle's integrated position
The camera is a fixed top-down orthographic camera at a constant 21 m altitude. Its rotation is a constant and is never written; only its translation follows the car.
Observed
The car is not missing, and it is not randomly half-rasterised. It is drawn whole and then clipped at one end:
| frame | car-coloured pixels | on-screen bbox |
|---|---|---|
| A | 10,339 | 161 x 70 px (complete) |
| B | 3,242 | 69 x 70 px |
| C | 2,101 | 49 x 70 px |
| D | 0 | not drawn |
The height stays pinned at 70 px in every partially-drawn frame while the length collapses 161 → 69 → 49 → 0.
The asset is correct
Frame A is a complete, correctly-shaded car at 160 x 70 px, which is exactly its baked size (11.76 m x 6.38 m) at the 13.6 px/m I measured independently from 6.5 m residential road segments rendering at 89 px. So this is not a bad mesh, a wrong scale, a bad transform, or a flipped axis. Winding, normals, signed volume and vertex colours were all verified directly in the source asset.
The clip grows by about one frame of travel, then resets
At ~20 km/h and 10-14 fps, the car moves ~0.4-0.55 m (~6 px) per frame. Measured clip widths:
8, 17, 26, 35, 38, 39, 46, 48 ... 161 px
1, 2, 3, 4, 4.5, 5, 6, 6 ... 12 frame-stepsThat is a sawtooth: the clip accumulates roughly one frame of movement per frame, then resets. This is why a fully-visible frame does recur, but rarely.
What I ruled out
| Hypothesis | Test | Result |
|---|---|---|
| Asset / winding / scale / orientation | a complete 160x70 px frame was captured | ruled out — the asset renders correctly when unclipped |
| Material wrong or missing | MaterialComponent removed entirely |
ruled out — pixel-identical result, so not a shading issue |
| Model asset | car entity given a different, known-good model | ruled out — model identity is irrelevant to the clipping |
| Entity construction / parent / activation order | none, root, player; and the exact recipe of a probe mesh in the same scene that does render | ruled out |
Per-tick SetWorldTM is the cause |
hold the translation constant while still writing the transform every tick | ruled out — and the opposite: the write is necessary. With no movement there is no clip, and with the write disabled the mesh is never drawn at all |
| Stale cached bounds on a static-assumed mesh | MeshComponentConfig::m_isAlwaysDynamic = true (set before activation, in the config) |
ruled out — 25/30 frames visible, min 0, max 6295, identical clip signature |
| Throttling the transform update | PSK_CAR_HZ=20 (faster than the render rate) |
ruled out, and worse — floor 1 px vs 11. Updating faster than the render making it worse is the opposite of a simple staleness story |
| Screen-space / precision / screen edge | PSK_CAM_HALFWIDTH=400, car small and centred |
ruled out — still flickers 0% → 100% |
Summary of the controlled runs, all with the transform written every tick:
| condition | frames visible | car pixels min → max |
|---|---|---|
| normal (driving) | 31/40 | 11 → 10,739 |
| translation held constant | 30/30 | 1,851 → 11,058 |
| throttled to 20 Hz | 30/30 | 1 → 905 |
m_isAlwaysDynamic = true |
25/30 | 0 → 6,295 |
Expected
A moving mesh with a correct transform should render fully, every frame, with no clipping.
What I think this points at
Stated as a hypothesis, not a claim — I have not read the culling source.
Occlusion culling seems like the first place to look. A moving mesh judged occluded against Hi-Z data that has not caught up would produce a direction-dependent clip that recovers intermittently, and it would explain why the three static meshes — which never move, so their cullable bounds are never stale — are entirely unaffected. Frustum culling with a stale Cachable transform is the other candidate; the perpendicular-only nature of the clip argues for a single moving plane rather than a box, which is the main reason I lean towards the former.
The question I would most like answered
Is MeshComponentConfig::m_isAlwaysDynamic the intended flag for a mesh whose transform changes every frame, and is it meant to be set before activation? If there is an additional per-instance / Cachable / cullable setting required for such meshes, I would like to know what it is.
Reproduction
My reproduction is one environment variable plus about 30 seconds of framebuffer counting, and it is deterministic: drive the car in a fixed loop, then count car-coloured pixels per captured frame. The car-coloured pixel count is the whole signal — 10,739 is unclipped, 11 is almost fully clipped, 0 is not drawn.
If a minimal project would help, I can put one together — a single moving box under a fixed top-down orthographic camera is all that is needed to demonstrate it, and I can supply it on request.
Note for reproducers
The mesh is never drawn while it is stationary, and only its shadow appears. Frames captured while it is parked are byte-identical, which looks exactly like a stale capture and cost me a long time to rule out. Check that the mesh is actually moving before concluding anything from a static scene.
Source: o3de/o3de