Skip to content

Commit 8947d3b

Browse files
committed
docs(soba): spotlight shadow story
1 parent 6869f22 commit 8947d3b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libs/soba/src/staging/spot-light.stories.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { NgtsOrbitControls } from 'angular-three-soba/controls';
66
import { injectTexture } from 'angular-three-soba/loaders';
77
import { injectDepthBuffer } from 'angular-three-soba/misc';
88
import { NgtsEnvironment, NgtsSpotLight, NgtsSpotLightOptions, NgtsSpotLightShadow } from 'angular-three-soba/staging';
9-
import { MathUtils, RepeatWrapping } from 'three';
9+
import { MathUtils, RepeatWrapping, SRGBColorSpace } from 'three';
1010
import { storyDecorators, storyObject } from '../setup-canvas';
1111

1212
@Component({
@@ -57,14 +57,19 @@ class SpotLightShadowStory {
5757
{
5858
onLoad: (textures) => {
5959
textures.forEach((texture) => {
60+
texture.colorSpace = SRGBColorSpace;
6061
texture.wrapS = texture.wrapT = RepeatWrapping;
6162
texture.repeat.set(2, 2);
6263
});
6364
},
6465
},
6566
);
6667

67-
leafTexture = injectTexture(() => './textures/other/leaves.jpg');
68+
leafTexture = injectTexture(() => './textures/other/leaves.jpg', {
69+
onLoad: (textures) => {
70+
textures[0].colorSpace = SRGBColorSpace;
71+
},
72+
});
6873
shader = computed(() => {
6974
if (!this.wind()) return undefined;
7075
return /* language=glsl glsl */ `

0 commit comments

Comments
 (0)