lxq100
March 18, 2026, 2:13am
1
PG:https://playground.babylonjs.com/#XH0PW9#5
The same PG and the same texture produce different results in different versions
We are currently using version 6.49.0, but the results are different when we switch to versions 7.54.2 and 8.55.3. We need to revert to version 6.49.0.
This PR from @kzhsw (thanks @kzhsw !) will fix one problem:
master ← kzhsw:patch-3
opened 07:27AM - 18 Mar 26 UTC
`serializeAsImageProcessingConfiguration` is a decorator factory — it returns a … decorator function. The call chain is:
1. `serializeAsImageProcessingConfiguration(sourceName?)` → returns `(target, propertyKey) => { ... }`
2. The `.call(this, this, "_imageProcessingConfiguration")` invokes the factory with `sourceName = this` (an object, not a string)
3. The returned decorator function is never invoked — it's just a discarded return value
The correct code should be:
```
serializeAsImageProcessingConfiguration()(this, "_imageProcessingConfiguration");
// ^^ call factory to get decorator, THEN invoke decorator
```
Or equivalently:
```
const decorator = serializeAsImageProcessingConfiguration();
decorator(this, "_imageProcessingConfiguration");
```
The result: _imageProcessingConfiguration is NOT registered in the DecoratorInitialStore. When `SerializationHelper.Parse()` processes a `.babylon` file, it doesn't find the property in the store, so the serialized image processing configuration (exposure, contrast, tone mapping, color curves, etc.) is silently ignored. The material falls back to the scene's default image processing configuration.
Before 8.29.0 (commit ca70334958), PBRBaseMaterial had:
```
@serializeAsImageProcessingConfiguration()
protected _imageProcessingConfiguration: ImageProcessingConfiguration;
```
This properly registered the property for serialization/deserialization.
This commit should fix the parse regression since release 8.28.2, and following forum bugs:
- <https://forum.babylonjs.com/t/pbr-imageprocessingconfiguration-parse-regression-after-8-28-2/62831>
- <https://forum.babylonjs.com/t/the-same-pg-and-the-same-texture-produce-different-results-in-different-versions/62829>
The other problem is that you now have to explicitely set the transparency mode to blend if you want blending for your material:
If you want to browse the PG with both fixes:
2 Likes