Skip to content

Conversation

@tychedelia
Copy link
Member

Allows setting the background clear color in a sketch.

Changes:

  • Adds a camera when spawning a window. Note that we also add a RenderLayers component, which we'll also need to attach to any geometry spawned to render in that window. This is just hygiene for eventual multi-window apps.
  • Adds a simple Color FFI struct. We'll likely want to make this more complicated later or support all the color spaces that bevy does (even if processing doesn't). But this demonstrates how to do allocations on the Java side.

I didn't implement the PImage override here as that will require the actual renderer (i.e. not just a clear color). It's also possible the semantics here are wrong. I think processing may allow you to clear multiple times in a frame, which means drawing a fullscreen quad not setting the render pass clear. But we can follow up with that once more rendering infra is implemented.

@tychedelia tychedelia changed the base branch from main to the-wgpu-moment October 27, 2025 21:02
@catilac
Copy link
Collaborator

catilac commented Nov 7, 2025

Hi! What is a good way to test this?

@tychedelia
Copy link
Member Author

Hi! What is a good way to test this?

You can create a sketch that sets the background color (:

Copy link
Collaborator

@catilac catilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works! and noted on the multiple clear calls.

@catilac catilac merged commit 89f8a65 into processing:the-wgpu-moment Nov 10, 2025
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.

2 participants