You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
506 B
Markdown
21 lines
506 B
Markdown
10 years ago
|
## Abs
|
||
10 years ago
|
Return the absolute value of the parameter.
|
||
10 years ago
|
|
||
10 years ago
|
### Declaration
|
||
10 years ago
|
```glsl
|
||
|
float abs(float x)
|
||
|
vec2 abs(vec2 x)
|
||
|
vec3 abs(vec3 x)
|
||
|
vec4 abs(vec4 x)
|
||
|
```
|
||
|
|
||
|
### Parameters
|
||
10 years ago
|
```x``` specify the value of which to return the absolute.
|
||
10 years ago
|
|
||
|
### Description
|
||
|
```abs()``` returns the absolute value of ```x```.
|
||
|
|
||
|
<div class="simpleFunction" data="y = abs(x); "></div>
|
||
|
|
||
|
### See Also
|
||
9 years ago
|
[sign()](/glossary/?search=sign), [min()](/glossary/?search=min), [max()](/glossary/?search=max), [Chapter 05: Shaping Functions](../05/)
|