CameraView Frame

One of the coolest features in Roblox is definitely the ViewPort Frame (VPF for short) which allows us to render 3D objects onto 2D UI, allowing for new possibilities in the platform… But it is outdated.

No lights, no particles and some other stuff makes it obsolete and niche, it needs an upgrade but at this point updating it might be harder than doing something from scratch.

What use cases does the outdated state of the VPF makes hard/inconvenient/unpractical to implement:

Let’s see the use cases (there might be more use cases but these are the ones I can think of):

  • Immersive Security Cameras.
  • Scopes for guns.
  • View vehicles/items/buildings in inventory (or any other selection mechanisms) with good details before spawning them.
  • Portals.
  • Mirrors.
  • Fake windows.

They are all great use cases though VPF is kinda bad nowadays to be used on them for performance and graphically wise reasons, sure it is good for simpler stuff like holograms but if you want more detail and control VPF is not it.


Features the CameraView Frame will bring to the table:

The CameraView Frame (CVF for short) comes as a better version of the VPF with new features that will finally make rendering 3D objects into 2D UI great again.

Properties:

CVF.TargetScene :Instance

Determines the “world” to be rendered, it can be a Model, Folder or WorldModel. This enables the developer to render 3D objects without having to clone them and parent them under it. If set to nil it will act like the VPF, rendering it’s children.

CVF.AutoRender :boolean

If true the CVF will automatically render it’s assigned scene, if false then it will need script input to render the scene.

CVF.RenderFPS :Integer

Visible when .AutoRender is true, it determines the refresh rate of the CVF, allowing for developer optimization since it might not need to run at 60FPS all the time.

CVF.RenderLights :boolean

If true the CVF will render lights using the light technology set in game.Lighting.

CVF.RenderParticles :boolean

If true the CVF will render particles.

Methods:

CVF:Render()

If .AutoRender is false the developer can use this method to manually render, enabling optimization for use cases that don’t require constant updating.

CVF:SetRenderingArea(min:Vector2, max:Vector2)

Tells the CVF the camera’s screen area it should render, allowing for better implementation of things like scopes, mirrors, fake windows and portals where we only want to render a part of the camera’s view. By default it will render the camera’s whole view.


Conclusion/Final aspects:

With this new instance developers will finally be able to use the full potential of rendering a 3D scene onto GUI, note that the CVF isn’t meant to replace the VPF but instead act as a better option, so if developers don’t need the more complex CVF features they can simply stick to the more simple aspect of the VPF.

2 Likes