You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change makes a few improvements to the serialized representation of
an `EffectAsset`:
- `LiteralExpr`, `ExprHandle`, and `Module` are now
`#[serde(transparent)]`, which makes them less verbose.
- `VectorValue` is serialized as its glam math type representation,
making it a lot more readable in text format (_e.g._ RON).
Before:
```
module: (
expressions: [
Literal((
value: Vector((
vector_type: (
elem_type: Float,
count: 3,
),
storage: (1067030938, 3227307213, 1118770935, 0),
)),
)),
Literal((
value: Vector((
vector_type: (
elem_type: Bool,
count: 2,
),
storage: (0, 4294967295, 0, 0),
)),
)),
Binary(
op: Add,
left: (
index: 2,
),
right: (
index: 1,
),
),
],
),
```
After:
```
module: [
Literal(Vector(Vec3((1.2, -3.45, 87.54485)))),
Literal(Vector(BVec2((false, true)))),
Binary(
op: Add,
left: 2,
right: 1,
),
]
```
Copy file name to clipboardexpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
26
- Merged the `InitModifier` and `UpdateModifier` traits into the `Modifier` subtrait; see other changelog entries for details. This helps manage modifiers in a unified way, and generally simplifies writing and maintain modifiers compatible with both the init and update contexts.
27
27
-`EffectAsset::init()` and `EffectAsset::update()` now take a `Modifier`-bound type, and validate its `ModifierContext` is compatible (and panics if not).
28
28
-`EffectAsset::render()` now panics if the modifier is not compatible with the `ModifierContext::Render`. Note that this indicates a malformed render modifier, because all objects implementing `RenderModifier` must include `ModifierContext::Render` in their `Modifier::context()`.
29
+
- Improved the serialization format to reduce verbosity, by making the following types `#[serde(transparent)]`: `ExprHandle`, `LiteralExpr`, `Module`.
0 commit comments