This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
/**
* The base shader class of {@link PrimarySpriteMesh}.
*/
class PrimaryBaseSamplerShader extends OccludableSamplerShader {
/**
* The depth shader class associated with this shader.
* @type {typeof DepthSamplerShader}
*/
static depthShaderClass = DepthSamplerShader;
/* -------------------------------------------- */
/**
* The depth shader associated with this shader.
* The depth shader is lazily constructed.
* @type {DepthSamplerShader}
*/
get depthShader() {
return this.#depthShader ??= this.#createDepthShader();
}
#depthShader;
/* -------------------------------------------- */
/**
* Create the depth shader and configure it.
* @returns {DepthSamplerShader}
*/
#createDepthShader() {
const depthShader = this.constructor.depthShaderClass.create();
this._configureDepthShader(depthShader);
return depthShader;
}
/* -------------------------------------------- */
/**
* One-time configuration that is called when the depth shader is created.
* @param {DepthSamplerShader} depthShader The depth shader
* @protected
*/
_configureDepthShader(depthShader) {}
}