Skip to content

Commit 430ffd7

Browse files
fix: use correct value for LinearSRGBColorSpace (#368)
1 parent bdfe295 commit 430ffd7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/math/Lut.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class Lut {
5757
const min = this.map[j][0]
5858
const max = this.map[j + 1][0]
5959

60-
minColor.setHex(this.map[j][1], 'linear-srgb')
61-
maxColor.setHex(this.map[j + 1][1], 'linear-srgb')
60+
minColor.setHex(this.map[j][1], 'srgb-linear')
61+
maxColor.setHex(this.map[j + 1][1], 'srgb-linear')
6262

6363
const color = new Color().lerpColors(minColor, maxColor, (alpha - min) / (max - min))
6464

@@ -131,8 +131,8 @@ class Lut {
131131
const min = this.map[j - 1][0]
132132
const max = this.map[j][0]
133133

134-
minColor.setHex(this.map[j - 1][1], 'linear-srgb')
135-
maxColor.setHex(this.map[j][1], 'linear-srgb')
134+
minColor.setHex(this.map[j - 1][1], 'srgb-linear')
135+
maxColor.setHex(this.map[j][1], 'srgb-linear')
136136

137137
finalColor.lerpColors(minColor, maxColor, (i - min) / (max - min))
138138

src/objects/Reflector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class Reflector extends Mesh {
213213

214214
renderer.xr.enabled = false // Avoid camera modification
215215
renderer.shadowMap.autoUpdate = false // Avoid re-computing shadows
216-
if ('outputColorSpace' in renderer) renderer.outputColorSpace = 'linear-srgb'
216+
if ('outputColorSpace' in renderer) renderer.outputColorSpace = 'srgb-linear'
217217
else renderer.outputEncoding = 3000 // LinearEncoding
218218
renderer.toneMapping = NoToneMapping
219219

src/objects/Refractor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class Refractor extends Mesh {
241241

242242
renderer.xr.enabled = false // avoid camera modification
243243
renderer.shadowMap.autoUpdate = false // avoid re-computing shadows
244-
if ('outputColorSpace' in renderer) renderer.outputColorSpace = 'linear-srgb'
244+
if ('outputColorSpace' in renderer) renderer.outputColorSpace = 'srgb-linear'
245245
else renderer.outputEncoding = 3000 // LinearEncoding
246246
renderer.toneMapping = NoToneMapping
247247

0 commit comments

Comments
 (0)