* @private
()
| 523 | * @private |
| 524 | */ |
| 525 | setDefaultUniforms() { |
| 526 | for (const key in this.hooks.uniforms) { |
| 527 | const name = this._renderer.uniformNameFromHookKey(key); |
| 528 | const initializer = this.hooks.uniforms[key]; |
| 529 | let value; |
| 530 | if (initializer instanceof Function) { |
| 531 | value = initializer(); |
| 532 | } else { |
| 533 | value = initializer; |
| 534 | } |
| 535 | |
| 536 | if (value !== undefined && value !== null) { |
| 537 | this.setUniform(name, value); |
| 538 | } |
| 539 | } |
| 540 | for (const name in this.hooks.storageUniforms) { |
| 541 | const initializer = this.hooks.storageUniforms[name]; |
| 542 | const value = initializer instanceof Function ? initializer() : initializer; |
| 543 | if (value !== undefined && value !== null) { |
| 544 | this.setUniform(name, value); |
| 545 | } |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | /** |
| 550 | * Copies the shader from one drawing context to another. |
no test coverage detected