ViewportFrame Release


#269

I don’t think that’s really possible due to SurfaceGUIs not conforming to their surface like decals & textures sadly.


#270

I’m not really experienced with this stuff, but I’m thinking that’s some sort of 3D object masking a GUI image…


#271

Anyone have an efficient way of saving the “Frame” of a viewport frame? For example, a camera system that allows you to take a photo of what you’re looking at. Is there a way to save that frame that’s being rendered in the viewport frame? Sorry for a bad explanation, it’s hard to explain.


#272

Not necessarily a GUI that is being masked, but you are definitely correct about the masking. One possible implementation would be fetching a color from a texture based on screen space coordinates in a fragment (pixel) shader as the 3D object is being drawn. Using a GUI for that would just add an extra step. This kind of implementation would require direct access to the underlying graphics pipeline though.


@MrAsync You can clone all of the objects inside of the viewport of a camera as well as the camera’s CFrame at the time of the snapshot. To display the image you just need to make a new ViewportFrame that contains all of the scenery (or just store the clones there from the start) and make a copy of the camera with the captured CFrame.


#273

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.


#274

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!


#275

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

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.


#277

This post was flagged by the community and is temporarily hidden.


#278

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


#279

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


#280

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


#281

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.


#284

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.


#285

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).


#286

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.


#287

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.


#288

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)


#290

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!


#291

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…


#292

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.