Interface ShadertoyTextureOptions

interface ShadertoyTextureOptions {
    brightOpacity?: number;
    bufferA?: ShadertoyTextureItemOptions;
    bufferB?: ShadertoyTextureItemOptions;
    bufferC?: ShadertoyTextureItemOptions;
    bufferD?: ShadertoyTextureItemOptions;
    color?: ColorRepresentation;
    colorOpacity?: number;
    common?: string;
    defines?: Record<string, any>;
    height: number;
    hsbExpr?: string;
    hsbOffset?: [number, number, number];
    image?: ShadertoyTextureItemOptions;
    inputUniforms?: {
        declare: string;
        name: string;
        value: Uniform<any>;
    }[];
    map?: Texture;
    materialParameters?: MaterialParameters;
    mouseInputPos?: [number, number];
    opacity?: number;
    opacityColor?: ColorRepresentation;
    renderTargetOptions?: RenderTargetOptions;
    repeat?: [number, number];
    shader?: string;
    uvRotateAngle?: number;
    uvRotateCenter?: [number, number];
    uvScale?: [number, number];
    uvScaleBgColor?: [number, number, number, number];
    uvScaleCenter?: [number, number];
    width: number;
}

Properties

brightOpacity?: number

亮度透明值 大于0表示亮度值*值表示透明度,小于0表示 (1-亮度值)*值表示透明度

bufferA的shader

bufferB的shader

bufferC的shader

bufferD的shader

color?: ColorRepresentation

背景颜色

colorOpacity?: number

背景颜色透明度(0-1)

common?: string

common的shader

defines?: Record<string, any>

生成纹理的材质预定义宏

height: number

像素高

hsbExpr?: string

hsb颜色表达式 (变量hsb)

hsbOffset?: [number, number, number]

hsb偏移 (对输出颜色进行处理)

image的shader

inputUniforms?: {
    declare: string;
    name: string;
    value: Uniform<any>;
}[]

uniforms

Type declaration

  • declare: string

    用在 shader中声明写法

  • name: string

    uniform名称

  • value: Uniform<any>
map?: Texture

背景材质

materialParameters?: MaterialParameters

生成纹理的材质参数

mouseInputPos?: [number, number]

如果不输入,则默认为当前鼠标像素位置

opacity?: number

透明度

opacityColor?: ColorRepresentation

透明色

renderTargetOptions?: RenderTargetOptions

生成纹理的渲染参数

repeat?: [number, number]

重复纹理

shader?: string

等同于image中的shader

uvRotateAngle?: number

uv旋转角度

uvRotateCenter?: [number, number]

uv旋转中心点,默认(0.5,0.5)

uvScale?: [number, number]

uv缩放倍数

uvScaleBgColor?: [number, number, number, number]

uv缩放背景色(r,b,g,a) (0-1)

uvScaleCenter?: [number, number]

uv缩放倍中心点,默认(0.5,0.5)

width: number

像素宽