Skip to content

Commit 018ff41

Browse files
authored
Change gamma attribute to take linear instead of none (#117)
1 parent 87618f6 commit 018ff41

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/annotations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<!-- Camera (with XR support) -->
3535
<pc-entity name="camera root">
3636
<pc-entity name="camera" position="0 1.75 8">
37-
<pc-camera></pc-camera>
37+
<pc-camera tonemap="aces2"></pc-camera>
3838
<pc-scripts>
3939
<pc-script name="cameraControls" attributes='{
4040
"focusPoint": "vec3:0,1.75,0",

src/components/camera-component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CameraComponentElement extends ComponentElement {
4040

4141
private _frustumCulling = true;
4242

43-
private _gamma: 'none' | 'srgb' = 'srgb';
43+
private _gamma: 'linear' | 'srgb' = 'srgb';
4444

4545
private _horizontalFov = false;
4646

@@ -298,7 +298,7 @@ class CameraComponentElement extends ComponentElement {
298298
* Sets the gamma correction of the camera.
299299
* @param value - The gamma correction.
300300
*/
301-
set gamma(value: 'none' | 'srgb') {
301+
set gamma(value: 'linear' | 'srgb') {
302302
this._gamma = value;
303303
if (this.component) {
304304
this.component.gammaCorrection = value === 'srgb' ? GAMMA_SRGB : GAMMA_NONE;
@@ -309,7 +309,7 @@ class CameraComponentElement extends ComponentElement {
309309
* Gets the gamma correction of the camera.
310310
* @returns The gamma correction.
311311
*/
312-
get gamma(): 'none' | 'srgb' {
312+
get gamma(): 'linear' | 'srgb' {
313313
return this._gamma;
314314
}
315315

@@ -522,7 +522,7 @@ class CameraComponentElement extends ComponentElement {
522522
this.frustumCulling = newValue !== 'false';
523523
break;
524524
case 'gamma':
525-
this.gamma = newValue as 'none' | 'srgb';
525+
this.gamma = newValue as 'linear' | 'srgb';
526526
break;
527527
case 'horizontal-fov':
528528
this.horizontalFov = this.hasAttribute('horizontal-fov');

0 commit comments

Comments
 (0)