Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency Issues #85

Open
KnightOwl-Git opened this issue Jan 10, 2025 · 6 comments
Open

Transparency Issues #85

KnightOwl-Git opened this issue Jan 10, 2025 · 6 comments

Comments

@KnightOwl-Git
Copy link

I noticed some slight transparency issues when using the new widget components (which are awesome by the way!!)

Blending from a color to full transparency has this muddy in-between color. The yellow background here is the camera background in Unity.

Screenshot 2025-01-10 at 11 46 56 AM

For comparison, here's what it looks like when the yellow background is within the rive file itself:
Screenshot 2025-01-10 at 11 49 42 AM

In addition, there's a slight dark outline around rive graphics with alpha transparency, most visible with a bright object against a bright background. My guess is that this is the same problem as the above interacting with the anti-aliasing.

Screenshot 2025-01-10 at 11 47 00 AM
@damzobridge
Copy link
Contributor

Thanks for reporting this, we're looking into it internally!

It sounds like the same issue mentioned here. There's a workaround in that thread that you could try in the meantime for the dark outline.

@KnightOwl-Git
Copy link
Author

Thanks! Is there any way to apply that legacy shader to the rive canvas object material through a script? Or would I need to render to a texture and then display it manually?

@damzobridge
Copy link
Contributor

For now, you can create a material that uses the legacy shader, then use GetComponent on the RivePanel to get the CanvasRendererRawImage and apply it directly there.

397652957-56784649-6e91-436d-80ef-65fcf7d998da

We're going to expose a way to pass in materials directly in an upcoming release.

@KnightOwl-Git
Copy link
Author

When I try running this script, I get an error saying "CanvasRendererRawImage" is inaccessible due to its protection level.

Screenshot 2025-01-11 at 1 26 39 PM Screenshot 2025-01-11 at 1 27 22 PM

Sorry if I'm missing something obvious, I'm new to Unity!

@damzobridge
Copy link
Contributor

No worries! If you do transform.GetComponent<RawImage>() instead, does that work for you?

@KnightOwl-Git
Copy link
Author

That works, thanks so much! I see now that the transparency issue has to do with pre-multiplied alpha vs straight alpha (same as the current unreal runtime build)

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

No branches or pull requests

2 participants