guides:gpu
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| guides:gpu [2024/05/31 22:38] – osnr | guides:gpu [2025/12/26 14:18] (current) – osnr | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== GPU FFI ====== | ||
| + | |||
| The new 'GPU FFI' lets you write vertex and fragment shaders to draw things. | The new 'GPU FFI' lets you write vertex and fragment shaders to draw things. | ||
| Line 32: | Line 34: | ||
| You can make '' | You can make '' | ||
| - | ==== TODO: Document internal Gpu:: API ==== | + | ====== Adding functions ====== |
| - | These must be called on the display thread: '' | + | When you want to use functions, maybe to [[https:// |
| + | |||
| + | < | ||
| + | # source: https:// | ||
| + | # cosine based palette, 4 vec3 params | ||
| + | Wish the GPU compiles function " | ||
| + | return a + b*cos( 6.28318*(c*t+d) ); | ||
| + | }} | ||
| + | |||
| + | Wish the GPU compiles | ||
| + | {vec2 p0 vec2 p1 vec2 p2 float u_time} { | ||
| + | vec2 vertices[4] = vec2[4](p0, p1, p2, p0); | ||
| + | return vertices[gl_VertexIndex]; | ||
| + | } {fn palette} { | ||
| + | vec3 gradientColor = palette(gl_FragCoord.x, | ||
| + | return vec4(gradientColor, | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Wish $this is outlined blue | ||
| + | When $this has region /r/ & the clock time is /t/ { | ||
| + | set r' [region move $r down 100%] | ||
| + | Wish the GPU draws pipeline "$this's triangle" | ||
| + | }</ | ||
| ---- | ---- | ||
guides/gpu.1717195091.txt.gz · Last modified: by osnr
