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

A shader's layout: std140 block (scalar/vector params) + texture sampler slots. More...

#include <MaterialStore.hpp>

Classes

struct  Named

Public Member Functions

void resolveNamed ()
const MaterialParamSlot * find (const std::string &name) const
const MaterialTextureSlot * findTexture (const std::string &name) const

Public Attributes

u32 blockSize = 0
std::string coverageParam
std::string tipParam
 The float param that turns the shader's blended tip pass on (see ParsedShader::tipParam).
std::string hairShadowParam
 The float param that makes the shader's meshes hair for shadows (see ParsedShader::hairShadowParam).
bool usesGBuffer = false
 The shader reads the scene's surface record (ParsedShader::usesGBuffer).
bool usesLights = false
 The shader reads the frame's light block and shadow atlas (ParsedShader::usesLights).
bool highPrecision = false
 The shader writes a measurement and wants a float target (ParsedShader::highPrecision).
std::string name
 The shader's own name (#pragma shader "<name>"), for what a profiler calls a draw by.
float vertexBounds = 0.0f
bool vertexHook = false
i32 depthInputUnit = -1
 The tracked sampler of a deterministic vertex hook.
std::vector< MaterialParamSlot > params
std::vector< MaterialTextureSlot > textures
struct esengine::MaterialUniformLayout::Named named

Detailed Description

A shader's layout: std140 block (scalar/vector params) + texture sampler slots.

Definition at line 98 of file MaterialStore.hpp.

Member Function Documentation

◆ find()

const MaterialParamSlot * esengine::MaterialUniformLayout::find ( const std::string & name) const
inline

◆ findTexture()

const MaterialTextureSlot * esengine::MaterialUniformLayout::findTexture ( const std::string & name) const
inline

◆ resolveNamed()

void esengine::MaterialUniformLayout::resolveNamed ( )
inline

Resolves named from the names; called whenever params, textures or the special names change.

Definition at line 134 of file MaterialStore.hpp.

References coverageParam, hairShadowParam, name, named, params, textures, and tipParam.

Referenced by esengine::MaterialStore::registerLayout().

Member Data Documentation

◆ blockSize

u32 esengine::MaterialUniformLayout::blockSize = 0

◆ coverageParam

std::string esengine::MaterialUniformLayout::coverageParam

The param whose value above zero makes output alpha coverage (see ParsedShader::coverageParam); empty when the shader declares none.

Definition at line 102 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf(), and resolveNamed().

◆ depthInputUnit

i32 esengine::MaterialUniformLayout::depthInputUnit = -1

The tracked sampler of a deterministic vertex hook.

Definition at line 120 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf().

◆ hairShadowParam

std::string esengine::MaterialUniformLayout::hairShadowParam

The float param that makes the shader's meshes hair for shadows (see ParsedShader::hairShadowParam).

Definition at line 106 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf(), and resolveNamed().

◆ highPrecision

bool esengine::MaterialUniformLayout::highPrecision = false

The shader writes a measurement and wants a float target (ParsedShader::highPrecision).

Definition at line 112 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf().

◆ name

std::string esengine::MaterialUniformLayout::name

The shader's own name (#pragma shader "<name>"), for what a profiler calls a draw by.

Definition at line 114 of file MaterialStore.hpp.

Referenced by find(), findTexture(), esengine::MaterialStore::layoutOf(), resolveNamed(), and esengine::MaterialStore::shaderLabel().

◆ named

◆ params

std::vector<MaterialParamSlot> esengine::MaterialUniformLayout::params

◆ textures

std::vector<MaterialTextureSlot> esengine::MaterialUniformLayout::textures

◆ tipParam

std::string esengine::MaterialUniformLayout::tipParam

The float param that turns the shader's blended tip pass on (see ParsedShader::tipParam).

Definition at line 104 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf(), and resolveNamed().

◆ usesGBuffer

bool esengine::MaterialUniformLayout::usesGBuffer = false

The shader reads the scene's surface record (ParsedShader::usesGBuffer).

Definition at line 108 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf().

◆ usesLights

bool esengine::MaterialUniformLayout::usesLights = false

The shader reads the frame's light block and shadow atlas (ParsedShader::usesLights).

Definition at line 110 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf().

◆ vertexBounds

float esengine::MaterialUniformLayout::vertexBounds = 0.0f

What the shader's vertex hook can move a vertex by (ParsedShader::vertexBounds), and whether it has a hook at all — culling grows a mesh's box by the first, and the shadow pass builds a program of its own for the second.

Definition at line 118 of file MaterialStore.hpp.

Referenced by esengine::MaterialStore::layoutOf(), and esengine::MaterialStore::vertexBounds().

◆ vertexHook

bool esengine::MaterialUniformLayout::vertexHook = false

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