@tolokoban/tgd
Version:
ToloGameDev library for WebGL2
31 lines • 1.33 kB
TypeScript
import { WebglAttributeType, WebglUniformType } from "..";
import { TgdCodeBloc, TgdCodeFunctions, TgdCodeVariables } from "./code";
/**
* Helper to wirte the code of a fragment Shader.
* @see https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf
*/
export declare class TgdShaderFragment {
precision: "lowp" | "mediump" | "highp";
uniforms: TgdCodeVariables<WebglUniformType>;
varying: TgdCodeVariables<WebglAttributeType>;
outputs: TgdCodeVariables<WebglAttributeType>;
/**
* The key should be the signatureof a function
* (like `vec2 scale(vec2 v, float s)`)
* and the value to code of this function (like `return v * s;`).
*
* But if the key starts with a `_`, then the content of the value is uses verbatim.
*/
functions: TgdCodeFunctions | TgdCodeBloc;
mainCode: TgdCodeBloc;
constructor({ precision, uniforms, outputs, varying, functions, mainCode, }?: Partial<{
precision: "lowp" | "mediump" | "highp";
uniforms: TgdCodeVariables<WebglUniformType>;
outputs: TgdCodeVariables<WebglAttributeType>;
varying: TgdCodeVariables<WebglAttributeType>;
functions: TgdCodeFunctions | TgdCodeBloc;
mainCode: TgdCodeBloc;
}>);
get code(): string;
}
//# sourceMappingURL=fragment.d.ts.map