ViewportFrame Release

Nope. You need to store the objects you want to render under the ViewportFrame, and there’s no way around that. ViewportFrames probably wouldn’t fit your use case.

I’m so glad to finally be able to use this on the Roblox Player!
I’m implementing it in some sort of avatar editor, and I have to say it’s a great feature!

9 Likes

I’ve finally made my TARDIS bigger on the inside!

https://twitter.com/dragonfrosting/status/1090479513551527936

It’s entirely based on a SurfaceGui which is able to move with the exterior. The only issue with it is that if the camera is too far to the sides, the ViewportFrame is unable to cover the portal and it appears blank.

9 Likes

I programmed a camera that creates images during a roller coaster ride :slight_smile:

Once the train reaches a position, a photo is taken.

Before

image

After

69 Likes

I love this feature and find it very useful, but does it work with SurfaceGui? I have tried a lot of things to have it work in my game, but it won’t show me anything

You have to parent the SurfaceGui to PlayerGui/StarterGui and then set the Adornee to the part.

2 Likes

It works with surfaceGuis but you need to parent the SurfaceGui to starterGui and set the SurfaceGui’s adornee to the part you want it to render on.

2 Likes

Anyone willing to show how to display a model in a viewpoint frame that you could right click on to rotate the model around and use the mouse wheel to zoom in etc?

Thought this was on the viewport farme by default, but it clearly has to be programmed manually.

If there is not already an open source library available, I would recommend scripting it yourself and asking in #development-support:scripting-support with specific questions when you get stuck (don’t ask for full code snippets without attempting things yourself first).

3 Likes

You should able to create temporary photos. Take everything you want your photo to include and put it into a model + Add a CFrameValue for the camera location. Parent the model for example to the ServerStorage. Now if you want to see that photo, you just provide the model and pass it to a ViewportFrame and create a camera using the CFrameValue.

Being able to save photos to a Datastore might be slightly more difficult, but with some HumanoidDescription shenanigans it could work out.

A question to devs about performance - if nothing changes inside the viewportframe do you skip rerendering the texture internally? This would be an amazing optimization for things like generating icons.

According to this reply from staff, yes, ViewportFrame objects only render when something has changed. Using it for icons might even be preferrable to premade images in some cases (shorter load time)

4 Likes

If I wanted to use the same environment between seperate viewport frames, is there any method I could use to have them all display said environment? Or am I stuck with cloning everything into each seperate VPF?
If so, I’ve got a handful of use-cases for this!

I’m pretty sure you’re stuck with cloning everything into the individual VPFs. I wish VPFs had an adornee like property instead of the current behavior. Then all you’d have to do is set the adornee property to workspace and it would render all of workspace…

After messing around with ViewportFrames I came to a very important conclusion: You can get around rotated images not being clipped by GUIs.

In practice:
Let’s say there’s a minimap/radar/etc. that rotates with the player. Normally you can’t use images like this with rotation because it doesn’t get clipped. With ViewportFrames, this is no longer a problem, and you can make proper minimap images that rotate with the player.

34 Likes

Whilst working on a game, i’ve noticed a very minor yet annoying white outline around any model placed inside of a ViewportFrame.

Not sure if this has been addressed already, but if there is any kind of workaround, i’d love to know!

Yet again, this is a very minor flaw but I find it slightly degrades the quality of my game.

1 Like

That outline is due to antialiasing. It’s always the same color as the BackgroudColor3 property of the ViewportFrame. There’s no workaround.

Try your best to match the BackgroundColor3 property of the ViewportFrame with the color of its background or to the color of its contents to hide the outline.

2 Likes

Try getting around this with an extremely low field of view camera at a distance. This seems to compress out or totally remove a large majority of the antialiasing. You’ll also want to make sure that the viewportframe isn’t too big, IIRC the maximum resolution was something like 1024x1024…?

1 Like

That’s just an optical illusion - Mind you, a non orthographic camera will show depth rather obviously when used like this.

A post was merged into an existing topic: Featuring early adopters of Roblox technology

1 Like