Type Alias: ShaderModule<PropsT, UniformsT, BindingsT>
ShaderModule<
PropsT,UniformsT,BindingsT> =object
Defined in: api/shader-module/shader-module.ts:43
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: api/shader-module/shader-module.ts:55
Logical bind-group assignment for bindings declared by this module
bindings?
optionalbindings?:BindingsT
Defined in: api/shader-module/shader-module.ts:53
Used for type inference, not currently used for values
defaultUniforms?
optionaldefaultUniforms?:Required<UniformsT>
Defined in: api/shader-module/shader-module.ts:78
Default uniform values
defines?
optionaldefines?:Record<string,boolean|number>
Defined in: api/shader-module/shader-module.ts:87
Boolean or numeric preprocessor defines contributed by this shader module.
dependencies?
optionaldependencies?:ShaderModule<any,any>[]
Defined in: api/shader-module/shader-module.ts:88
deprecations?
optionaldeprecations?:ShaderModuleDeprecation[]
Defined in: api/shader-module/shader-module.ts:90
Information on deprecated properties
firstBindingSlot?
optionalfirstBindingSlot?:number
Defined in: api/shader-module/shader-module.ts:57
Preferred starting binding slot for this module's WGSL @binding(auto) declarations.
fs?
optionalfs?:string
Defined in: api/shader-module/shader-module.ts:69
GLSL fragment shader code
getUniforms?
optionalgetUniforms?: (props,prevUniforms?) =>Partial<UniformsT&BindingsT>
Defined in: api/shader-module/shader-module.ts:81
Function that maps props to uniforms & bindings
Parameters
props
Partial<PropsT>
prevUniforms?
UniformsT
Returns
Partial<UniformsT & BindingsT>
implements?
optionalimplements?:string
Defined in: api/shader-module/shader-module.ts:62
Exclusive named shader interface provided by this module.
instance?
optionalinstance?:object
Defined in: api/shader-module/shader-module.ts:93
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: api/shader-module/shader-module.ts:59
props?
optionalprops?:PropsT
Defined in: api/shader-module/shader-module.ts:49
Used for type inference not for values
propTypes?
optionalpropTypes?:Record<keyofUniformsT,UniformInfo>
Defined in: api/shader-module/shader-module.ts:76
Uniform JS prop types
source?
optionalsource?:string
Defined in: api/shader-module/shader-module.ts:67
WGSL code, or reusable code in sourceLanguage combined with the application source.
sourceLanguage?
optionalsourceLanguage?:string
Defined in: api/shader-module/shader-module.ts:65
Language of source when an application-owned transpiler is required.
uniforms?
optionaluniforms?:UniformsT
Defined in: api/shader-module/shader-module.ts:51
Used for type inference, not currently used for values
uniformTypes?
optionaluniformTypes?:Required<UniformTypes<UniformsT>>
Defined in: api/shader-module/shader-module.ts:74
Uniform shader types @note: Both order and types MUST match uniform block declarations in shader
vs?
optionalvs?:string
Defined in: api/shader-module/shader-module.ts:71
GLSL vertex shader code