ViewportFrame Light Properties Release

LightColor, LightDirection and Ambient, three new properties of ViewportFrame are released today!
With these properties, an ambient light value and a directional light can be set up easily.
At the same time the lighting mode of ViewportFrame was changed. So be aware that it will look a little different.

151 Likes

FINALLY! We can now make viewport frames look even better. Before, the lighting felt weird and off. Now, viewport frames can be used for so much more. Animations involving light can be made, infinite possibilities are made possible with this update. If a viewport frame looks too dark, you can make it brighter! Viewport frames will not look dull like hey used to, and weird lighting effects with them can be removed.

Many thanks to the team that made this possible.

12 Likes

Thank you so much! This is such a great addition, especially given the lighting ViewportFrames used to have, and now I can make my shop UI look even better! I also like the touch that you’ve given us control over light settings as well, so I’m hoping I can apply this well in the near future.

Thanks guys!

2 Likes

This is amazing!
Now our item previews in viewports look almost exactly the same as in game :smiley:

Taking it a step further, though… Will we ever have control over post effects in ViewportFrames? The only thing in a ViewportFrame now that still does not match the regular lighting is saturation and contrast. And to some extent, brightness, but very much less so now.

5 Likes

Here’s a quick little demo I threw together for it. Great work on this feature!

39 Likes

Time for yet another open source ViewportFrame project!

I’m really happy this feature is out! Can’t wait to see what’s next!

*Edit: It’ll have to wait because I really gotta stop being sidetracked from Lua Learning

8 Likes

Awesome feature! We can finally control exactly how rendered objects look inside viewportframes.
Any plans for rendering particles in viewports?

4 Likes

Thank you SO MUCH! I am honestly so hyped about this new feature, and I’m so glad to see that you’re still improving it! Many possibilities here, very interesting, thank you! :grinning:

1 Like

Thanks so much for posting that. ViewportFrames are really production-quality now.

It also looks like they are much less aliased in that video. Is that the case?

1 Like

Aliasing is still a problem that exists. However, I found that the color of the aliasing is controlled by the BackgroundColor3 value of the ViewportFrame. Setting it to black seems to help a lot with masking out the aliasing, though I’m hoping this’ll be addresssed more formally in the near future.

6 Likes

What do the default lighting properties look like? I’m not able to get to studio for awhile.

@programeow I noticed that these recent changes made the aliasing around ViewportFrame content much worse:

The white outlines around the frames have gotten sharper and more noticeable, making it harder to use ViewportFrames against anything that’s not a white background.

Are there any plans to address this?

13 Likes

Excited to experiment with this. Thanks for another great feature! :clap:t2:

Have also been experiencing this ^

This is amazing! Before the feature was added we really could not do much with the ViewportFrames other than display assets using it. Now we have more room to play with how the model looks by changing the lighting properties! I made a side by side comparison of the model in workspace and in the ViewportFrame. The only thing I see being different is the shine on the parts from the sun and the color still being off a little. But the color being off can most likely be improved by playing around with the lighting. Otherwise, everything else is great! (Ignoring the aliasing issue of course.) :smile:

2 Likes

One way to combat those outlines is to set the BackgroundColor3 to black. The lines will still be there, but black lines are less noticeable than white lines.

Left is black, right is white.
image

7 Likes

I love you. Thank you so much

image

9 Likes

No problem! “that viewportframe guy” at your service!

9 Likes

Thanks for the feedback. I found a bug while rendering backgournd color, which makes the aliasing worse. A fix will be released next week.
The outline is caused by blending with surrounding transparent pixels. I can’t completely fix it now. The workaround is to change background color to a less obvious color or make background opaque.

11 Likes

Great update, however I’ve noticed that objects with a high reflectance will look over saturated and funky because the lighting is reflecting off of it.
Here’s an example:

Original item


Item in viewport frame
goldenwall2

Before the update, this wasn’t an issue and all the items looked normal. A way to disable the lighting for viewport frames might be useful.

2 Likes