English
Class: ShaderAttributeResolver
Defined in: ssplayer-core/dist/index.d.ts:5682
Reads a part's SHDR (integration shader) attribute into the values every renderer hands its shader: which built-in ss-* program to use, its eight parameters, and the cell's UV rect.
What the shader is and what it is given does not depend on how it is bound — ssplayer-pixi writes into a UniformGroup and ssplayer-webgl calls gl.uniform*, and the GLSL/WGSL bodies stay with each of them, but the numbers reaching them are the same numbers. The cell rect in particular is a derivation rather than a value in the frame: it is the min/max of the quad's four corner UVs, and getting it wrong shows up as a shader sampling outside its own cell.
Allocation-free: params and cellRect are reused across calls, valid until the next resolve.
Constructors
Constructor
new ShaderAttributeResolver():
ShaderAttributeResolver
Returns
ShaderAttributeResolver
Properties
cellRect
readonlycellRect:Float32Array<ArrayBuffer>
Defined in: ssplayer-core/dist/index.d.ts:5688
The cell's UV rect as (left, top, right, bottom).
idHash
idHash:
number
Defined in: ssplayer-core/dist/index.d.ts:5684
id_hash of the ss-* program the part asks for.
params
readonlyparams:Float32Array<ArrayBuffer>
Defined in: ssplayer-core/dist/index.d.ts:5686
param0..param7, in order.
Methods
resolve()
resolve(
frameData,shaderIdx,uvs):boolean
Defined in: ssplayer-core/dist/index.d.ts:5696
Read the SHDR attribute at shaderIdx of frameData, taking the cell rect from uvs — the quad's corner UVs at indices 0..3 (vertex 4, where one exists, is the centre and takes no part). Returns false when the attribute is not there, in which case nothing is written.
Parameters
frameData
shaderIdx
number
uvs
Float32Array
Returns
boolean