I'm working on a system like no man's sky for seamless transition between interplanetary space and going into the planet with no loading screens i mostly got the planet generation down with a chunk system and some perlin noise(the image should kinda look like pluto)
What I'm currently working on is rendering the planet when your in interplanetary space
the way i do this is i have an invisible part follow the player so it doesn't derender when u are far away and attached a billboardgui and then viewportframe and scale the billboard so i can get past the max part limit
but now i have to calculate what the viewport should show if you are looking at it which i do with this code
local cameraDistance = 1
local planet = workspace:WaitForChild("Planet")
local planetPosition = Vector3.new(0,0,-10)
game:GetService("RunService").RenderStepped:Connect(function()
planet.Position = playerRoot.Position
local playerCam = workspace.CurrentCamera.CFrame
local dir = (playerCam.Position - planet.Position).Unit
local camPos = dir * cameraDistance
vpCam.CFrame = CFrame.lookAt(camPos, Vector3.new(0,0,0))
local offset = planetPosition - playerRoot.Position
billboardGui.StudsOffsetWorldSpace = offset
end)
it kinda works as you can see in the videos but the bigger the planet is the more you can see wrong
idk why it is like that but I'm tired and have a fever and am being stupid right now
I left a ms paint image i made in like 5 seconds to show should be happening but most likely looks scribbles
if someone could point out why my code is bad or recommend a different way to render planets much thanks would be appreciated
ps: mb if this all sounds like yapping or gibberish
** You are now Level 7! **