Objects inside ViewportFrames have colored borders when BackgroundTransparency is 1, causing poor visuals

Reproduction Steps
Reproduction place: viewportbug2.rbxl (35.0 KB)

When changing background color, you can see that the border of the part is changing color, even though the BackgroundTransparency of the ViewportFrame is 1
viewportbug2

It gets more egregious when the part itself has more transparency:
viewportbug3

Expected Behavior
The part should look the same no-matter the BackgroundColor of the ViewportFrame when BackgroundTransparency is 1

Actual Behavior
BackgroundColor creates a border around objects within a ViewportFrame when the object is opaque.
The entire part turns into the BackgroundColor when transparent, which makes transparency in ViewportFrames especially difficult.

Issue Area: Engine
Issue Type: Display
Impact: High
Frequency: Constantly

3 Likes

Woops, the title has a typo, it should instead say:
‘Objects inside ViewportFrames have colored borders when BackgroundTransparency is 1, causing poor visuals’
Sorry about that!~

Thank you Hooksmith for changing the title :slight_smile:

2 Likes

This has been an issue for a long time, I wasnt aware of the problem with part transparency though.

You should probably use ViewportFrame.ImageTransparency instead of Part.Transparency if possible

1 Like

That’s a good workaround for some use cases, although it wouldn’t work for ours

We’ve been trying to upgrade our UI by using ViewportFrames for certain elements, but the ugly borders demonstrated by the first GIF completely prevent us from moving forward with our upgrades

1 Like

Hello. Thanks for the report. Filed an internal ticket.

2 Likes

As a bump, viewport background color also affects any decal with an opacity less than 100%, when the part it is parented to is transparent, even when the background transparency of the viewport frame is 1

(I don’t know if this should be a new post or not)

We’ve recently toggled on a change that correctly takes the background transparency into account when computing viewport frame background color.

2 Likes

Thank you for this, the colored outlines and coloring of transparent parts seems to behave better now with BackgroundTransparency set to 1.

However, there seems to be some other issues potentially caused by the new change.
The first issue is the fact that ViewportFrames darken when BackgroundTransparency is increased. Same goes for parts (or decal in the bug report OP’s case) when their transparency is increased.
The second issue is the black outline present in ViewportFrames with BackgroundTransparency higher than 0.

A roundabout fix for these issues is to add a 0 alpha mesh (neon, (127, 127, 127) color), which erases the whole background of the ViewportFrame.
Funnily enough, it behaves in the same way as the bug reported in this very post. The color of the 0 alpha mesh determines the outline color and color of transparent parts.

(left 0 alpha mesh ViewportFrame, right regular ViewportFrame)

Model: ViewportFrame_Bug_Roundabout_Fix1.rbxm (17.6 KB)

3 Likes

I’ll reopen this one. We need to fix the background color issue as well.

3 Likes

Okay, trying again with a new flag. I’ve rolled it out to Studio only at this point. This should correctly render without the black outline.

Please give it a try and let me know if it works for you.

1 Like

Seems to work great now for me at least :+1:

Just a small nitpick is that transparent glass darkens when BackgroundTransparency increases. Previously it was tinted based on the BackgroundColor3 and BackgroundTransparency had no effect on it.

Although imo it’s not that big a deal as it has a fairly easy fix (if anyone even relies on that aspect of transparent glass in ViewportFrames)

Hello, after this flag was pushed it has once again caused the viewport background color bug to re appear. Breaking some visual effects on our experiences. From what we understand this background transparency “effect” was an intended feature: Viewport frames background colour influences decal's colour

Bug: FFlagPremultiplyViewportframeBackgroundColor causes viewport background color to render incorrectly

2 Likes

Okay, sorry about the trouble. We’ll roll it back now. (It is only on for Studio now so it should not impact experiences).

Unfortunately that means we likely cannot fix this bug without doing a larger migration.

1 Like

After more discussion internally we’ve decided to close this feature as working as intended, due to the large number of experiences relying on the current functionality. We appreciate your understanding.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.