Skip to content

Add transparent MOAP background and click pass-through support#6015

Open
shadoskill wants to merge 2 commits into
secondlife:developfrom
shadoskill:MOAP
Open

Add transparent MOAP background and click pass-through support#6015
shadoskill wants to merge 2 commits into
secondlife:developfrom
shadoskill:MOAP

Conversation

@shadoskill

@shadoskill shadoskill commented Jul 17, 2026

Copy link
Copy Markdown

Description

This allows for media-on-a-prim to have its background fully transparent if the website sets it via CSS.
This also allow click pass-through to in world objects if clicking a fully transparent area on the moap.


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • The PR is linked to a relevant issue with sufficient context.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Video of the feature and link to basic test page used in the video.

https://fullarray-dev.emptylist.co/moap_test.html

PowerToys_QwooSaIhZr.mp4

@github-actions github-actions Bot added the c/cpp label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@shadoskill

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables alpha-aware rendering for Media-On-A-Prim (MOAP) so web content can display with a truly transparent background, and updates picking/click handling so mouse events can pass through fully transparent media pixels to in-world objects behind.

Changes:

  • Treat RGBA media textures as alpha in the render pipeline so transparency is respected.
  • Add per-pixel transparency sampling for media textures (mask/pick support) via LLViewerMediaImpl::isTransparentAt().
  • Update pie tool click/hover handling to defer to the visible pick when the media pixel is fully transparent; update CEF plugin defaults for RGBA/transparent background.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
indra/newview/pipeline.cpp Routes RGBA textures (including media) into alpha rendering when appropriate.
indra/newview/llviewertexture.h Declares media-texture pick mask override to support transparency-aware picking.
indra/newview/llviewertexture.cpp Implements media-texture getMask() by sampling the live media buffer.
indra/newview/llviewermedia.h Adds isTransparentAt() API for per-pixel alpha testing at UV coords.
indra/newview/llviewermedia.cpp Implements per-pixel alpha sampling and clears media placeholder with transparent alpha.
indra/newview/lltoolpie.cpp Adds click/hover pass-through logic when the hit media pixel is fully transparent.
indra/media_plugins/cef/media_plugin_cef.cpp Switches embedded CEF background/format to preserve alpha (RGBA/transparent).
indra/llrender/llgltexture.h Makes getMask() virtual to allow media textures to override pick masking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 652 to 656
// SL-15560: Product team overruled my change to set the default
// embedded background color to match the floater background
// and set it to white
settings.background_color = 0xffffffff; // white
settings.background_color = 0x00000000; // transparent

@akleshchev

akleshchev commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This is likely to affect existing content, may be even render some content unreadable due to matching color of the background. I wonder if we can get some form of 'respect transparent background' checkbox to work on per-face basis. It should be trivial viewer side to store the value in LLMediaEntry, but server might will need to support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants