Type Alias: ShaderModule<PropsT, UniformsT, BindingsT>
ShaderModule<
PropsT,UniformsT,BindingsT> =object
Defined in: lib/shader-module/shader-module.ts:41
A shader module definition object
Note
Needs to be initialized with initializeShaderModules
Note
UniformsT & BindingsT are deduced from PropsT by default. If
a custom type for UniformsT is used, BindingsT should be also be provided.
Type Parameters
PropsT
PropsT extends Record<string, any> = Record<string, any>
UniformsT
UniformsT extends Record<string, ShaderModuleUniformValue> = PickUniforms<PropsT>
BindingsT
BindingsT extends Record<string, Binding> = PickBindings<PropsT>
Properties
bindingLayout?
optionalbindingLayout?: readonlyShaderModuleBindingLayout[]
Defined in: lib/shader-module/shader-module.ts:53
Logical bind-group assignment for bindings declared by this module
bindings?
optionalbindings?:BindingsT
Defined in: lib/shader-module/shader-module.ts:51
Used for type inference, not currently used for values
defaultUniforms?
optionaldefaultUniforms?:Required<UniformsT>
Defined in: lib/shader-module/shader-module.ts:76
Default uniform values
defines?
optionaldefines?:Record<string,boolean|number>
Defined in: lib/shader-module/shader-module.ts:85
Boolean or numeric preprocessor defines contributed by this shader module.
dependencies?
optionaldependencies?:ShaderModule<any,any>[]
Defined in: lib/shader-module/shader-module.ts:86
deprecations?
optionaldeprecations?:ShaderModuleDeprecation[]
Defined in: lib/shader-module/shader-module.ts:88
Information on deprecated properties
firstBindingSlot?
optionalfirstBindingSlot?:number
Defined in: lib/shader-module/shader-module.ts:55
Preferred starting binding slot for this module's WGSL @binding(auto) declarations.
fs?
optionalfs?:string
Defined in: lib/shader-module/shader-module.ts:67
GLSL fragment shader code
getUniforms?
optionalgetUniforms?: (props,prevUniforms?) =>Partial<UniformsT&BindingsT>
Defined in: lib/shader-module/shader-module.ts:79
Function that maps props to uniforms & bindings
Parameters
props
Partial<PropsT>
prevUniforms?
UniformsT
Returns
Partial<UniformsT & BindingsT>
implements?
optionalimplements?:string
Defined in: lib/shader-module/shader-module.ts:60
Exclusive named shader interface provided by this module.
instance?
optionalinstance?:object
Defined in: lib/shader-module/shader-module.ts:91
The instance field contains information that is generated at run-time
normalizedInjections
normalizedInjections:
object
Empty compatibility value for consumers using older shadertools assembly.
normalizedInjections.fragment
fragment:
Record<string,ResolvedShaderInjection>
normalizedInjections.vertex
vertex:
Record<string,ResolvedShaderInjection>
parsedDeprecations
parsedDeprecations:
ShaderModuleDeprecation[]
propValidators?
optionalpropValidators?:Record<string,PropValidator>
name
name:
string
Defined in: lib/shader-module/shader-module.ts:57
props?
optionalprops?:PropsT
Defined in: lib/shader-module/shader-module.ts:47
Used for type inference not for values
propTypes?
optionalpropTypes?:Record<keyofUniformsT,UniformInfo>
Defined in: lib/shader-module/shader-module.ts:74
Uniform JS prop types
source?
optionalsource?:string
Defined in: lib/shader-module/shader-module.ts:65
WGSL code, or reusable code in sourceLanguage combined with the application source.
sourceLanguage?
optionalsourceLanguage?:string
Defined in: lib/shader-module/shader-module.ts:63
Language of source when an application-owned transpiler is required.
uniforms?
optionaluniforms?:UniformsT
Defined in: lib/shader-module/shader-module.ts:49
Used for type inference, not currently used for values
uniformTypes?
optionaluniformTypes?:Required<UniformTypes<UniformsT>>
Defined in: lib/shader-module/shader-module.ts:72
Uniform shader types @note: Both order and types MUST match uniform block declarations in shader
vs?
optionalvs?:string
Defined in: lib/shader-module/shader-module.ts:69
GLSL vertex shader code