Skip to content

Commit

Permalink
Fix get null of dirtTexture (#2235)
Browse files Browse the repository at this point in the history
* fix: get null of dirtTexture
  • Loading branch information
zhuxudong authored Jul 17, 2024
1 parent 2f65efe commit 921d3bc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/loader/src/SceneLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ class SceneLoader extends Loader<Scene> {
bloomEffect.dirtIntensity = postProcessData.bloom.dirtIntensity;
tonemappingEffect.enabled = postProcessData.tonemapping.enabled;
tonemappingEffect.mode = postProcessData.tonemapping.mode;
// @ts-ignore
// prettier-ignore
const dirtTexturePromise = resourceManager.getResourceByRef<any>( postProcessData.bloom.dirtTexture).then((texture) => {
bloomEffect.dirtTexture = texture;
});
promises.push(dirtTexturePromise);
if (postProcessData.bloom.dirtTexture) {
// @ts-ignore
// prettier-ignore
const dirtTexturePromise = resourceManager.getResourceByRef<any>(postProcessData.bloom.dirtTexture).then((texture) => {
bloomEffect.dirtTexture = texture;
});
promises.push(dirtTexturePromise);
}
}

return Promise.all(promises).then(() => {
Expand Down

0 comments on commit 921d3bc

Please sign in to comment.