@thi.ng/shader-ast-stdlib
Version:
Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast
31 lines • 1.13 kB
TypeScript
/**
* Computes the surface normal from a grayscale texture at given `uv` position
* and using given `step` to define the half-distances between the 4 neighbor
* lookups (north/south/east/west). The `z` value is used as the normal's Z
* component (prior to normalization). `eps` is being added to all components to
* avoid zero-vectors.
*
* @remarks
* The function only uses the X (red) component of the texture.
*
* @param tex
* @param uv
* @param step
* @param z
* @param eps
*/
export declare const normal2: import("@thi.ng/shader-ast").TaggedFn5<"sampler2D", "vec2", "vec2", "float", "float", "vec3">;
/**
* Principally the same as {@link normal2}, but using a RGBA 8bit/channel
* texture storing float values encoded using {@link packFloat}. WHen
* `packedNormal2()` then samples this textures, each value will be
* automatically decoded using {@link unpackFloat}.
*
* @param tex
* @param uv
* @param step
* @param z
* @param eps
*/
export declare const packedNormal2: import("@thi.ng/shader-ast").TaggedFn5<"sampler2D", "vec2", "vec2", "float", "float", "vec3">;
//# sourceMappingURL=normal.d.ts.map