import type { SymbolUniformValue } from 'sandstone/arguments/generated/dispatcher.ts' import type { Registry } from 'sandstone/arguments/generated/registry.ts' import type { RGBA } from 'sandstone/arguments/generated/util/color.ts' import type { RootNBT } from 'sandstone/arguments/nbt.ts' import type { NamespacedString, NBTInt, NonEmptyString } from 'sandstone' export type AuxTarget = { name: string, id: string, width?: NBTInt, height?: NBTInt, bilinear?: boolean, } export type FixedSizedTarget = { width: NBTInt, height: NBTInt, } export type FullScreenTarget = Record export type InternalTarget = { width?: NBTInt, height?: NBTInt, /** * If `true`, target will be persistent across frames. Defaults to `false`. * The contents of the target will be cleared when the screen is resized. */ persistent?: boolean, /** * Target will be filled with this color when created or cleared. Defaults to `0`. */ clear_color?: RGBA, } export type OldTarget = { name: string, width?: NBTInt, height?: NBTInt, } export type Pass = ({ vertex_shader: NamespacedString, fragment_shader: NamespacedString, } & { inputs?: Array<(TargetInput | TextureInput)>, output: NamespacedString, uniforms?: UniformBlocks, }) export type PostEffect = { targets?: Targets, passes?: Array, } export type TargetInput = { target: NamespacedString, sampler_name: string, use_depth_buffer?: boolean, bilinear?: boolean, } export type Targets = ({ [Key in Extract]?: InternalTarget }) export type TextureInput = { /** * Value: * * Value: A texture ID within a path root of `(namespace)/textures/effect/` */ location: NamespacedString, sampler_name: string, /** * Value: * Range: 1.. */ width: NBTInt<{ min: 1, }>, /** * Value: * Range: 1.. */ height: NBTInt<{ min: 1, }>, bilinear?: boolean, } export type UniformBlocks = ({ [Key in NonEmptyString]?: Array }) export type UniformValue = NonNullable<({ [S in Extract, string>]?: ({ /** * Unused by the game, but good to set in practice. */ name?: string, } & { /** * Value: * * - Int(`int`) * - Ivec3(`ivec3`) * - Float(`float`) * - Vec2(`vec2`) * - Vec3(`vec3`) * - Vec4(`vec4`) * - Matrix4x4(`matrix4x4`) */ type: S, value: (S extends keyof SymbolUniformValue ? SymbolUniformValue[S] : RootNBT), }) }[Extract])> export type UniformValueType = ('int' | 'ivec3' | 'float' | 'vec2' | 'vec3' | 'vec4' | 'matrix4x4')