Skip to content

Conversation

@dli7319
Copy link
Collaborator

@dli7319 dli7319 commented Oct 15, 2025

The ScreenshotSynthesizer creates dataurls of the current viewport in order to sent to Gemini in demos like Gemini Icebreakers.

Previously, we would take the existing render texture and get a dataurl from it. This is slow and takes up a bunch of memory because the full viewport resolution can be very large. So instead we should get a smaller resolution to save on encoding time and memory usage. On Quest 3, we can't seem to reuse the render target as a texture so I'm now doing an actual render pass of the main scene into a new render texture.

This PR also fixes an issue where the image we were sending to Gemini was very dark.

Example image from quest 3:
download (1)

Performance before, where toDataURL would take 100-300 ms on Quest 3
Screenshot 2025-10-15 at 2 19 07 PM
Screenshot 2025-10-15 at 2 18 58 PM

Performance after on Quest 3:
Screenshot 2025-10-15 at 2 17 03 PM
Screenshot 2025-10-15 at 2 17 07 PM

Tested on Quest 3, desktop simulator, and Moohan.

@ruofeidu ruofeidu self-assigned this Oct 15, 2025
@dli7319 dli7319 merged commit b870236 into main Oct 15, 2025
1 check passed
@dli7319 dli7319 deleted the ai_memory_usage branch October 15, 2025 21:40
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