---
title: "anisoSpecular"
description: "A highlight stretched along a grain, as on brushed metal or carbon fibre."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "materials"
categorySlug: "materials"
categoryTitle: "Materials & surfaces"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/materials.ts#L626"
---

# anisoSpecular

A highlight stretched along a grain, as on brushed metal or carbon fibre.

```ts
anisoSpecular(opts: {
    normal: Expr
    /** The 2D grain direction. */
    tangent: Expr
    /** A unit 3D light direction (see `lightVec3`). */
    light: Expr
    view: Expr
    alphas: {along: Expr; across: Expr}
    gain?: Expr | number
}): Expr
```

Import `materials` from `shaders/std` and use `materials.anisoSpecular`.

`tangent` is the 2D grain direction, `light` a unit 3D light vector, `view` the view ray and `alphas` the widths from `wardAlphas`. Pass `gain` or scale the result yourself.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{
    normal: Expr
    /** The 2D grain direction. */
    tangent: Expr
    /** A unit 3D light direction (see `lightVec3`). */
    light: Expr
    view: Expr
    alphas: {along: Expr; across: Expr}
    gain?: Expr \| number
}` |  |

## Example

```ts
const spec = anisoSpecular({normal: n, tangent: brush.tangent, light: lightVec3(direction(u.lightAngle), -0.7), view, alphas: wardAlphas(rough, aniso), gain: u.specular})
```

## See also

- [`wardAlphas`](/docs/primitives/materials/wardalphas) — Turns roughness and anisotropy sliders (0–1 each) into the two lobe widths `anisoSpecular` takes.
- [`lightVec3`](/docs/primitives/materials/lightvec3) — A 3D light direction from a `direction()` vector and an elevation.
- [`sharpGlint`](/docs/primitives/materials/sharpglint) — A highlight whose tightness follows a sharpness slider.
- [`dualLobeGlint`](/docs/primitives/materials/duallobeglint) — A highlight with a tight hot core and a wide dim halo.

## Used by

[BrushedMetal](/docs/components/brushedmetal), [CarbonFiber](/docs/components/carbonfiber), [Satin](/docs/components/satin)