|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Maps a material handle to its resolved record. Owned by RenderContext so it is reachable from both the SDK binding (push) and the render collect path (read). More...
#include <MaterialStore.hpp>
Public Member Functions | |
| MaterialStore ()=default | |
| ~MaterialStore () | |
| MaterialStore (const MaterialStore &)=delete | |
| MaterialStore & | operator= (const MaterialStore &)=delete |
| void | setDevice (GfxDevice *device) |
| The render path uses this device to create/upload/delete per-material UBOs. | |
| void | setResourceManager (resource::ResourceManager *resources) |
| Resolves texture handles at bind time; without one, texture params bind nothing. | |
| void | forgetShader (resource::ShaderHandle shader) |
| void | setBuiltinDefaults (TextureHandle white, TextureHandle black, TextureHandle flatNormal, TextureHandle ripples) |
| The context's built-in fallbacks. | |
| TextureHandle | builtinDefault (MaterialDefaultTexture which) const |
| void | setBuiltinDefaultArrays (TextureHandle white, TextureHandle black, TextureHandle flatNormal) |
| The context's layers of white, black and a flat normal: what an unset textureArray param binds. | |
| TextureHandle | builtinDefault (const MaterialTextureSlot &slot) const |
| What an unset param of slot binds: its declared default, as layers for an array (ripples are white there). | |
| void | rememberSource (resource::ShaderHandle shader, std::string source, std::string features) |
| u32 | meshProgram (u32 materialId, resource::ResourceManager &resources, bool withNormals=false, bool skinned=false, bool envMapped=false, bool lightmapped=false, bool gbuffer=false, bool tangents=false, bool tipPass=false, bool opaque=false) const |
| void | setLightingDirect (bool on) |
| bool | lightingDirect () const |
| bool | programWritesGBuffer (u32 programId) const |
| bool | programWritesAlbedo (u32 programId) const |
| Of those, the ones that also write the surface's diffuse colour (location 2, fragAlbedo). | |
| void | markGBufferProgram (u32 programId, bool albedo) const |
| A program that is not a material's — the engine's own mesh shader — says it writes the record. | |
| const std::string & | shaderLabel (u32 materialId) const |
The name of the shader materialId draws with, or "default" for the path's own batch shader. | |
| float | vertexBounds (u32 materialId) const |
| bool | hasVertexHook (u32 materialId) const |
Whether materialId bends its vertices (so its shadow has to bend too). | |
| bool | hasUntrackedDepthHook (u32 materialId) const |
| bool | castsCutoutShadow (u32 materialId) const |
| u32 | shadowProgram (u32 materialId, resource::ResourceManager &resources, bool withNormals, bool skinned, bool tangents=false) const |
| u32 | prepassCoverageProgram (u32 materialId, resource::ResourceManager &resources, bool withNormals, bool skinned, bool tangents=false) const |
| u32 | particleProgram (u32 materialId, resource::ResourceManager &resources) const |
| void | registerLayout (resource::ShaderHandle shader, MaterialUniformLayout layout) |
| u64 | revisionOf (u32 materialId) const |
What materialId is, as a number that changes whenever it does: its state, a param, a texture, its shader's layout. | |
| u64 | revision () const |
| Changes whenever any material does (revisionOf), or one is added or removed. | |
| void | define (u32 materialId, const MaterialRecord &record) |
| void | setUniform (u32 materialId, const std::string &name, const f32 *values, u32 arity) |
| void | setTexture (u32 materialId, const std::string &name, resource::TextureHandle texture) |
| void | undefine (u32 materialId) |
| const MaterialRecord * | find (u32 materialId) const |
The record for materialId, or nullptr if the handle is 0 / unregistered. | |
| bool | usesSceneColor (u32 materialId) const |
| void | setSceneColor (TextureHandle texture) |
| bool | usesScreenColor (u32 materialId) const |
| void | setScreenColor (TextureHandle texture) |
| resource::ShaderHandle | shaderOf (u32 materialId) const |
| bool | usesSceneDepth (u32 materialId) const |
| bool | needsScenePicture (u32 materialId) const |
| void | setSceneDepth (TextureHandle texture) |
| The copy of the opaque scene's distances the frame took, or invalid when it took none. Bound to a material's u_sceneDepthMap unit. | |
| bool | alphaIsCoverage (u32 materialId) const |
| bool | hasTipPass (u32 materialId) const |
| f32 | hairShadowDensity (u32 materialId) const |
The hair shadow density materialId holds (see ParsedShader::hairShadowParam), 0 when its shader has none or it is off. | |
| const MaterialUniformLayout * | layoutFor (resource::ShaderHandle shader) const |
| void | bindForDraw (u32 materialId, u32 samplerUnits=0xFFFFFFFFu) |
| bool | bindThrough (u32 materialId, resource::ShaderHandle shader, const std::vector< std::pair< std::string, glm::vec4 > > &overrides, u32 scratch) |
| Binds a material's values for a draw through another shader (a bake into a texture, a material drawn to a render target). | |
| void | setWorldUnitsPerMeter (f32 unitsPerMeter) |
| void | clear () |
| u32 | builtVariantCount () const |
| How many material program variants have been built. A prewarm counts what it caused by the difference, rather than by asking again. | |
Static Public Member Functions | |
| static void | seedSamplers (Shader &shader, const resource::ParsedShader &parsed) |
Point each of shader's texture params at its unit. | |
| static MaterialUniformLayout | layoutOf (const resource::ParsedShader &parsed) |
| static f32 | paramValue (const MaterialRecord &m, const MaterialUniformLayout &layout, i32 index) |
Maps a material handle to its resolved record. Owned by RenderContext so it is reachable from both the SDK binding (push) and the render collect path (read).
Definition at line 203 of file MaterialStore.hpp.
|
default |
Referenced by MaterialStore(), operator=(), and setResourceManager().
| esengine::MaterialStore::~MaterialStore | ( | ) |
Definition at line 23 of file MaterialStore.cpp.
References clear().
|
delete |
References MaterialStore().
|
inline |
Whether materialId's output alpha is coverage now: its shader names a coverage param and this material holds it above zero.
Definition at line 511 of file MaterialStore.hpp.
References esengine::MaterialUniformLayout::Named::coverage, find(), layoutFor(), esengine::MaterialUniformLayout::named, paramValue(), and esengine::MaterialRecord::shaderRef.
Referenced by castsCutoutShadow(), and esengine::DrawList::execute().
Uploads (when dirty) and binds the material's MaterialConstants UBO at binding 1. No-op for materials whose shader declares no params (uboBytes stays empty). Binds the material's block and its textures; a texture only where samplerUnits says the bound program reads its unit.
Definition at line 477 of file MaterialStore.cpp.
References builtinDefault(), esengine::resource::Handle< T >::id(), esengine::Invalid, esengine::MATERIAL_CONSTANTS_BINDING, esengine::GfxContent::retained(), esengine::MaterialRecord::shaderRef, esengine::MaterialRecord::textures, esengine::MaterialRecord::ubo, esengine::MaterialRecord::uboBytes, esengine::MaterialRecord::uboDirty, and esengine::Uniform.
Referenced by esengine::DrawList::execute().
| bool esengine::MaterialStore::bindThrough | ( | u32 | materialId, |
| resource::ShaderHandle | shader, | ||
| const std::vector< std::pair< std::string, glm::vec4 > > & | overrides, | ||
| u32 | scratch ) |
Binds a material's values for a draw through another shader (a bake into a texture, a material drawn to a render target).
Matched by NAME, so the two need not lay their params out alike: each param of shader takes the material's value of the param of the same name (else its own default), each texture the material's texture of the same name (else its default). overrides then replace vec4 params for this draw alone. The block goes into scratch buffer scratch, one per draw of a frame: on WebGPU a buffer rewritten between draws of one frame holds its last contents for all of them.
Definition at line 532 of file MaterialStore.cpp.
References esengine::MaterialParamSlot::arity, esengine::MaterialUniformLayout::blockSize, builtinDefault(), esengine::MaterialUniformLayout::find(), esengine::MaterialUniformLayout::findTexture(), esengine::resource::Handle< T >::id(), esengine::Invalid, esengine::MATERIAL_CONSTANTS_BINDING, esengine::MaterialParamSlot::offset, esengine::MaterialUniformLayout::params, esengine::MaterialRecord::shaderRef, esengine::MaterialRecord::textures, esengine::MaterialUniformLayout::textures, esengine::GfxContent::transient(), esengine::MaterialRecord::uboBytes, esengine::Uniform, and esengine::MaterialTextureSlot::unit.
|
inline |
What an unset param of slot binds: its declared default, as layers for an array (ripples are white there).
Definition at line 234 of file MaterialStore.hpp.
References esengine::Black, builtinDefault(), esengine::MaterialTextureSlot::defaultTexture, esengine::FlatNormal, and esengine::MaterialTextureSlot::layered.
| TextureHandle esengine::MaterialStore::builtinDefault | ( | MaterialDefaultTexture | which | ) | const |
The context's current fallback for a declared default(...). One authority, so the post-process pipeline's params fall back to the same textures.
Definition at line 586 of file MaterialStore.cpp.
References esengine::Black, esengine::FlatNormal, esengine::Ripples, and esengine::White.
Referenced by bindForDraw(), bindThrough(), and builtinDefault().
|
inline |
How many material program variants have been built. A prewarm counts what it caused by the difference, rather than by asking again.
Definition at line 656 of file MaterialStore.hpp.
|
inline |
Whether materialId's caster has to be cut out by its alpha: its alpha is coverage now and the coverage param is the one the depth shader reads.
Definition at line 327 of file MaterialStore.hpp.
References alphaIsCoverage(), esengine::MaterialUniformLayout::Named::coverageIsCutoff, find(), layoutFor(), esengine::MaterialUniformLayout::named, and esengine::MaterialRecord::shaderRef.
| void esengine::MaterialStore::clear | ( | ) |
Frees every per-material GPU UBO and clears all records/layouts. Call while the device is still valid (RenderContext::shutdown).
Definition at line 58 of file MaterialStore.cpp.
References esengine::Invalid.
Referenced by ~MaterialStore(), and setResourceManager().
|
inline |
Pushes a material's resolved render state. Preserves any already-packed constants (an edit such as setBlendMode re-pushes state without clobbering uniforms); a shader change invalidates the old constants since the layout differs.
Definition at line 383 of file MaterialStore.hpp.
References esengine::MaterialRecord::revision, esengine::MaterialRecord::shaderRef, esengine::MaterialRecord::textures, esengine::MaterialRecord::ubo, esengine::MaterialRecord::uboBytes, and esengine::MaterialRecord::uboDirty.
|
inline |
The record for materialId, or nullptr if the handle is 0 / unregistered.
Definition at line 446 of file MaterialStore.hpp.
Referenced by alphaIsCoverage(), castsCutoutShadow(), hairShadowDensity(), hasTipPass(), hasUntrackedDepthHook(), hasVertexHook(), meshProgram(), needsScenePicture(), prepassCoverageProgram(), revisionOf(), shaderLabel(), shaderOf(), shadowProgram(), usesSceneColor(), usesSceneDepth(), usesScreenColor(), and vertexBounds().
| void esengine::MaterialStore::forgetShader | ( | resource::ShaderHandle | shader | ) |
Definition at line 37 of file MaterialStore.cpp.
References esengine::resource::Handle< T >::id().
Referenced by setResourceManager().
The hair shadow density materialId holds (see ParsedShader::hairShadowParam), 0 when its shader has none or it is off.
Definition at line 528 of file MaterialStore.hpp.
References find(), esengine::MaterialUniformLayout::Named::hairShadow, layoutFor(), esengine::MaterialUniformLayout::named, paramValue(), and esengine::MaterialRecord::shaderRef.
|
inline |
Whether materialId draws a blended pass over its opaque one: its shader names a tip param and this material holds it above zero.
Definition at line 520 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialUniformLayout::named, paramValue(), esengine::MaterialRecord::shaderRef, and esengine::MaterialUniformLayout::Named::tip.
|
inline |
An arbitrary vertex hook can depend on time or GPU state. A declared depth input lets a light-space capture track its silhouette through the instance and material instead.
Definition at line 319 of file MaterialStore.hpp.
References find(), and layoutFor().
|
inline |
Whether materialId bends its vertices (so its shadow has to bend too).
Definition at line 311 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialRecord::shaderRef, and esengine::MaterialUniformLayout::vertexHook.
|
inline |
The registered #pragma-param layout for a shader program, or nullptr. The post-process pipeline reads it to pack pass params through the same reflected MaterialConstants block a material would use.
Definition at line 539 of file MaterialStore.hpp.
References esengine::resource::Handle< T >::id().
Referenced by alphaIsCoverage(), castsCutoutShadow(), hairShadowDensity(), hasTipPass(), hasUntrackedDepthHook(), hasVertexHook(), needsScenePicture(), shaderLabel(), usesSceneColor(), usesSceneDepth(), usesScreenColor(), and vertexBounds().
|
static |
The layout a parsed shader's #pragma param reflection describes: the std140 block for the scalar and vector params (declared order is offset order) and a sampler slot for each texture param, at the unit the parser gave it. Material shaders and the chain's own last pass read their parameters through the same one.
Definition at line 392 of file MaterialStore.cpp.
References esengine::MaterialParamSlot::arity, esengine::MaterialUniformLayout::blockSize, esengine::MaterialUniformLayout::coverageParam, esengine::resource::ParsedShader::coverageParam, esengine::MaterialParamSlot::defaults, esengine::resource::ParsedShader::depthInput, esengine::MaterialUniformLayout::depthInputUnit, esengine::MaterialUniformLayout::findTexture(), esengine::MaterialUniformLayout::hairShadowParam, esengine::resource::ParsedShader::hairShadowParam, esengine::MaterialUniformLayout::highPrecision, esengine::resource::ParsedShader::highPrecision, esengine::resource::ParsedShader::materialBlockSize, esengine::materialDefaultByName(), esengine::MaterialUniformLayout::name, esengine::resource::ParsedShader::name, esengine::MaterialUniformLayout::params, esengine::resource::ParsedShader::properties, esengine::resource::Texture, esengine::MaterialUniformLayout::textures, esengine::MaterialUniformLayout::tipParam, esengine::resource::ParsedShader::tipParam, esengine::MaterialUniformLayout::usesGBuffer, esengine::resource::ParsedShader::usesGBuffer, esengine::MaterialUniformLayout::usesLights, esengine::resource::ParsedShader::usesLights, esengine::MaterialUniformLayout::vertexBounds, esengine::resource::ParsedShader::vertexBounds, esengine::MaterialUniformLayout::vertexHook, esengine::resource::ParsedShader::vertexHook, and esengine::MaterialParamSlot::worldUnits.
Referenced by esengine::material_compileEsshader().
|
inline |
Definition at line 276 of file MaterialStore.hpp.
|
inline |
A program that is not a material's — the engine's own mesh shader — says it writes the record.
Definition at line 289 of file MaterialStore.hpp.
Referenced by meshProgram().
| u32 esengine::MaterialStore::meshProgram | ( | u32 | materialId, |
| resource::ResourceManager & | resources, | ||
| bool | withNormals = false, | ||
| bool | skinned = false, | ||
| bool | envMapped = false, | ||
| bool | lightmapped = false, | ||
| bool | gbuffer = false, | ||
| bool | tangents = false, | ||
| bool | tipPass = false, | ||
| bool | opaque = false ) const |
The program that draws materialId on resident geometry of this shape, compiled once and cached; 0 when the source was never kept or the variant fails, so the caller falls back rather than drawing it wrong.
Definition at line 104 of file MaterialStore.cpp.
References find(), esengine::Shader::getProgramId(), esengine::resource::ResourceManager::getShader(), esengine::resource::Handle< T >::id(), esengine::resource::Handle< T >::isValid(), markGBufferProgram(), and esengine::MaterialRecord::shaderRef.
|
inline |
Whether materialId is nothing without that copy: it fades into what is behind it, where water only falls back to a plainer look. Seeing one is why a frame with no chain of its own takes one.
Definition at line 501 of file MaterialStore.hpp.
References esengine::MaterialUniformLayout::Named::blendDistance, find(), layoutFor(), esengine::MaterialUniformLayout::named, and esengine::MaterialRecord::shaderRef.
Referenced by esengine::DrawList::anyNeedsScenePicture().
|
delete |
References MaterialStore().
|
inlinestatic |
A float param of m by its layout index, or 0 when there is none or it is not packed.
Definition at line 457 of file MaterialStore.hpp.
References esengine::MaterialParamSlot::offset, esengine::MaterialUniformLayout::params, and esengine::MaterialRecord::uboBytes.
Referenced by alphaIsCoverage(), hairShadowDensity(), hasTipPass(), and usesSceneColor().
| u32 esengine::MaterialStore::particleProgram | ( | u32 | materialId, |
| resource::ResourceManager & | resources ) const |
The program that draws materialId on PARTICLE geometry — the instanced quad an emitter streams. Same source, same author's fragment, a different engine vertex stage; 0 on the same terms as meshProgram.
Definition at line 284 of file MaterialStore.cpp.
| u32 esengine::MaterialStore::prepassCoverageProgram | ( | u32 | materialId, |
| resource::ResourceManager & | resources, | ||
| bool | withNormals, | ||
| bool | skinned, | ||
| bool | tangents = false ) const |
The program that draws materialId's depth for the scene's prepass when its alpha is coverage: the engine's depth shader writing the coverage the material's own fragment writes, so under alpha-to-coverage the two pass draw the same samples. Only for the engine's Model shader, whose coverage it reproduces; 0 for anything else, for a bent vertex, and when the variant fails — the draw then takes no part in a prepass.
Definition at line 231 of file MaterialStore.cpp.
References esengine::resource::ShaderParser::assembleStage(), esengine::resource::ParsedShader::coverageParam, esengine::resource::ResourceManager::createShaderWithBindings(), ES_LOG_WARN, find(), esengine::resource::Fragment, esengine::Shader::getProgramId(), esengine::resource::ResourceManager::getShader(), esengine::resource::Handle< T >::id(), esengine::resource::Handle< T >::isValid(), esengine::Shader::isValid(), esengine::resource::ParsedShader::materialBlockSize, esengine::ShaderEmbeds::MESH, esengine::resource::ParsedShader::name, esengine::resource::ShaderParser::parse(), esengine::resource::ResourceManager::preferredShaderLanguage(), esengine::resource::ResourceManager::preferredShaderTarget(), esengine::resource::ParsedShader::properties, esengine::resource::ResourceManager::releaseShader(), esengine::MaterialRecord::shaderRef, esengine::resource::ParsedShader::valid, esengine::resource::Vertex, and esengine::resource::ParsedShader::vertexHook.
|
inline |
Of those, the ones that also write the surface's diffuse colour (location 2, fragAlbedo).
Definition at line 285 of file MaterialStore.hpp.
Referenced by esengine::DrawList::execute().
|
inline |
Whether programId is a variant that writes the surface record's second output — set when it was compiled for a pass that has one AND the material's shader has something to write (it mentions ES_GBUFFER). The draw list asks per command, so a pipeline says what its shader does.
Definition at line 281 of file MaterialStore.hpp.
Referenced by esengine::DrawList::execute().
|
inline |
Registers (or replaces) a shader's MaterialConstants layout — called when a shader authored with #pragma param is compiled, so materials on it can pack their uniforms. Filed under the HANDLE, not the program id: rebuilding the program (a device loss, a shader reload) changes the id, and a layout filed under the old one would be unreachable from the material that still names it.
Definition at line 356 of file MaterialStore.hpp.
References esengine::resource::Handle< T >::id(), esengine::resource::Handle< T >::isValid(), and esengine::MaterialUniformLayout::resolveNamed().
|
inline |
Keeps a material shader's SOURCE beside its handle, so the same material can be compiled for another vertex source later. Without it the store holds only the assembled program and a variant would need the author's file again.
Definition at line 257 of file MaterialStore.hpp.
References esengine::resource::Handle< T >::id(), and esengine::resource::Handle< T >::isValid().
|
inline |
Changes whenever any material does (revisionOf), or one is added or removed.
A reader that kept what it derived from many materials, or a pointer to a record, asks this once rather than revisionOf each: while it holds, every record kept is the one it was.
Definition at line 378 of file MaterialStore.hpp.
What materialId is, as a number that changes whenever it does: its state, a param, a texture, its shader's layout.
Definition at line 368 of file MaterialStore.hpp.
References find(), and esengine::MaterialRecord::revision.
|
static |
Point each of shader's texture params at its unit.
GLSL ES 300 has no layout(binding=), so a program carries this as uniform state.
Definition at line 435 of file MaterialStore.cpp.
References esengine::Shader::bind(), esengine::GLSL_ES300, esengine::Shader::hasUniform(), esengine::Shader::language(), esengine::resource::ParsedShader::properties, esengine::Shader::setUniform(), esengine::resource::Texture, esengine::Shader::unbind(), and esengine::Shader::whenLinked().
Referenced by esengine::material_compileEsshader(), and shadowProgram().
|
inline |
The context's layers of white, black and a flat normal: what an unset textureArray param binds.
Definition at line 228 of file MaterialStore.hpp.
|
inline |
The context's built-in fallbacks.
Definition at line 217 of file MaterialStore.hpp.
|
inline |
The render path uses this device to create/upload/delete per-material UBOs.
Definition at line 210 of file MaterialStore.hpp.
|
inline |
Definition at line 275 of file MaterialStore.hpp.
| void esengine::MaterialStore::setResourceManager | ( | resource::ResourceManager * | resources | ) |
Resolves texture handles at bind time; without one, texture params bind nothing.
Definition at line 28 of file MaterialStore.cpp.
References MaterialStore(), clear(), forgetShader(), and esengine::resource::ResourceManager::setShaderRetiredCallback().
|
inline |
The copy of the opaque scene the frame took for the draws above, or invalid when it took none. Bound to a material's u_sceneColor unit unless the material was given a texture of its own there.
Definition at line 479 of file MaterialStore.hpp.
|
inline |
The copy of the opaque scene's distances the frame took, or invalid when it took none. Bound to a material's u_sceneDepthMap unit.
Definition at line 507 of file MaterialStore.hpp.
|
inline |
Definition at line 486 of file MaterialStore.hpp.
|
inline |
Binds a texture to a named texture param's sampler unit. No-op if the material, its layout, or the texture param is unknown. Render path resolves it in bindForDraw.
Definition at line 429 of file MaterialStore.hpp.
References esengine::MaterialTextureSlot::unit.
|
inline |
Writes a named param's float components into the material's std140 buffer at the offset its shader's layout reflects. No-op if the material/layout/param is unknown.
Definition at line 412 of file MaterialStore.hpp.
References esengine::MaterialParamSlot::arity, esengine::resource::Handle< T >::id(), esengine::MaterialParamSlot::offset, esengine::MaterialRecord::revision, esengine::MaterialRecord::shaderRef, esengine::MaterialRecord::uboBytes, and esengine::MaterialRecord::uboDirty.
| void esengine::MaterialStore::setWorldUnitsPerMeter | ( | f32 | unitsPerMeter | ) |
Says what a world unit is (the project's units per metre). A param a material left at its default follows the change; one it set, to anything else, is the material's and stays.
Definition at line 454 of file MaterialStore.cpp.
References esengine::resource::Handle< T >::id(), esengine::MaterialRecord::revision, esengine::MaterialRecord::shaderRef, esengine::MaterialRecord::uboBytes, and esengine::MaterialRecord::uboDirty.
|
inline |
The name of the shader materialId draws with, or "default" for the path's own batch shader.
Definition at line 295 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialUniformLayout::name, and esengine::MaterialRecord::shaderRef.
Referenced by esengine::DrawList::execute().
|
inline |
Definition at line 487 of file MaterialStore.hpp.
References find(), and esengine::MaterialRecord::shaderRef.
| u32 esengine::MaterialStore::shadowProgram | ( | u32 | materialId, |
| resource::ResourceManager & | resources, | ||
| bool | withNormals, | ||
| bool | skinned, | ||
| bool | tangents = false ) const |
The program that draws materialId's CASTER into a shadow map: the engine's depth shader for resident meshes with the material's vertex hook and params grafted on, so a bent mesh casts the shadow of the bent shape. 0 when the source was never kept or the variant fails — the caller then casts the unbent shape, which is the old behaviour.
Definition at line 166 of file MaterialStore.cpp.
References esengine::resource::ShaderParser::assembleStage(), esengine::resource::ParsedShader::coverageParam, esengine::resource::ResourceManager::createShaderWithBindings(), ES_LOG_WARN, find(), esengine::resource::Fragment, esengine::Shader::getProgramId(), esengine::resource::ResourceManager::getShader(), esengine::resource::Handle< T >::id(), esengine::resource::Handle< T >::isValid(), esengine::Shader::isValid(), esengine::resource::ParsedShader::materialBlockSize, esengine::ShaderEmbeds::MESH, esengine::resource::ShaderParser::parse(), esengine::resource::ResourceManager::preferredShaderLanguage(), esengine::resource::ResourceManager::preferredShaderTarget(), esengine::resource::ParsedShader::properties, esengine::resource::ResourceManager::releaseShader(), seedSamplers(), esengine::MaterialRecord::shaderRef, esengine::resource::ParsedShader::valid, esengine::resource::Vertex, esengine::resource::ParsedShader::vertexHook, and esengine::resource::ParsedShader::wgslVertexHook.
| void esengine::MaterialStore::undefine | ( | u32 | materialId | ) |
Definition at line 50 of file MaterialStore.cpp.
References esengine::Invalid.
|
inline |
Whether materialId's shader reads the picture of what is behind it (declares u_sceneColor): refraction, a lens, anything that has to see the opaque scene as it stood before this draw. Such a draw is made after a copy of that picture is taken.
Definition at line 468 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialUniformLayout::named, paramValue(), esengine::MaterialUniformLayout::Named::sceneColor, esengine::MaterialRecord::shaderRef, and esengine::MaterialUniformLayout::Named::transmission.
Referenced by esengine::DrawList::anyBlendedWithoutSceneColor(), esengine::DrawList::anyUsesSceneColor(), and esengine::DrawList::execute().
|
inline |
Whether materialId's shader reads how far the opaque scene behind it is (declares u_sceneDepthMap): water measuring its own depth, a fade where a surface meets what it lies on. Such a draw is also made after the scene's copy.
Definition at line 494 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialUniformLayout::named, esengine::MaterialUniformLayout::Named::sceneDepth, and esengine::MaterialRecord::shaderRef.
Referenced by esengine::DrawList::anyUsesSceneDepth().
|
inline |
Definition at line 481 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialUniformLayout::named, esengine::MaterialUniformLayout::Named::screenColor, and esengine::MaterialRecord::shaderRef.
Referenced by esengine::DrawList::anyUsesScreenColor(), and esengine::DrawList::execute().
|
inline |
How far materialId's vertex hook can move a vertex from the mesh's own bounds, in the mesh's local units; 0 for a material without one.
Definition at line 304 of file MaterialStore.hpp.
References find(), layoutFor(), esengine::MaterialRecord::shaderRef, and esengine::MaterialUniformLayout::vertexBounds.