Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::MaterialRecord Struct Reference

A material's resolved render state (P0) plus its packed std140 constants (P1). More...

#include <MaterialStore.hpp>

Public Attributes

resource::ShaderHandle shaderRef
u32 shader = 0
 Program id; 0 means "use the path's default batch shader".
BlendMode blend = BlendMode::Normal
bool depthTest = false
bool depthWrite = true
CullMode cull = CullMode::None
i16 depthBias = 0
std::vector< u8 > uboBytes
BufferHandle ubo = BufferHandle::Invalid
bool uboDirty = false
std::vector< MaterialTextureBinding > textures
 Texture params bound to sampler units, by handle (see MaterialTextureBinding).
u64 revision = 0
 Changes whenever anything above does, or its shader's layout: see core/Revision.hpp and MaterialStore::revisionOf.

Detailed Description

A material's resolved render state (P0) plus its packed std140 constants (P1).

Definition at line 172 of file MaterialStore.hpp.

Member Data Documentation

◆ blend

BlendMode esengine::MaterialRecord::blend = BlendMode::Normal

◆ cull

CullMode esengine::MaterialRecord::cull = CullMode::None

◆ depthBias

i16 esengine::MaterialRecord::depthBias = 0

Depth-buffer units toward the eye — what a surface laid ON another one says so it wins.

See also
PipelineDesc::depthBias.

Definition at line 184 of file MaterialStore.hpp.

Referenced by esengine::material_define().

◆ depthTest

bool esengine::MaterialRecord::depthTest = false

◆ depthWrite

bool esengine::MaterialRecord::depthWrite = true

◆ revision

u64 esengine::MaterialRecord::revision = 0

◆ shader

u32 esengine::MaterialRecord::shader = 0

Program id; 0 means "use the path's default batch shader".

Definition at line 177 of file MaterialStore.hpp.

Referenced by esengine::draw_meshWithMaterial(), esengine::material_define(), and esengine::RenderFrame::submitSkeletalBatch().

◆ shaderRef

◆ textures

std::vector<MaterialTextureBinding> esengine::MaterialRecord::textures

◆ ubo

BufferHandle esengine::MaterialRecord::ubo = BufferHandle::Invalid

◆ uboBytes

std::vector<u8> esengine::MaterialRecord::uboBytes

Packed std140 MaterialConstants payload (sized to the shader's blockSize), the GPU UBO it uploads to (lazy), and whether the bytes changed since the last upload.

Definition at line 188 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::bindForDraw(), esengine::MaterialStore::bindThrough(), esengine::MaterialStore::define(), esengine::MaterialStore::paramValue(), esengine::MaterialStore::setUniform(), and esengine::MaterialStore::setWorldUnitsPerMeter().

◆ uboDirty


The documentation for this struct was generated from the following file: