Add transparent MOAP background and click pass-through support#6015
Add transparent MOAP background and click pass-through support#6015shadoskill wants to merge 2 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
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.
| // 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 | ||
|
|
|
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. |
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:
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