Skip to content

canvas: pictures of the program's, draws laid over by alpha, gpu.set_vec4 - #1105

Merged
paul-hammant merged 1 commit into
mainfrom
feat/canvas-pictures
Nov 27, 2026
Merged

paul-hammant merged 1 commit into
mainfrom
feat/canvas-pictures

Conversation

@paul-hammant

Copy link
Copy Markdown
Collaborator

Follows the program canvas (#1096) with what a larger canvas program needed.

  • engine_texture_new(e, w, h, rgba) / engine_texture_free: a picture the program has, its RGBA bytes as they are (no colour curve), each sample the one texel it falls in, repeating, no mips, so a map the program's own code samples is sampled the same on the GPU. Vulkan: vktexture.texture_create_picture; OpenGL: an RGBA8 texture, nearest and repeating.
  • canvas_draw takes over: bool: a draw laid over what is there by its pixel shader's alpha, queued after the opaque draws, furthest first, depth written. Through engine, gl, vulkan, vkframe and vkquote (program_pipeline(p, over, culled)).
  • gpu.set_vec4, as set_vec3.
  • platform.window_set_size, window_x, window_y.
  • ae3d.batch (ae3d.batch: a frame in one buffer from a host (three.js on sae), MeshNormalMaterial as a quoted pair #1102) passes over = false; examples/canvas.ae updated for the new argument; docs/canvas.md and the change fragment.

API change: engine_canvas_draw / renderer_canvas_draw gain over before textures. Every caller in the tree is updated.

Checked on the x86_64 Linux lane (ae 0.946.0, llvmpipe): every build warning-free; test_batch, test_backend_parity, test_batching all checks passed; examples/canvas ran 60 frames on OpenGL and on Vulkan.

Not yet here: a suite of its own for the picture texture's sampling and for over's blending and ordering: the canvas example exercises them but asserts nothing about them. Happy to add one if you want it before merge.

🤖 Generated with Claude Code

…vec4

- engine_texture_new / engine_texture_free: an RGBA picture the program
  has, its bytes as they are, nearest and repeating, no mips
  (vktexture.texture_create_picture; an RGBA8 texture on OpenGL).
- canvas_draw takes `over`: a draw blended by its pixel shader's alpha,
  queued after the opaque ones, furthest first.
- gpu.set_vec4, as set_vec3.
- platform.window_set_size, window_x, window_y.
- ae3d.batch passes over=false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paul-hammant
paul-hammant merged commit 0469917 into main Nov 27, 2026
10 checks passed
@paul-hammant
paul-hammant deleted the feat/canvas-pictures branch November 27, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant