A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs(render): the batch vertex says what its z is for, now that the key differs
yhh667f610d811e
diff --git a/src/esengine/renderer/draw/BatchVertex.hpp b/src/esengine/renderer/draw/BatchVertex.hppindex aa37a87e4..516488073 100644--- a/src/esengine/renderer/draw/BatchVertex.hpp+++ b/src/esengine/renderer/draw/BatchVertex.hpp@@ -10,13 +10,10 @@ namespace esengine {/*** @brief One vertex of the shared batch stream.*- * @details `position.z` must be the same world z the draw reports as its sort depth- * (`BatchDrawKey::depth`). The two answer different questions — the key decides- * draw ORDER, the vertex feeds projection and the depth test — and a draw whose- * answers disagree is one the painter's order and the depth buffer would place- * differently. Under an orthographic camera with the depth test off (today's 2D- * default) that disagreement is invisible, which is exactly why it has to be an- * invariant rather than a habit.+ * @details `position.z` is world z: what the projection and the depth test consume.+ * `BatchDrawKey::depth` is that same point measured from the viewer instead —+ * one is geometry, the other decides draw ORDER. They must agree on which of+ * two draws is nearer, or painter's order and the depth buffer place them apart.*/struct BatchVertex {glm::vec3 position;