|
@@ -233,6 +233,7 @@ export class BaseTexture implements IAnimatable {
|
|
this._texture.is2DArray = value;
|
|
this._texture.is2DArray = value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private _gammaSpace = true;
|
|
/**
|
|
/**
|
|
* Define if the texture contains data in gamma space (most of the png/jpg aside bump).
|
|
* Define if the texture contains data in gamma space (most of the png/jpg aside bump).
|
|
* HDR texture are usually stored in linear space.
|
|
* HDR texture are usually stored in linear space.
|
|
@@ -240,18 +241,32 @@ export class BaseTexture implements IAnimatable {
|
|
*/
|
|
*/
|
|
@serialize()
|
|
@serialize()
|
|
public get gammaSpace(): boolean {
|
|
public get gammaSpace(): boolean {
|
|
- return this._texture?._gammaSpace ?? true;
|
|
|
|
|
|
+ if (!this._texture) {
|
|
|
|
+ return this._gammaSpace;
|
|
|
|
+ } else {
|
|
|
|
+ if (this._texture._gammaSpace === null) {
|
|
|
|
+ this._texture._gammaSpace = this._gammaSpace;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this._texture._gammaSpace;
|
|
}
|
|
}
|
|
|
|
|
|
public set gammaSpace(gamma: boolean) {
|
|
public set gammaSpace(gamma: boolean) {
|
|
- if ((this._texture?._gammaSpace ?? gamma) === gamma) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!this._texture) {
|
|
|
|
+ if (this._gammaSpace === gamma) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- if (this._texture) {
|
|
|
|
|
|
+ this._gammaSpace = gamma;
|
|
|
|
+ } else {
|
|
|
|
+ if (this._texture._gammaSpace === gamma) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this._texture._gammaSpace = gamma;
|
|
this._texture._gammaSpace = gamma;
|
|
- this._markAllSubMeshesAsTexturesDirty();
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this._markAllSubMeshesAsTexturesDirty();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|