Camera does not account for .LocalTransparencyModifier

Expected behaviour:
When you’ve set a part to have a LocalTransparencyModifer value which is > 0, you’d expect the camera to pass through it like any other Translucent part.

Expected picture

image

Actual Behaviour:
The camera treats the part like an opaque part and will auto-zoom when looking through it.

Actual picture

Can be reproduced, just add a part to a baseplate and a LocalScript in StarterPlayerScripts with the following line:
workspace.Part.LocalTransparencyModifier = 0.5

Now play the game in Studio or an actual server and notice the camera treats the part incorrectly.

4 Likes

Will fix, thanks for the report.

4 Likes

LocalTransparencyModifier is rarely used as a transparency modifier outside of fading the player’s character away in first-person mode. It shouldn’t come as a surprise that it was overlooked in the PopperCam script.

It took me a while to learn of the property’s existence, so I think it’s overlooked in general.

Indeed, it is well overlooked, but Roblox engineers do like to make sure that behavior remains consistent even when using overlooked properties.

1 Like

For posterity, you can calculate total transparency like this:

realTransparency = 1 - (1 - part.Transparency)*(1 - part.LocalTransparencyModifier)

I have a fix in review. It may be delayed a bit due to the client release schedule around the holidays.

5 Likes

On second thought. I had initially thought that it was averaged.

So here’s one attempt at a simpler equation. lol

part.Transparency + part.LocalTransparencyModifier * (1 - part.Transparency)

It might actually be slower though because it’s accessing a property twice, which requires indexing.

It’s harder to parse (for a human) than the original equation, too.

The form of the original equation makes sense when you think about it in terms of multiplying two opacities (alpha values).
1-transparency to convert to alphas, multiply, then 1-result to get back to a transparency value.

2 Likes