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

Method setShaderParts

src/materials/EffectMaterial.js:183–197  ·  view source on GitHub ↗

* Sets the shader parts. * * @deprecated Use setShaderData instead. * @param {Map } shaderParts - A collection of shader snippets. See EffectShaderSection. * @return {EffectMaterial} This material.

(shaderParts)

Source from the content-addressed store, hash-verified

181 */
182
183 setShaderParts(shaderParts) {
184
185 this.fragmentShader = fragmentTemplate
186 .replace(Section.FRAGMENT_HEAD, shaderParts.get(Section.FRAGMENT_HEAD) || "")
187 .replace(Section.FRAGMENT_MAIN_UV, shaderParts.get(Section.FRAGMENT_MAIN_UV) || "")
188 .replace(Section.FRAGMENT_MAIN_IMAGE, shaderParts.get(Section.FRAGMENT_MAIN_IMAGE) || "");
189
190 this.vertexShader = vertexTemplate
191 .replace(Section.VERTEX_HEAD, shaderParts.get(Section.VERTEX_HEAD) || "")
192 .replace(Section.VERTEX_MAIN_SUPPORT, shaderParts.get(Section.VERTEX_MAIN_SUPPORT) || "");
193
194 this.needsUpdate = true;
195 return this;
196
197 }
198
199 /**
200 * Sets the shader macros.

Callers 2

constructorMethod · 0.95
setShaderDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected