---
title: "grazingFlat"
description: "How edge-on the surface is to a straight-on 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#L815"
---

# grazingFlat

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

```ts
grazingFlat(n: Expr): Expr
```

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

Use it when the material has no `viewRay`. The fresnel input for plastics, frost and water.

## Parameters

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

## Example

```ts
const grazing = grazingFlat(n)
```

## See also

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

## Used by

[Crystal](/docs/components/crystal), [Frost](/docs/components/frost), [Goo](/docs/components/goo), [Plastic](/docs/components/plastic), [Water](/docs/components/water)