---
title: "resolveScalar"
description: "A `Scalar` or prop ref as a GPU value, for a hand-written builder."
group: "define"
groupTitle: "Defining a shader"
categoryId: "invoke"
categorySlug: "invoke"
categoryTitle: "Context & invocation"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/invoke.ts#L131"
---

# resolveScalar

A `Scalar` or prop ref as a GPU value, for a hand-written builder.

```ts
resolveScalar(input: Scalar | ScalarSource, params: SlotParams): Expr
```

Import `resolveScalar` from `shaders/std`.

Products (`.times()`), radial masks and signals are built out here. A radial mask needs a `paint:` or `effect:` host; it throws in a warp's `map:`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `input` | `Scalar \| ScalarSource` |  |
| `params` | `SlotParams` |  |

## Example

```ts
const amount = resolveScalar(radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity')), params)
```

## See also

- [`uniformOf`](/docs/primitives/invoke/uniformof) — The live GPU value of a prop, for a hand-written builder: `uniformOf(p('radius'), params)`.
- [`resolveArg`](/docs/primitives/invoke/resolvearg) — Any input value a word accepts (a prop ref, a `Scalar`, a context token, a number) as a GPU value inside a filter's builder.
- [`Scalar`](/docs/primitives/values/scalar) — A number built from props: what `radialMask(…)`, `motion.oscillating(…)` and `.times()` return.

## Used by

[Blob](/docs/components/blob)