Skip to content

Commit bf543ca

Browse files
committed
feat(soba): misc
1 parent affed6c commit bf543ca

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

libs/soba/misc/src/lib/depth-buffer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ export function injectDepthBuffer(
2727
return { depthTexture };
2828
});
2929

30-
const depthFBO = injectFBO(() => ({
31-
width: w(),
32-
height: h(),
33-
settings: depthConfig(),
34-
}));
30+
const depthFBO = injectFBO(() => ({ width: w(), height: h(), settings: depthConfig() }));
3531

3632
let count = 0;
3733
injectBeforeRender(({ gl, scene, camera }) => {

libs/soba/misc/src/lib/fbo.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Injector,
66
TemplateRef,
77
ViewContainerRef,
8-
afterNextRender,
98
computed,
109
effect,
1110
inject,
@@ -127,7 +126,7 @@ export class NgtsFBO {
127126
return { width, height, settings };
128127
});
129128

130-
afterNextRender(() => {
129+
effect(() => {
131130
// TODO: double check if we need untracked
132131
untracked(() => {
133132
ref = this.viewContainerRef.createEmbeddedView(this.template, { $implicit: fboTarget });

libs/soba/misc/src/lib/preload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { afterNextRender, computed, Directive, ElementRef, model } from '@angular/core';
1+
import { computed, Directive, effect, ElementRef, model } from '@angular/core';
22
import { injectStore, resolveRef } from 'angular-three';
33
import { Camera, CubeCamera, Object3D, WebGLCubeRenderTarget } from 'three';
44

@@ -25,7 +25,7 @@ export class NgtsPreload {
2525
});
2626

2727
constructor() {
28-
afterNextRender(() => {
28+
effect(() => {
2929
const invisible: Object3D[] = [];
3030

3131
const [all, scene, camera, gl] = [this.all(), this.trueScene(), this.trueCamera(), this.gl()];

0 commit comments

Comments
 (0)