Skip to content

Commit b36d3ab

Browse files
committed
fix: match with latest react three fiber on applyProps
1 parent 9cda97d commit b36d3ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libs/angular-three/src/lib/utils/apply-props.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord): NgtI
6868
else {
6969
currentInstance[key] = value;
7070
// auto-convert srgb textures
71-
if (!rootState?.linear && currentInstance[key] instanceof THREE.Texture) {
71+
if (
72+
!rootState?.linear &&
73+
currentInstance[key] instanceof THREE.Texture &&
74+
currentInstance[key].format === THREE.RGBAFormat &&
75+
currentInstance[key].type === THREE.UnsignedByteType
76+
) {
7277
currentInstance[key]['encoding'] = THREE.sRGBEncoding;
7378
}
7479
}

0 commit comments

Comments
 (0)