---
title: "grazingOf"
description: "How edge-on the surface is to the viewer: 0 face-on, 1 grazing."
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#L450"
---

# grazingOf

How edge-on the surface is to the viewer: 0 face-on, 1 grazing.

```ts
grazingOf(n: Expr, view: Expr): Expr
```

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

The input the fresnel words take when you have a view ray. Without one, use `grazingFlat`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `n` | `Expr` |  |
| `view` | `Expr` |  |

## Example

```ts
const grazing = grazingOf(n, viewRay(params, field))
```

## See also

- [`grazingFlat`](/docs/primitives/materials/grazingflat) — How edge-on the surface is to a straight-on viewer: 0 face-on, 1 grazing.
- [`fresnelBoost`](/docs/primitives/materials/fresnelboost) — A multiplier that brightens grazing edges: 1 face-on, up to `1 + amount` at the rim.
- [`schlickFresnel`](/docs/primitives/materials/schlickfresnel) — How mirror-like a surface is at this pixel: `r0` face-on, rising to `r0 + gain` at the rim.

## Used by

[BrushedMetal](/docs/components/brushedmetal), [CarbonFiber](/docs/components/carbonfiber), [Chrome](/docs/components/chrome), [Obsidian](/docs/components/obsidian), [Voxels](/docs/components/voxels)