thebookofshaders/glossary/abs/README.md

22 lines
507 B
Markdown
Raw Normal View History

2015-04-17 04:52:51 +00:00
## Abs
2015-05-01 20:05:55 +00:00
Return the absolute value of the parameter.
2015-04-17 04:52:51 +00:00
2015-04-18 14:41:34 +00:00
### Declaration
2015-04-17 04:52:51 +00:00
```glsl
float abs(float x)
vec2 abs(vec2 x)
vec3 abs(vec3 x)
vec4 abs(vec4 x)
```
### Parameters
2015-04-18 14:41:34 +00:00
```x``` specify the value of which to return the absolute.
2015-04-17 04:52:51 +00:00
### Description
```abs()``` returns the absolute value of ```x```.
<div class="simpleFunction" data="y = abs(x); "></div>
### See Also
2017-08-19 10:11:58 +00:00
[sign()](/glossary/?search=sign), [min()](/glossary/?search=min), [max()](/glossary/?search=max), [Chapter 05: Shaping Functions](../05/)