add glossary

pull/14/head
Patricio Gonzalez Vivo 10 years ago
parent 5a38a58c8d
commit 28f372e311

@ -58,12 +58,14 @@ This is a gentle step-by-step guide through the abstract and complex universe of
* Environmental-maps (spherical and cube)
* Reflect and refract
* [Examples](examples/)
* [Appendix](appendix/)
* [How can I navigate this book offline?](http://thebookofshaders.com/appendix/index.html#00.md)
* [How to use this book in a classroom with RaspberryPi?](http://thebookofshaders.com/appendix/index.html#01.md)
* [How to print this book?](http://thebookofshaders.com/appendix/index.html#02.md)
* [Examples](examples/)
## About the Author

@ -4,7 +4,7 @@
<html>
<head>
<meta charset="utf-8">
<title>How to read this book off-line</title>
<title>Appendix</title>
<meta name="keywords" content="glsl,shader,github,repository" />
<meta name="description" content="This is a gentle step-by-step guide through the abstract and complex universe of Fragment Shaders."/>

@ -0,0 +1,3 @@
# Glossary

@ -0,0 +1,20 @@
## Abs
Return the absolute value of the parameter
```glsl
float abs(float x)
vec2 abs(vec2 x)
vec3 abs(vec3 x)
vec4 abs(vec4 x)
```
### Parameters
```x``` Specify the value of which to return the absolute.
### Description
```abs()``` returns the absolute value of ```x```.
<div class="simpleFunction" data="y = abs(x); "></div>
### See Also
[sign](index.html#sign.md)

@ -0,0 +1,20 @@
## Acos
Return the arccosine of the parameter
```glsl
float acos(float x)
vec2 acos(vec2 x)
vec3 acos(vec3 x)
vec4 acos(vec4 x)
```
### Parameters
```x``` Specify the value whose arccosine to return.
### Description
```acos()``` returns the angle whose trigonometric cosine is ```x```.
<div class="simpleFunction" data="y = acos(x); "></div>
### See Also
[cos](index.html#cos.md), [sin](index.html#sin.md), [asin](index.html#asin.md), [tan](index.html#tan.md), [atan](index.html#atan.md)

@ -0,0 +1,20 @@
## Asin
Return the arcsine of the parameter
```glsl
float asin(float x)
vec2 asin(vec2 x)
vec3 asin(vec3 x)
vec4 asin(vec4 x)
```
### Parameters
```x``` Specify the value whose arcsine to return.
### Description
```asin()``` returns the angle whose trigonometric sine is ```x```.
<div class="simpleFunction" data="y = asin(x); "></div>
### See Also
[cos](index.html#cos.md), [sin](index.html#sin.md), [acos](index.html#acos.md), [tan](index.html#tan.md), [atan](index.html#atan.md)

@ -0,0 +1,31 @@
## Atan
Return the arc-tangent of the parameters
```glsl
float atan(float y, float x)
vec2 atan(vec2 y, vec2 x)
vec3 atan(vec3 y, vec3 x)
vec4 atan(vec4 y, vec4 x)
```
```glsl
float atan(float y_over_x)
vec2 atan(vec2 y_over_x)
vec3 atan(vec3 y_over_x)
vec4 atan(vec4 y_over_x)
```
### Parameters
```y``` Specify the numerator of the fraction whose arctangent to return.
```x``` Specify the denominator of the fraction whose arctangent to return.
```y_over_x``` Specify the fraction whose arctangent to return.
### Description
```atan()``` returns the angle whose trigonometric arctangent is ```y,x``` or ```y_over_x```, depending on which overload is invoked. In the first overload, the signs of ```y``` and ```x``` are used to determine the quadrant that the angle lies in. The values returned by atan in this case are in the range -PI and PI. Results are undefined if ```x``` is zero.
For the second overload, ```atan()``` returns the angle whose tangent is ```y_over_x```. Values returned in this case are in the range -PI to PI.
### See Also
[cos](index.html#cos.md), [acos](index.html#acos.md), [sin](index.html#sin.md), [asin](index.html#asin.md), [atan](index.html#atan.md)

@ -0,0 +1,20 @@
## Cos
Return the cosine of the parameter
```glsl
float cos(float angle)
vec2 cos(vec2 angle)
vec3 cos(vec3 angle)
vec4 cos(vec4 angle)
```
### Parameters
```angle``` Specify the quantity, in radians, of which to return the cosine.
### Description
```cos()``` returns the trigonometric sine of angle.
<div class="simpleFunction" data="y = cos(x); "></div>
### See Also
[acos](index.html#acos.md), [sin](index.html#sin.md), [asin](index.html#asin.md), [tan](index.html#tan.md), [atan](index.html#atan.md)

@ -0,0 +1,18 @@
## Degrees
Convert a quantity in radians to degrees
```glsl
float degrees(float radians)
vec2 degrees(vec2 radians)
vec3 degrees(vec3 radians)
vec4 degrees(vec4 radians)
```
### Parameters
```radians``` Specify the quantity, in radians, to be converted to degrees.
### Description
```degrees()``` converts a quantity, specified in radians into degrees. That is, the return value is ```(180.0*radians)/PI```
### See Also
[radians](index.html#radians.md)

@ -0,0 +1,21 @@
## Exp
Return the natural exponentiation of the parameter
```glsl
float exp(float x)
vec2 exp(vec2 x)
vec3 exp(vec3 x)
vec4 exp(vec4 x)
```
### Parameters
```x``` Specify the value to exponentiate.
### Description
```exp()``` returns the natural exponentiation of ```x```.
<div class="simpleFunction" data="y = exp(x); "></div>
### See Also
[log](index.html#log.md), [log2](index.html#log2.md), [exp2](index.html#exp2.md)

@ -0,0 +1,21 @@
## Exp2
Return 2 raised to the power of the parameter
```glsl
float exp2(float x)
vec2 exp2(vec2 x)
vec3 exp2(vec3 x)
vec4 exp2(vec4 x)
```
### Parameters
```x``` Specify the value of the power to which 2 will be raised.
### Description
```exp2()``` returns 2 raised to the power of ```x```.
<div class="simpleFunction" data="y = exp2(x); "></div>
### See Also
[log](index.html#log.md), [log2](index.html#log2.md), [exp](index.html#exp.md)

@ -0,0 +1,20 @@
## Floor
Find the nearest integer less than or equal to the parameter
```glsl
float floor(float x)
vec2 floor(vec2 x)
vec3 floor(vec3 x)
vec4 floor(vec4 x)
```
### Parameters
```x``` Specify the value to evaluate.
### Description
```sign()``` returns a value equal to the nearest integer that is less than or equal to x.
<div class="simpleFunction" data="y = floor(x); "></div>
### See Also
[ceil](index.html#ceil.md), [trunc](index.html#trunc.md), [round](index.html#round.md)

@ -0,0 +1,69 @@
<!-- Copyright 2015 Patricio Gonzalez Vivo (http://patriciogonzalezvivo.com) -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Glossary</title>
<meta name="keywords" content="glsl,shader,github,repository" />
<meta name="description" content="This is a gentle step-by-step guide through the abstract and complex universe of Fragment Shaders."/>
<!-- CodeMirror -->
<link type='text/css' rel='stylesheet' href="../src/codemirror/css/codemirror.css">
<link type='text/css' rel="stylesheet" href="../src/codemirror/addon/fold/foldgutter.css">
<link type='text/css' rel="stylesheet" href="../src/codemirror/addon/dialog/dialog.css">
<link type='text/css' rel="stylesheet" href="../src/codemirror/addon/hint/show-hint.css">
<link type='text/css' rel="stylesheet" href="../src/codemirror/theme/neo.css">
<script type="text/javascript" src="../src/codemirror.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/search/searchcursor.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/search/search.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/dialog/dialog.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/edit/closebrackets.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/comment/comment.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/wrap/hardwrap.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/fold/foldcode.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/fold/brace-fold.js"></script>
<script type="text/javascript" src="../src/codemirror/keymap/sublime.js"></script>
<script type="text/javascript" src="../src/codemirror/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="../src/codemirror/mode/clike.js"></script>
<!-- Highlight -->
<link type='text/css' rel='stylesheet' href="../css/github.css">
<script type="text/javascript" src="../src/highlight.min.js"></script>
<!-- Marked -->
<script type="text/javascript" src="../src/marked.js"></script>
<!-- My stuff -->
<link type='text/css' rel='stylesheet' href="../css/style.css">
<script type="text/javascript" src="../src/glslCanvas.js"></script>
</head>
<body>
<div class="header"><p><a href="http://patriciogonzalezvivo.com/2015/thebookofshaders/">The Book of Shaders</a> by <a href="http://patriciogonzalezvivo.com">Patricio Gonzalez Vivo</a></p></div>
<hr>
<div id="content"> </div>
<hr>
<ul class="navigationBar" >
<li class="navigationBar" onclick="homePage()"> Home </li>
</ul>
<footer>
<p> Copyright 2015 <a href="http://www.patriciogonzalezvivo.com" target="_blank">Patricio Gonzalez Vivo</a> </p>
</footer>
<script type="text/javascript" src="../src/main.js" defer></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-18824436-2', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

@ -0,0 +1,21 @@
## Inversesqrt
Return the inverse of the square root of the parameter
```glsl
float inversesqrt(float x)
vec2 inversesqrt(vec2 x)
vec3 inversesqrt(vec3 x)
vec4 inversesqrt(vec4 x)
```
### Parameters
```x``` Specify the value of which to take the inverse of the square root.
### Description
```inversesqrt()``` returns the inverse of the square root of ```x```.
<div class="simpleFunction" data="y = inversesqrt(x); "></div>
### See Also
[pow](index.html#pow.md), [sqrt](index.html#sqrt.md)

@ -0,0 +1,21 @@
## Log
Return the natural logarithm of the parameter
```glsl
float log(float x)
vec2 log(vec2 x)
vec3 log(vec3 x)
vec4 log(vec4 x)
```
### Parameters
```x``` Specify the value of which to take the natural logarithm.
### Description
```log()``` returns the natural logarithm of ```x```.
<div class="simpleFunction" data="y = log(x); "></div>
### See Also
[log2](index.html#log2.md), [exp](index.html#exp.md), [exp2](index.html#exp2.md)

@ -0,0 +1,21 @@
## Log2
Return the base 2 logarithm of the parameter
```glsl
float log2(float x)
vec2 log2(vec2 x)
vec3 log2(vec3 x)
vec4 log2(vec4 x)
```
### Parameters
```x``` Specify the value of which to take the base 2 logarithm.
### Description
```log2()``` returns the base 2 logarithm of ```x```.
<div class="simpleFunction" data="y = log2(x); "></div>
### See Also
[log](index.html#log.md), [exp](index.html#exp.md), [exp2](index.html#exp2.md)

@ -0,0 +1,23 @@
## Pow
Return the value of the first parameter raised to the power of the second.
```glsl
float pow(float x, float y)
vec2 pow(vec2 x, vec2 y)
vec3 pow(vec3 x, vec3 y)
vec4 pow(vec4 x, vec4 y)
```
### Parameters
```x``` Specify the value to raise to the power ```y```.
```y``` Specify the power to which to raise ```x```.
### Description
```pow()``` returns the value of ```x``` raised to the ```y``` power.
<div class="simpleFunction" data="y = pow(x,3.0); "></div>
### See Also
[inversesqrt](index.html#inversesqrt.md), [sqrt](index.html#sqrt.md)

@ -0,0 +1,18 @@
## Radians
Convert a quantity in degrees to radians
```glsl
float radians(float degrees)
vec2 radians(vec2 degrees)
vec3 radians(vec3 degrees)
vec4 radians(vec4 degrees)
```
### Parameters
```degrees``` Specify the quantity, in degrees, to be converted to radians.
### Description
```radians()``` converts a quantity, specified in degrees into radians. That is, the return value is ```(PI * degrees)/180```.
### See Also
[degrees](index.html#degrees.md)

@ -0,0 +1,20 @@
## Sign
Extract the sign of the parameter
```glsl
float sign(float x)
vec2 sign(vec2 x)
vec3 sign(vec3 x)
vec4 sign(vec4 x)
```
### Parameters
```x``` Specify the value from which to extract the sign.
### Description
```sign()``` returns -1.0 if x is less than 0.0, 0.0 if x is equal to 0.0, and +1.0 if x is greater than 0.0.
<div class="simpleFunction" data="y = sign(x); "></div>
### See Also
[abs](index.html#abs.md)

@ -0,0 +1,20 @@
## Sin
Return the sine of the parameter
```glsl
float sin(float angle)
vec2 sin(vec2 angle)
vec3 sin(vec3 angle)
vec4 sin(vec4 angle)
```
### Parameters
```angle``` Specify the quantity, in radians, of which to return the sine.
### Description
```sin()``` returns the trigonometric sine of angle.
<div class="simpleFunction" data="y = sin(x); "></div>
### See Also
[acos](index.html#acos.md), [cos](index.html#cos.md), [asin](index.html#asin.md), [tan](index.html#tan.md), [atan](index.html#atan.md)

@ -0,0 +1,20 @@
## Sqrt
Return the square root of the parameter
```glsl
float sqrt(float x)
vec2 sqrt(vec2 x)
vec3 sqrt(vec3 x)
vec4 sqrt(vec4 x)
```
### Parameters
```x``` Specify the value of which to take the square root.
### Description
```sqrt()``` returns the square root of ```x```.
<div class="simpleFunction" data="y = sqrt(x); "></div>
### See Also
[inversesqrt](index.html#inversesqrt.md), [pow](index.html#pow.md)

@ -0,0 +1,20 @@
## Tan
Return the tangent of the parameter
```glsl
float tan(float angle)
vec2 tan(vec2 angle)
vec3 tan(vec3 angle)
vec4 tan(vec4 angle)
```
### Parameters
```angle``` Specify the quantity, in radians, of which to return the tangent.
### Description
```tan()``` returns the trigonometric tangent of angle.
<div class="simpleFunction" data="y = tan(x); "></div>
### See Also
[cos](index.html#cos.md), [acos](index.html#acos.md), [sin](index.html#sin.md), [asin](index.html#asin.md), [atan](index.html#atan.md)
Loading…
Cancel
Save