Skip to content

Commit 41ca5f5

Browse files
committed
refactor(soba): adjust stats and vanilla exports with new renderer
1 parent d43bd2c commit 41ca5f5

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

libs/soba/stats/src/lib/stats.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ export class NgtsStats {
2626

2727
const document = inject(DOCUMENT);
2828
const store = injectStore();
29-
const gl = store.select('gl');
3029

3130
const stats = computed(() => {
32-
const _gl = gl();
33-
if (!_gl) return null;
31+
const gl = store.gl();
32+
if (!gl) return null;
3433

3534
const stats = new Stats({ ...untracked(statsOptions) });
36-
void stats.init(_gl);
35+
void stats.init(gl);
3736
return stats;
3837
});
3938

libs/soba/vanilla-exports/src/index.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Type } from '@angular/core';
12
import {
23
BlurPass,
34
CausticsMaterial,
@@ -18,15 +19,12 @@ import {
1819
SoftShadowMaterial,
1920
SpotLightMaterial,
2021
} from '@pmndrs/vanilla';
21-
import { NgtMaterial } from 'angular-three';
22+
import { NgtThreeElement } from 'angular-three';
2223

23-
export type NgtSpotLightMaterial = NgtMaterial<InstanceType<typeof SpotLightMaterial>, typeof SpotLightMaterial>;
24-
export type NgtSoftShadowMaterial = NgtMaterial<InstanceType<typeof SoftShadowMaterial>, typeof SoftShadowMaterial>;
25-
export type NgtCausticsProjectionMaterial = NgtMaterial<
26-
CausticsProjectionMaterialType,
27-
[CausticsProjectionMaterialType]
28-
>;
29-
export type NgtMeshPortalMaterial = NgtMaterial<InstanceType<typeof MeshPortalMaterial>, typeof MeshPortalMaterial>;
24+
export type NgtSpotLightMaterial = NgtThreeElement<typeof SpotLightMaterial>;
25+
export type NgtSoftShadowMaterial = NgtThreeElement<typeof SoftShadowMaterial>;
26+
export type NgtCausticsProjectionMaterial = NgtThreeElement<Type<CausticsProjectionMaterialType>>;
27+
export type NgtMeshPortalMaterial = NgtThreeElement<typeof MeshPortalMaterial>;
3028

3129
declare global {
3230
interface HTMLElementTagNameMap {

0 commit comments

Comments
 (0)