How would I make a "Barrel" Distortion effect the way VR headsets do?

I’ve been trying to make a VR Barrel distortion effect for my game that looks like this image here.


Is there any way I can make this happen?

1 Like

You can maybe use frames to do that.

1 Like

I have tried frames, but I couldn’t manage to get the correct shape.

1 Like

you can not with Roblox.
It’s possible with Unity, but with a VR headset (like oculus) you can VR with Roblox.

1 Like

Maybe you can try to use Image Label.

1 Like

But If I want to use viewport frames that fit into the image, what do I do?

1 Like

If you want to see what I want to use viewport frames for. Click here.

Maybe you can also use a non-Roblox windows application to write code and distort roblox screen for smartphone VR

You can do something similar by abusing illegal Camera CFrame tricks. Not really the effect you’re going for, but maybe you can make it work. I’m not aware of any other ways to distort the client like you’re trying to do.

local RunService = game:GetService("RunService")
local WorkspaceService = game:GetService("Workspace")

local CurrentCamera = WorkspaceService.CurrentCamera

local R00 = 0.1
local R11 = 0.1
local R22 = 1

local function Distort()
	CurrentCamera.CFrame = CurrentCamera.CFrame * CFrame.new(0, 0, 0, R00, 0, 0, 0, R11, 0, 0, 0, R22)
end

RunService.RenderStepped:Connect(Distort)



2 Likes

the Glass material can somewhat behave in a way like this in the sense that it refracts the pixels you see in it depending on its shape. You could experiment with different lens shapes in a ViewportFrame in combination with Depth of Field and FOV to get this desired effect

1 Like