What is the sanest way to implement a 3d skybox that moves with the player?
Specifically I'm talking about the kind of skybox that remains at an infinite distance regardless of your position in the level.
UE4's included examples (like the sky dome or the distant ShooterGame cityscape) are all based on the assumption that the player will remain within a level's confines, and that the scale of those confines is much smaller than the distance to the vista. I'm working on a game that takes place in an infinitely generated area and involves fast, long range player movements, so this solution isn't viable.
My current solution involves making a vista actor that simply snaps to the player's XY location every frame. This seems inefficient to me, because the assets are still moving and then getting snapped back into place every tick (it also causes noticeable jitter at low framerates). Worse is the fact that they are still dynamic objects and therefore missing out on a lot of very significant rendering optimizations. This method also won't work in multiplayer games.
Does anyone know if there's a better way? For that matter, does anyone know if there are plans for a "built in" solution like the Source engine (AFAIK) has?
I think the Source engine has a skybox vertex shader that assumes the camera is in the center of the skybox and only uses the cameras rotation (and scale I suppose) to create the viewprojection matrix. This would be my suggestion as well, though I don't know how easy it would be to implement in UE4. A dirty solution would be to actually move the camera to the skybox and then back to the player.
answered Apr 24 '14 at 06:27 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here