or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
2d Transforms & Sorting
The purpose of this working group is to improve Bevy's 2D support by adding a specialized 2D transform.
There's an abnormally large number of closely linked PRs in development that touch this topic: A 2d transform PR, a UI transform PR, a y-sorting PR, as well as the new tilemap renderer. So part of the purpose of this document is cross-initiative coordination.
Proposal
ZIndex
andGlobalZIndex
with a field onUiTransform
.ZIndex
andYSort
are fields ofTransform2d
(leave outSortBias
for now) andZIndex
actually effects theGlobalTransform
.Demonstration
Here's an overview of what this would look like. (WIP)
GlobalTransform
given the parent'sGlobalTransform
(if it exists).depth
are incorperated into transform prop.depth
is effectivly the same as thez
position component onTransform3d
, but with the option to specify it in absolute terms.Camera
will no longer requireTransform
. InsteadCamera3d
will requireTransform3d
andCamera2d
will requireTransform2d
.Detailed Analysis of Related PRs
PR #19389: 2D Transforms - Core Assessment
What It Actually Does
Transform
→Transform3d
(with backward-compatible alias)Transform2d
with 2D-native fields (Vec2, Rot2, f32 scale)Critical Issues Identified from Review
The "Unpleasant" Layering Problem
Incomplete Solution Without Sorting
Performance Implications
Positive:
Concerns:
PR #19463: Sorting Components - Integration Analysis
The Sorting Stack
Key Reviewer Concerns
Naming Conflict with UI ZIndex
ZIndex
component with different semanticsPer-Entity vs Per-Layer Y-Sorting
YSort
markerMissing Hierarchy Propagation
Critical Edge Cases
YSort
, others don'tSynergy Analysis: Why Both PRs Work Better Together
The Perfect Marriage
PR #19463 directly solves PR #19389's biggest problem:
Before (PR #19389 alone):
After (Both PRs):
Integration Recommendation: Unified Transform2d
The proposed
Transform2d
with integrated depth/sorting fields addresses all core issues:Benefits:
Migration Strategy & Risk Assessment
Phase 1: Foundation (Immediate)
Phase 2: Optimization (Follow up PRs)
Critical Success Factors
Must Resolve Before Merge
High-Risk Areas
Mitigation Strategies
Community Feedback Integration
Key Reviewer Positions
@rparrett: Strong opposition to 3D parent workaround
@ickshonpe: Concerned about UI ZIndex conflict
@hymm: Y-sorting should be per-layer, not per-entity
@NthTensor: Fold sorting into Transform2d
Consensus Points
Testing & Validation Requirements
Critical Test Scenarios
Sort Order Validation
Hierarchy Propagation
Performance Benchmarks
Acceptance Criteria
Conclusion & Next Steps
Recommendation: Proceed with Integrated Approach
The proposed unified
Transform2d
with integrated depth and sorting provides the best balance of:Immediate Actions Required
Long-term Vision
These changes establish foundation for advanced 2D features:
The initial complexity investment is justified by the significant improvement to Bevy's 2D development experience and the foundation it provides for future 2D enhancements.