finishing matrix
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 171 KiB |
@ -0,0 +1,9 @@
|
|||||||
|
## GL_ES
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,15 @@
|
|||||||
|
## Attribute
|
||||||
|
Vertex attribute data.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```glsl
|
||||||
|
attribute vec4 v_color;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```attribute``` read-only variables containing data shared from WebGL/OpenGL environment to the vertex shader.
|
||||||
|
|
||||||
|
Because the vertex shader is executed one time for each vertex, attributes are specify per vertex data typically with information such as: space position, color, normal direction and texture coordinates of a vertex.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[const](index.html#const.md), [uniform](index.html#uniform.md), [varying](index.html#varying.md), [Chapter 03: Uniforms](.../03/)
|
@ -0,0 +1,15 @@
|
|||||||
|
## Bool
|
||||||
|
Boolean variable type
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
bool aBool = true;
|
||||||
|
bool bBool = bool(aInt);
|
||||||
|
bool cBool = bool(aFloat);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bool``` data type is either true or false.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[void](index.html#void.md), [bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [struct](index.html#struct.md)
|
@ -0,0 +1,21 @@
|
|||||||
|
## Bvec2
|
||||||
|
2 dimentional boolean vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
bvec2 aBvec2 = bvec2(true, true);
|
||||||
|
bvec2 bBvec2 = bvec2(true);
|
||||||
|
|
||||||
|
bvec2 cBvec2 = bvec2(aBvec3);
|
||||||
|
bvec2 dBvec2 = bvec2(aBvec3.x, aBvec3.y);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bvec2``` is a boolean vectors with two components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,25 @@
|
|||||||
|
## Bvec3
|
||||||
|
3 dimentional boolean vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec3 aBvec3 = bvec3(true, true, true);
|
||||||
|
vec3 bBvec3 = bvec3(true);
|
||||||
|
|
||||||
|
vec3 cBvec3 = bvec3(aBvec4);
|
||||||
|
vec3 dBvec3 = bvec3(aBvec4.x, aBvec4.y, aBvec4.z);
|
||||||
|
|
||||||
|
vec3 eBvec3 = bvec3(aBvec2, aBool);
|
||||||
|
vec3 fBvec3 = bvec3(aBvec2.x, aBvec2.y, aBool);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bvec3``` is a boolean vectors with three components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
- Providing a combination of vectors and/or scalars. The respective values are used to initialize the vector. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,21 @@
|
|||||||
|
## Bvec4
|
||||||
|
4 dimentional boolean vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec4 aBvec4 = bvec4(true, true, true, true);
|
||||||
|
vec4 bBvec4 = bvec4(true);
|
||||||
|
|
||||||
|
vec4 cBvec4 = bvec4(aBvec2, aBool, aBvec3);
|
||||||
|
vec4 dBvec4 = bvec4(aBvec2.x, aBvec2.y, aBool, aBvec3.x);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bvec4``` is a boolean vectors with four components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a combination of vectors and scalars. The respective values are used to initialize the components. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,13 @@
|
|||||||
|
## Const
|
||||||
|
Constant qualifier
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```glsl
|
||||||
|
const float PI = 3.14159265359;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```const``` qualifier can be applied to the declaration of any variable to specify that its value will not be changed.
|
||||||
|
|
||||||
|
### See also
|
||||||
|
[attribute](index.html#attribute.md), [uniform](index.html#uniform.md), [varying](index.html#varying.md)
|
@ -0,0 +1,16 @@
|
|||||||
|
## DFdx
|
||||||
|
Return the partial derivative of an argument with respect to x
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
genType dFdx(float x);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
```p``` specifies the expression of which to take the partial derivative.
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Available only in the fragment shader, ```dFdx``` return the partial derivative of expression ```p``` in ```x```. Deviatives are calculated using local differencing. Expressions that imply higher order derivatives such as ```dFdx(dFdx(n))``` have undefined results, as do mixed-order derivatives such as ```dFdx(dFdy(n))```. It is assumed that the expression ```p``` is continuous and therefore, expressions evaluated via non-uniform control flow may be undefined.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[dFdy()](index.html#dFdy.md)
|
@ -0,0 +1,16 @@
|
|||||||
|
## DFdy
|
||||||
|
Return the partial derivative of an argument with respect to y
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
genType dFdy(float y);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
```p``` specifies the expression of which to take the partial derivative.
|
||||||
|
|
||||||
|
### Description
|
||||||
|
Available only in the fragment shader, ```dFdy``` return the partial derivative of expression ```p``` in ```y```. Deviatives are calculated using local differencing. Expressions that imply higher order derivatives such as ```dFdy(dFdy(n))``` have undefined results, as do mixed-order derivatives such as ```dFdy(dFdx(n))```. It is assumed that the expression ```p``` is continuous and therefore, expressions evaluated via non-uniform control flow may be undefined.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[dFdx()](index.html#dFdx.md)
|
@ -0,0 +1,15 @@
|
|||||||
|
## Float
|
||||||
|
Floating-point variable type
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
float aFloat = 1.0;
|
||||||
|
float bFloat = float(aBool);
|
||||||
|
float cFloat = float(aInt);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```float``` is used for floating point values.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[void](index.html#void.md), [bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [struct](index.html#struct.md)
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_FragColor
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## G_FragCoord
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_FrontFacing
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxCombinedTextureImages
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxDrawBuffers
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxFragmentUniformVectors
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxTextureImageUnits
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxVaryingVectors
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxVertexAttrbis
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_MaxVertexTextureImageUnits
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_PointCoord
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_PointSize
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Gl_Position
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Highp
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## In
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Inout
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,15 @@
|
|||||||
|
## Int
|
||||||
|
Integer data type
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
int aInt = 42;
|
||||||
|
int bInt = int(aBool);
|
||||||
|
int cInt = int(aFloat);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```int``` is used for integer values.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[void](index.html#void.md), [bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md)
|
@ -0,0 +1,21 @@
|
|||||||
|
## Ivec2
|
||||||
|
2 dimentional integer vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
bvec2 aIvec2 = ivec2(1, 1);
|
||||||
|
bvec2 bIvec2 = ivec2(1);
|
||||||
|
|
||||||
|
bvec2 cIvec2 = ivec2(aIvec3);
|
||||||
|
bvec2 dIvec2 = ivec2(aIvec3.x, aIvec3.y);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```ivec2``` is a integer vectors with two components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,25 @@
|
|||||||
|
## Ivec3
|
||||||
|
3 dimentional integer vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec3 aIvec3 = ivec3(1, 1, 1);
|
||||||
|
vec3 bIvec3 = ivec3(1);
|
||||||
|
|
||||||
|
vec3 cIvec3 = ivec3(aIvec4);
|
||||||
|
vec3 dIvec3 = ivec3(aIvec4.x, aIvec4.y, aIvec4.z);
|
||||||
|
|
||||||
|
vec3 eIvec3 = ivec3(aIvec2, aInt);
|
||||||
|
vec3 fIvec3 = ivec3(aIvec2.x, aIvec2.y, aInt);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```ivec3``` is a integer vectors with three components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
- Providing a combination of vectors and/or scalars. The respective values are used to initialize the vector. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,21 @@
|
|||||||
|
## Ivec4
|
||||||
|
4 dimentional integer vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec4 aIvec4 = ivec4(1, 1, 1, 1);
|
||||||
|
vec4 bIvec4 = ivec4(1);
|
||||||
|
|
||||||
|
vec4 cIvec4 = ivec4(aIvec2, aInteger, aIvec3);
|
||||||
|
vec4 dIvec4 = ivec4(aIvec2.x, aIvec2.y, aInt, aIvec3.x);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```ivec4``` is a integer vectors with four components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a combination of vectors and/or scalars. The respective values are used to initialize the vector. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,9 @@
|
|||||||
|
## Lowp
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Main
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Mediump
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Out
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Precision
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Return
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## Sampler2D
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,9 @@
|
|||||||
|
## SamplerCube
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,20 @@
|
|||||||
|
## Struct
|
||||||
|
Structure variable type
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```glsl
|
||||||
|
struct matStruct {
|
||||||
|
vec4 ambientColor;
|
||||||
|
vec4 diffuseColor;
|
||||||
|
vec4 specularColor;
|
||||||
|
float specularExponent;
|
||||||
|
} newMaterial;
|
||||||
|
|
||||||
|
newMaterial = matStruct(vec4(0.1, 0.1, 0.1, 1.0),
|
||||||
|
vec4(1.0, 0.0, 0.0, 1.0),
|
||||||
|
vec4(0.7, 0.7, 0.7, 1.0),
|
||||||
|
50.0);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```struct``` declare a custom data structures based on standard types. A constructor for the structure with the same name is created automatically. The declaration of a variable (in this case "newMaterial") is optional.
|
@ -1,4 +1,10 @@
|
|||||||
## Uniform
|
## Uniform
|
||||||
|
|
||||||
### See
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
||||||
[Chapter 03: Uniforms](../05/)
|
[Chapter 03: Uniforms](../05/)
|
@ -0,0 +1,9 @@
|
|||||||
|
## Varying
|
||||||
|
|
||||||
|
### Declaration / Example
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
### See Also
|
@ -0,0 +1,21 @@
|
|||||||
|
## Vec2
|
||||||
|
2 dimentional float point vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec2 aVec2 = vec2(1.0, 1.0);
|
||||||
|
vec2 bVec2 = vec2(1.0);
|
||||||
|
|
||||||
|
vec2 cVec2 = vec2(aVec3);
|
||||||
|
vec2 dVec2 = vec2(aVec3.x, aVec3.y);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```vec2``` is a float point vectors with two components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,25 @@
|
|||||||
|
## Vec3
|
||||||
|
3 dimentional floating point vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec3 aVec3 = vec3(1.0, 1.0, 1.0);
|
||||||
|
vec3 bVec3 = vec3(1.0);
|
||||||
|
|
||||||
|
vec3 cVec3 = vec3(aVec4);
|
||||||
|
vec3 dVec3 = vec3(aVec4.x, aVec4.y, aVec4.z);
|
||||||
|
|
||||||
|
vec3 eVec3 = vec3(aVec2, aFloat);
|
||||||
|
vec3 fVec3 = vec3(aVec2.x, aVec2.y, aFloat);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bvec3``` is a floating point vectors with three components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a vector of higher dimension. The respective values are used to initialize the components.
|
||||||
|
- Providing a combination of vectors and/or scalars. The respective values are used to initialize the vector. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,21 @@
|
|||||||
|
## Vec4
|
||||||
|
4 dimentional floating point vector
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
vec4 aBvec4 = bvec4(true, true, true, true);
|
||||||
|
vec4 bBvec4 = bvec4(true);
|
||||||
|
|
||||||
|
vec4 cBvec4 = bvec4(aBvec2, aBool, aBvec3);
|
||||||
|
vec4 dBvec4 = bvec4(aBvec2.x, aBvec2.y, aBool, aBvec3.x);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```bvec4``` is a floating point vectors with four components. Can be initialize by:
|
||||||
|
|
||||||
|
- Providing a scalar value for each component.
|
||||||
|
- Providing one scalar value. This value is used for all components.
|
||||||
|
- Providing a combination of vectors and scalars. The respective values are used to initialize the components. The arguments of the constructor must have at least as many components as the vector that is initialized.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md), [bvec2](index.html#bvec2.md), [bvec3](index.html#bvec3.md), [bvec4](index.html#bvec4.md), [ivec2](index.html#ivec2.md), [ivec3](index.html#ivec3.md), [ivec4](index.html#ivec4.md), [vec2](index.html#vec2.md), [vec3](index.html#vec3.md), [vec4](index.html#vec4.md), [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [mat4](index.html#mat4.md)
|
@ -0,0 +1,14 @@
|
|||||||
|
## Void
|
||||||
|
|
||||||
|
### Declaration
|
||||||
|
```glsl
|
||||||
|
void main(void);
|
||||||
|
int aFunction(void);
|
||||||
|
void bFunction(float);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Description
|
||||||
|
```void``` is used when a function have no parameters or when a function does not return a value.
|
||||||
|
|
||||||
|
### See Also
|
||||||
|
[void](index.html#void.md), [bool](index.html#bool.md), [int](index.html#int.md), [float](index.html#float.md)
|