Introduction
Client-sided engine that renders models as a background in a ViewportFrame attached to the player’s camera. Use it to make stunning background effects that native Roblox can’t make. Like non-euclidean backgrounds, make an empty looking map a great look, confuse people etc.
Features
- Relative camera position (moves with camera relatively using
multiplier. Can also be used to lock movement on camera on any axis) - Make models gigantic using camera movement to remove the 2048 size limit.
- Seperate camera effects like FOV (the viewport has its own camera which can be customized seperately than the main camera)
- Advanced effects like border, always on top, gradient etc.
- ViewportFrame Masking
Better to show than describe:
More Info
Pros and Cons: Native Roblox
Pros
- Realistic and Best quality
Cons
- Size limit
- Hard to position
- Lack of effects
Pros and Cons: HyperBox
Pros
- Axis lock
- Easy to position and apply
- Advanced effects
- Always on top or behind everything (depends on distance for behind)
- Separate camera effects
Cons
- Viewport Frame limitations (i.e. no shadows, lighting effects, low quality etc)
- Magnifying effect using camera position decreases as the multiplier gets lower.
Tutorial
This tutorial walks through installing the module, adding models, wiring simple UI, and tips for performance and debugging.
Installation
- Put
HyperBoxas a ModuleScript inReplicatedStorage. - Make sure the module’s
HyperBackgroundtemplate (aBillboardGuicontaining aViewportFrame) is present under the module asscript.HyperBackgroundso the module can clone it for each player. - Create the models you want to render as backgrounds in
workspace(or load them fromReplicatedStorage) — e.g.Rig,Pillers,Ring,Cubes,Fractal. Make sure ther havePersistantstreaming mode.
Basic client script (example)
Below is the full example LocalScript that demonstrates this model (in showcase game)
local hyperbox = require(game.ReplicatedStorage.HyperBox)
local player = game.Players.LocalPlayer
local runService = game:GetService("RunService")
local anim = script.Animation
local ui = player.PlayerGui:WaitForChild("ScreenGui").Frame.ScrollingFrame
hyperbox.Initialize() -- Creates necessary objects such as the camera
-- Cloning models, adding them to a table and returning them
local dummy = hyperbox.AddModel(workspace:WaitForChild("Rig"))
local pillers = hyperbox.AddModel(workspace:WaitForChild("Pillers"))
local saturn = hyperbox.AddModel(workspace:WaitForChild("Ring"))
local cubes = hyperbox.AddModel(workspace:WaitForChild("Cubes"))
local fractal = hyperbox.AddModel(workspace:WaitForChild("Fractal"))
local base = workspace.Baseplate
local functions = {}
-- pillers preset
table.insert(functions, function()
hyperbox.ClearActiveModels() -- clear already visible models
hyperbox.SetModelActive(pillers, true) -- Make this model visible (parent it to vpf directly)
hyperbox:ResetSettings() -- Reset settings to default
hyperbox.Origin = Vector3.zero -- set models origin to zero (when camera moves, it will move as cameraPosition - Origin * Multiplier).
-- This is to make it look like that the origin is the center of the world which models are positioned around
hyperbox.Brightness = 10000 -- Make the billboard gui bright (very)
hyperbox.Multiplier = Vector3.one * 0.0001 -- this will be used whe positioning the camera relative to the main camera
base.Transparency = 1 -- make baseplate invisible
hyperbox:UpdateSettings() -- update settings manually
end)
-- (other presets are in the example script from showcase)
-- simple rotation for visual interest
local partsRotation = {}
local fractalRotation = {}
for _, rig in dummy:GetChildren() do
local hum = rig:FindFirstChildOfClass("Humanoid")
if hum then
local track = hum:LoadAnimation(anim)
track.Looped = true
track:Play()
end
end
runService.RenderStepped:Connect(function()
hyperbox:Render() -- update billboard size, camera cframe etc
for _, part: BasePart in cubes:GetChildren() do
if not partsRotation[part] then
local x = math.random(-50, 50) * 0.01
local y = math.random(-50, 50) * 0.01
local z = math.random(-50, 50) * 0.01
local angle = Vector3.new(math.rad(x), math.rad(y), math.rad(z))
partsRotation[part] = angle
end
local angle = partsRotation[part]
part.CFrame = part.CFrame * CFrame.Angles(angle.X, angle.Y, angle.Z)
end
for _, part: Model in fractal:GetChildren() do
if not fractalRotation[part] then
local x = math.random(-50, 50) * 0.01
local y = math.random(-50, 50) * 0.01
local z = math.random(-50, 50) * 0.01
local angle = Vector3.new(math.rad(x), math.rad(y), math.rad(z))
fractalRotation[part] = angle
end
local angle = fractalRotation[part]
part:PivotTo(part.WorldPivot * CFrame.Angles(angle.X, angle.Y, angle.Z))
end
end)
How does it work?
It creates a BillboardGui in PlayerGui that is applied to an attachment created inside the camera during initialization. The billboard contains a ViewportFrame and creates a Camera on initialization. It also creates a WorldModel if UseWorldModel is true, like this:
The billboard and viewportframe can be accessed from HyperBox.Components and more UI effects such as UIGradient can be parented inside the viewportframe.
API quick reference
hyperbox.Initialize()— initializehyperbox.AddModel(model: Model, name: string?) -> Model— clones and registers a model. Returns the cloned model.hyperbox.RemoveModel(modelOrName)— remove from registry.hyperbox.GetModels()— returns table of registered models.hyperbox.GetActiveModels()— returns currently active models table.hyperbox.ClearActiveModels()— clears all active models (parents are set to nil)hyperbox.SetModelActive(modelOrName, active: boolean)— set a registered model to active/inactivehyperbox:ResetSettings()— resets module fields to defaultshyperbox:UpdateSettings(settings?)— push current module fields into the actualViewportFrame& camera (call after mutating settings)hyperbox:Render()— update and place viewport camera; call per-frame (RenderStepped/Heartbeat)
Settings you can tweak
Multiplier(Vector3) — multiplies the camera-to-origin vector before placing viewport camera. Small values move the viewport camera very little relative to the main camera; useful for parallax.Distance(number) —StudsOffsetfor the BillboardGuiBrightness,Ambient,LightColor,LightDirection,LightInfluence— lighting controlsTransparency,BackgroundTransparency,BackgroundColor,Color— how theViewportFramerendersFieldOfViewandSyncFOV— control viewport camera FOVUseWorldModel— when true, aWorldModelis created inside theViewportFrameand active models are parented into it.
Default Values
local API = {
Multiplier = Vector3.one * 0.01,
Origin = Vector3.zero,
Distance = -3000,
Brightness = 1,
LightInfluence = 0,
Transparency = 0,
BackgroundTransparency = 1,
FieldOfView = 70,
SyncFOV = true,
Color = Color3.new(1, 1, 1),
BackgroundColor = Color3.new(0, 0, 0),
BorderSize = 0,
Ambient = Color3.fromRGB(180, 180, 180),
LightColor = Color3.fromRGB(222, 222, 222),
LightDirection = Vector3.one * -1,
AlwaysOnTop = false,
BorderColor = Color3.new(0, 0, 0),
UseWorldModel = false,
Enabled = true
}
Performance
- Keep active models small (low part counts) —
ViewportFramerenders are costly when many parts are visible. - Avoid running heavy code inside
RenderSteppedbesideshyperbox:Render()and light transforms. UseHeartbeatif you want slightly relaxed timing or for non-UI scenes. WorldModelwithModelStreamingMode.Persistentis helpful for complex models but can increase memory usage.- Disable fog and atmostphere when the
Distanceis too far.
Troubleshooting
-
HyperBox needs to be initialized first. — you forgot to call
hyperbox.Initialize()beforeSetModelActive/Render. -
UpdateSettings needs to be called with ':' not '.'— usehyperbox:UpdateSettings()(with colon). The module expectsself. -
Models not appearing or wrong transform — check model pivots and whether the origin is set near the player.
Feedback
Rate
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Yes
- No









