-
Notifications
You must be signed in to change notification settings - Fork 1
/
GLSL.mm
134 lines (132 loc) · 36.5 KB
/
GLSL.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<map version="1.0.0">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1423123300696" ID="ID_1556783607" MODIFIED="1423123340254" TEXT="GLSL">
<node CREATED="1423123604998" FOLDED="true" ID="ID_854808550" MODIFIED="1423123631150" POSITION="right" TEXT="built-ins">
<node CREATED="1423123392039" ID="ID_1782313463" MODIFIED="1423123624741" TEXT="trigonometry">
<node CREATED="1423123412340" ID="ID_190410749" MODIFIED="1423123416618" TEXT="radians"/>
<node CREATED="1423123416838" ID="ID_1574263112" MODIFIED="1423123420081" TEXT="degrees"/>
<node CREATED="1423123456717" ID="ID_866285339" MODIFIED="1423123461848" TEXT="sin"/>
<node CREATED="1423123462081" ID="ID_1718694732" MODIFIED="1423123462876" TEXT="cos"/>
<node CREATED="1423123464549" ID="ID_437772393" MODIFIED="1423123467040" TEXT="tan"/>
<node CREATED="1423123469359" ID="ID_103546553" MODIFIED="1423123471891" TEXT="asin"/>
<node CREATED="1423123472117" ID="ID_1074652458" MODIFIED="1423123473899" TEXT="acos"/>
<node CREATED="1423123474445" ID="ID_760926802" MODIFIED="1423123476951" TEXT="atan"/>
</node>
<node CREATED="1423123487355" ID="ID_684073701" MODIFIED="1423123624729" TEXT="calculus">
<node CREATED="1423123492619" ID="ID_1723795606" MODIFIED="1423123494193" TEXT="exp"/>
<node CREATED="1423123494436" ID="ID_188834889" MODIFIED="1423123496661" TEXT="log"/>
<node CREATED="1423123496896" ID="ID_566945939" MODIFIED="1423123499238" TEXT="exp2"/>
<node CREATED="1423123499496" ID="ID_1335508786" MODIFIED="1423123501561" TEXT="log2"/>
</node>
<node CREATED="1423123505212" ID="ID_1478028377" MODIFIED="1423123624723" TEXT="algebra">
<node CREATED="1423123519315" ID="ID_27869266" MODIFIED="1423123522078" TEXT="pow"/>
<node CREATED="1423123522293" ID="ID_172818479" MODIFIED="1423123525930" TEXT="sqrt"/>
<node CREATED="1423123526176" ID="ID_820620265" MODIFIED="1423123530637" TEXT="inversesqrt"/>
<node CREATED="1423123530881" ID="ID_174658039" MODIFIED="1423123530881" TEXT=""/>
</node>
<node CREATED="1423123532526" ID="ID_911401581" MODIFIED="1423123624714" TEXT="rounding">
<node CREATED="1423123535735" ID="ID_1030919626" MODIFIED="1423123539861" TEXT="floor"/>
<node CREATED="1423123540089" ID="ID_1023597530" MODIFIED="1423123542052" TEXT="ceil"/>
<node CREATED="1423123542395" ID="ID_848093570" MODIFIED="1423123543888" TEXT="fract"/>
<node CREATED="1423123546879" ID="ID_1716374373" MODIFIED="1423123548302" TEXT="mod"/>
<node CREATED="1423123548593" ID="ID_1450675922" MODIFIED="1423123550737" TEXT="step"/>
</node>
<node CREATED="1423123552274" ID="ID_1726888072" MODIFIED="1423123624707" TEXT="magnitude">
<node CREATED="1423123559396" ID="ID_359756914" MODIFIED="1423123561401" TEXT="abs"/>
<node CREATED="1423123561639" ID="ID_810032923" MODIFIED="1423123563831" TEXT="sign"/>
<node CREATED="1423123564054" ID="ID_1422698179" MODIFIED="1423123568341" TEXT="min"/>
<node CREATED="1423123568561" ID="ID_109934550" MODIFIED="1423123569155" TEXT="max"/>
<node CREATED="1423123569495" ID="ID_79469694" MODIFIED="1423123572685" TEXT="clamp"/>
</node>
<node CREATED="1423123588791" ID="ID_249016724" MODIFIED="1423123624698" TEXT="interpolation">
<node CREATED="1423123598652" ID="ID_995486571" MODIFIED="1423123600069" TEXT="mix"/>
</node>
</node>
<node CREATED="1423125004700" FOLDED="true" ID="ID_64325606" MODIFIED="1429836791990" POSITION="right" TEXT="data type">
<node CREATED="1423124994550" ID="ID_80429937" MODIFIED="1423125006179" TEXT="scalar">
<node CREATED="1423125000065" ID="ID_1417342547" MODIFIED="1423125002096" TEXT="float">
<node CREATED="1423123643043" ID="ID_1889523331" MODIFIED="1423125003036" TEXT="precision specifiers">
<node CREATED="1423123716010" FOLDED="true" ID="ID_1683285586" MODIFIED="1423123738684" TEXT="{low, medium,high}p float">
<node CREATED="1423123661548" ID="ID_1765367578" MODIFIED="1423123732438" TEXT="lowp"/>
<node CREATED="1423123664573" ID="ID_1640676644" MODIFIED="1423123732434" TEXT="mediump"/>
<node CREATED="1423123670387" ID="ID_1802720547" MODIFIED="1423123732425" TEXT="highp"/>
</node>
<node CREATED="1423123678685" ID="ID_769876718" MODIFIED="1423123696187" TEXT="precision highp float"/>
</node>
</node>
</node>
<node CREATED="1423125013371" ID="ID_1469658717" MODIFIED="1423125016289" TEXT="vector">
<node CREATED="1423125017190" ID="ID_1053643598" MODIFIED="1423125123908" TEXT="up to quadruple tuple"/>
<node CREATED="1423125124690" ID="ID_530761939" MODIFIED="1423125146779" TEXT="{b,i,}vec{2,3,4}">
<node CREATED="1423125148043" ID="ID_86969832" MODIFIED="1423125187943" TEXT="bvec2: 2-dimension boolean vector "/>
<node CREATED="1423125188395" ID="ID_970817206" MODIFIED="1423125204386" TEXT="ivec3: 3-dimension integer vector"/>
<node CREATED="1423125204645" ID="ID_1264782656" MODIFIED="1423125220763" TEXT="vect4: 4-dimension float vector"/>
<node CREATED="1423125233915" ID="ID_1754320165" MODIFIED="1423125253495" TEXT="{low, medium,high}p vect{2,3,4}"/>
<node CREATED="1423125283279" FOLDED="true" ID="ID_1818210968" MODIFIED="1423125347375" TEXT="examples">
<node CREATED="1423125292247" ID="ID_1245450820" MODIFIED="1423125292247">
<richcontent TYPE="NODE"><html>
<head>
</head>
<body>
<pre style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; font-weight: 200; text-indent: 0px; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; font-variant: normal; margin-right: 0px; padding-bottom: 0; letter-spacing: normal; background-image: null; text-transform: none; margin-left: 0px; margin-bottom: 0; border-left-width: 0px; color: rgb(255, 255, 255); text-align: start; background-attachment: scroll; font-size: 12px; border-top-style: none; font-style: normal; border-left-style: none; line-height: 18px; padding-right: 0; margin-top: 0px; border-top-color: border-color; word-spacing: 0px; border-top-width: 0px; font-family: Source Code Pro, monospace; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0; background-repeat: repeat; padding-left: 0"><font color="rgb(255, 226, 95)" size="12px" face="Source Code Pro, monospace"><code style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; font-weight: 200; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(255, 255, 255); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; font-family: Source Code Pro, monospace; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="lang-glsl"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(255, 226, 95); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-keyword">precision</span></code></font><code style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; font-weight: 200; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(255, 255, 255); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; font-family: Source Code Pro, monospace; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="lang-glsl"><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="Satisfies the minimum requirements above for the fragment language. Its range and precision has to be greater than or the same as provided by lowp and less than or the same as provided by highp." style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">mediump</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a single floating-point scalar" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">float</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">;
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//Declares a 3D medium precision floating point</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//vector with components (1,2,3)</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a three component floating-point vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">vec3</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> v(</font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">1.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">, </font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">2.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">, </font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">3.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">);
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//Create a low precision 2D vector with </span><span title="Returns true only if all components of x are true." style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: none; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">all</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//components set to 2</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="Range and precision that can be less than mediump, but still intended to represent all color values for any color channel." style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">lowp</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a two component floating-point vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">vec2</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> p = </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a two component floating-point vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">vec2</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">(</font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">2.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">);
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//Unpack first 3 components from v into q and</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//set last component to 1.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="Satisfies the minimum requirements for the vertex language described above. Optional in the fragment language." style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">highp</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a four component floating-point vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">vec4</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> q = </font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a four component floating-point vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">vec4</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">(v, </font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">1.0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">);
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//A 2D boolean vector with true and false</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//components</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a two component Boolean vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">bvec2</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> foo(</font><font size="12px" color="rgb(255, 110, 87)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(255, 110, 87); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-literal">true</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">, </font><font size="12px" color="rgb(255, 110, 87)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(255, 110, 87); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-literal">false</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">);
</font><font size="12px" color="rgb(170, 170, 170)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(170, 170, 170); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-comment">//A 3D integer vector with components 1,0,-1</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">
</font><font size="12px" color="rgb(255, 226, 95)" face="Source Code Pro, monospace"><span title="a three component integer vector" style="background-position: 0px 0px; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-left: 0px; margin-bottom: 0px; border-left-width: 0px; background-attachment: scroll; font-size: 12px; padding-right: 0px; margin-top: 0px; border-bottom-width: 1px; border-top-width: 0px; border-right-width: 0px; border-bottom-style: dotted; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="def">ivec3</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace"> q(</font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">1</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">,</font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">0</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">,-</font><font size="12px" color="rgb(88, 255, 139)" face="Source Code Pro, monospace"><span style="border-left-color: border-color; border-right-color: border-color; border-right-style: none; background-position: 0px 0px; border-bottom-color: border-color; vertical-align: baseline; margin-right: 0px; padding-bottom: 0px; background-image: null; margin-bottom: 0px; margin-left: 0px; border-left-width: 0px; color: rgb(88, 255, 139); background-attachment: scroll; border-top-style: none; font-size: 12px; border-left-style: none; padding-right: 0px; margin-top: 0px; border-top-color: border-color; border-top-width: 0px; border-bottom-width: 0px; border-bottom-style: none; border-right-width: 0px; padding-top: 0px; background-repeat: repeat; padding-left: 0px" class="hljs-number">1</span></font><font size="12px" color="rgb(255, 255, 255)" face="Source Code Pro, monospace">);</font></code></pre>
</body>
</html></richcontent>
</node>
</node>
<node CREATED="1423125350231" ID="ID_1312839230" MODIFIED="1423125372693" TEXT="access components of vectors">
<node CREATED="1423125658372" ID="ID_1732683048" MODIFIED="1423125659700" TEXT="Swizzle notation">
<node CREATED="1423125373638" FOLDED="true" ID="ID_58088357" MODIFIED="1423125660804" TEXT="1234,xyzw,rgba,stuv">
<node CREATED="1423125500611" MODIFIED="1423125500611" TEXT="First component of p = p.x = p.r = p.s = p[0]"/>
<node CREATED="1423125500613" MODIFIED="1423125500613" TEXT="Second component of p = p.y = p.g = p.t = p[1]"/>
<node CREATED="1423125500613" MODIFIED="1423125500613" TEXT="Third component of p = p.z = p.b = p.u = p[2]"/>
<node CREATED="1423125500614" MODIFIED="1423125500614" TEXT="Fourth component of p = p.w = p.a = p.v = p[3]"/>
<node CREATED="1423125643287" MODIFIED="1423125643287" TEXT="vec4 p = vec4(1, 2, 3, 4);"/>
<node CREATED="1423125643287" MODIFIED="1423125643287" TEXT="vec2 q = p.xy; //q = vec2(1, 2)"/>
<node CREATED="1423125643288" MODIFIED="1423125643288" TEXT="vec2 r = p.bgr; //r = vec3(3, 2, 1)"/>
<node CREATED="1423125643288" MODIFIED="1423125643288" TEXT="vec3 a = p.xxy; //a = vec3(1, 1, 2)"/>
</node>
</node>
<node CREATED="1423125678306" FOLDED="true" ID="ID_1860077779" MODIFIED="1423125772311" TEXT="Arithmetic operations">
<node CREATED="1423125761409" MODIFIED="1423125761409" TEXT="vec4 a = vec4(1, 2, 3, 4);"/>
<node CREATED="1423125761410" MODIFIED="1423125761410" TEXT="vec4 b = vec4(5, 6, 7, 8);"/>
<node CREATED="1423125761411" MODIFIED="1423125761411" TEXT="vec4 c = a + b; //c = vec4(6, 8, 10, 12);"/>
<node CREATED="1423125761412" MODIFIED="1423125761412" TEXT="vec4 d = a * 3.0; //d = vec4(3, 6, 9, 12);"/>
<node CREATED="1423125761414" MODIFIED="1423125761414" TEXT="vec4 e = a * b; //e = vec4(5, 12, 21, 32);"/>
</node>
<node CREATED="1423125779665" ID="ID_208360056" MODIFIED="1423125781003" TEXT="Geometric functions">
<node CREATED="1423125827674" ID="ID_611762483" MODIFIED="1423125828882" TEXT="length(p)"/>
<node CREATED="1423125829550" ID="ID_149667758" MODIFIED="1423125835562" TEXT="distance(a,b)"/>
<node CREATED="1423125835935" ID="ID_32390728" MODIFIED="1423125841451" TEXT="dot(a,b)"/>
<node CREATED="1423125844658" ID="ID_357033920" MODIFIED="1423125848517" TEXT="cross(a,b)"/>
<node CREATED="1423125858720" ID="ID_858628853" MODIFIED="1423125869831" TEXT="normalize(a)"/>
<node CREATED="1423125871098" ID="ID_540399878" MODIFIED="1423125889115" TEXT="faceforward(n,I,nr)"/>
<node CREATED="1423125889426" ID="ID_1612827591" MODIFIED="1423125892133" TEXT="reflect"/>
<node CREATED="1423125892532" ID="ID_357304134" MODIFIED="1423125900380" TEXT="refract(I,N,eta)"/>
</node>
</node>
</node>
</node>
</node>
<node CREATED="1423123741261" ID="ID_1043620038" MODIFIED="1423123746457" POSITION="right" TEXT="const"/>
<node CREATED="1423123760411" ID="ID_1609247497" MODIFIED="1423123761997" POSITION="right" TEXT="inout">
<node CREATED="1423123763280" ID="ID_114706768" MODIFIED="1423123764297" TEXT="in"/>
<node CREATED="1423123764520" ID="ID_1419978132" MODIFIED="1423123765159" TEXT="out"/>
<node CREATED="1423123765373" ID="ID_1200301071" MODIFIED="1423123767992" TEXT="inout"/>
<node CREATED="1423123777699" ID="ID_1379434941" MODIFIED="1423123778554" TEXT="const"/>
</node>
</node>
</map>