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

Method load

demo/src/demos/PixelationDemo.js:45–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

loadMethod · 0.95
getRendererMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected