MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / load

Method load

demo/src/demos/ColorDepthDemo.js:46–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 }
45
46 load() {
47
48 const assets = this.assets;
49 const loadingManager = this.loadingManager;
50 const smaaImageLoader = new SMAAImageLoader(loadingManager);
51
52 const anisotropy = Math.min(this.composer.getRenderer()
53 .capabilities.getMaxAnisotropy(), 8);
54
55 return new Promise((resolve, reject) => {
56
57 if(assets.size === 0) {
58
59 loadingManager.onLoad = () => setTimeout(resolve, 250);
60 loadingManager.onProgress = ProgressManager.updateProgress;
61 loadingManager.onError = url => console.error(`Failed to load ${url}`);
62
63 Sponza.load(assets, loadingManager, anisotropy);
64
65 smaaImageLoader.load(([search, area]) => {
66
67 assets.set("smaa-search", search);
68 assets.set("smaa-area", area);
69
70 });
71
72 } else {
73
74 resolve();
75
76 }
77
78 });
79
80 }
81
82 /**
83 * Creates the scene.

Callers

nothing calls this directly

Calls 3

loadMethod · 0.95
getRendererMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected