You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* You can call <a href="#/p5.Shader/modify">`colorShader().modify()`</a>
1180
1180
* and change any of the following hooks:
1181
1181
*
1182
-
* - `void beforeVertex`
1183
-
* - Called at the start of the vertex shader.
1184
-
* - `vec3 getLocalPosition`
1185
-
* - Update the position of vertices before transforms are applied. It takes in `vec3 position` and must return a modified version.
1186
-
* - `vec3 getWorldPosition`
1187
-
* - Update the position of vertices after transforms are applied. It takes in `vec3 position` and pust return a modified version.
1188
-
* - `vec3 getLocalNormal`
1189
-
* - Update the normal before transforms are applied. It takes in `vec3 normal` and must return a modified version.
1190
-
* - `vec3 getWorldNormal`
1191
-
* - Update the normal after transforms are applied. It takes in `vec3 normal` and must return a modified version.
1192
-
* - `vec2 getUV`
1193
-
* - Update the texture coordinates. It takes in `vec2 uv` and must return a modified version.
1194
-
* - `vec4 getVertexColor`
1195
-
* - Update the color of each vertex. It takes in a `vec4 color` and must return a modified version.
1196
-
* - `void afterVertex`
1197
-
* - Called at the end of the vertex shader.
1198
-
* - `void beforeFragment`
1199
-
* - Called at the start of the fragment shader.
1200
-
* - `vec4 getFinalColor`
1201
-
* - Update the final color after mixing. It takes in a `vec4 color` and must return a modified version.
1202
-
* - `void afterFragment`
1203
-
* - Called at the end of the fragment shader.
1182
+
* Hook | Description
1183
+
* -------|-------------
1184
+
* `void beforeVertex` | Called at the start of the vertex shader.
1185
+
* `vec3 getLocalPosition` | Update the position of vertices before transforms are applied. It takes in `vec3 position` and must return a modified version.
1186
+
* `vec3 getWorldPosition` | Update the position of vertices after transforms are applied. It takes in `vec3 position` and pust return a modified version.
1187
+
* `vec3 getLocalNormal` | Update the normal before transforms are applied. It takes in `vec3 normal` and must return a modified version.
1188
+
* `vec3 getWorldNormal` | Update the normal after transforms are applied. It takes in `vec3 normal` and must return a modified version.
1189
+
* `vec2 getUV` | Update the texture coordinates. It takes in `vec2 uv` and must return a modified version.
1190
+
* `vec4 getVertexColor` | Update the color of each vertex. It takes in a `vec4 color` and must return a modified version.
1191
+
* `void afterVertex` | Called at the end of the vertex shader.
1192
+
* `void beforeFragment` | Called at the start of the fragment shader.
1193
+
* `vec4 getFinalColor` | Update the final color after mixing. It takes in a `vec4 color` and must return a modified version.
1194
+
* `void afterFragment` | Called at the end of the fragment shader.
1204
1195
*
1205
1196
* Most of the time, you will need to write your hooks in GLSL ES version 300. If you
1206
1197
* are using WebGL 1 instead of 2, write your hooks in GLSL ES 100 instead.
0 commit comments