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

Method load

demo/src/demos/TextureDemo.js:53–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51 }
52
53 load() {
54
55 const assets = this.assets;
56 const loadingManager = this.loadingManager;
57 const textureLoader = new TextureLoader(loadingManager);
58 const smaaImageLoader = new SMAAImageLoader(loadingManager);
59
60 const anisotropy = Math.min(this.composer.getRenderer()
61 .capabilities.getMaxAnisotropy(), 8);
62
63 return new Promise((resolve, reject) => {
64
65 if(assets.size === 0) {
66
67 loadingManager.onLoad = () => setTimeout(resolve, 250);
68 loadingManager.onProgress = ProgressManager.updateProgress;
69 loadingManager.onError = url => console.error(`Failed to load ${url}`);
70
71 Sponza.load(assets, loadingManager, anisotropy);
72
73 textureLoader.load("textures/scratches.jpg", (t) => {
74
75 t.colorSpace = SRGBColorSpace;
76 t.wrapS = t.wrapT = RepeatWrapping;
77 assets.set("scratches-color", t);
78
79 });
80
81 smaaImageLoader.load(([search, area]) => {
82
83 assets.set("smaa-search", search);
84 assets.set("smaa-area", area);
85
86 });
87
88 } else {
89
90 resolve();
91
92 }
93
94 });
95
96 }
97
98 initialize() {
99

Callers

nothing calls this directly

Calls 3

loadMethod · 0.95
getRendererMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected