# @dioramajs/glsl

Converted GLSL stages as effects, without the transpiler.

## Functions and values

- [applyShader](/docs/api/diorama-glsl/apply-shader.md): Adds a shader to the surface from a custom effect's setup. Call the result to remove it.
- [glslEffect](/docs/api/diorama-glsl/glsl-effect.md): Wraps a GLSL stage pair as an effect. Bindings, params and varyings are checked up front and reported together as one `EFFECT_DEFINITION`.
- [shaderNode](/docs/api/diorama-glsl/shader-node.md): The fragment shader as a vec4 node for a custom material. The element's image is `texture(map, coverUV(uv))` times the box mask.

## Types

- [ApplyOptions](/docs/api/diorama-glsl/types/apply-options.md): Options of `applyShader` and `shaderNode`.
- [Binding](/docs/api/diorama-glsl/types/binding.md): Where a uniform's value comes from.
- [GlslCode](/docs/api/diorama-glsl/types/glsl-code.md): Codes of conversion diagnostics: errors, warnings and notes.
- [GlslDiagnostic](/docs/api/diorama-glsl/types/glsl-diagnostic.md): A problem or note found while converting GLSL.
- [GlslEffectOptions](/docs/api/diorama-glsl/types/glsl-effect-options.md): Options of `glslEffect`: definition fields plus how uniforms are bound.
- [GlslShader](/docs/api/diorama-glsl/types/glsl-shader.md): Default export of a `?shader` import. `build` needs nothing but `three/tsl`.
- [GlslSource](/docs/api/diorama-glsl/types/glsl-source.md): One converted shader, or a vertex and a fragment shader.
- [GlslType](/docs/api/diorama-glsl/types/glsl-type.md): GLSL types a uniform or varying can have.
- [MergeParams](/docs/api/diorama-glsl/types/merge-params.md): The glue's params override the shader's. An untyped (wildcard `?shader`) shader adds none.
- [SamplerLike](/docs/api/diorama-glsl/types/sampler-like.md): A texture uniform that can be sampled at any UV.
- [ShaderFunction](/docs/api/diorama-glsl/types/shader-function.md): TSL body of a GLSL prototype, called with the arguments in GLSL order. Their node types are known only in the shader, so an argument fits any TSL call; annotate it to narrow it: `(p: Node<'vec2'>) => …`.
- [ShaderInput](/docs/api/diorama-glsl/types/shader-input.md): Built-in inputs a uniform can bind to, as `input:<name>`.
- [ShaderScope](/docs/api/diorama-glsl/types/shader-scope.md): Nodes a shader's `build` reads.
- [TextureSource](/docs/api/diorama-glsl/types/texture-source.md): A URL, a shared Texture (never disposed by us), or a loader whose Texture the instance owns.
- [UniformInfo](/docs/api/diorama-glsl/types/uniform-info.md): Type and binding of one uniform.
