x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: Not Selected
Tags:
more ▼

asked Apr 23 '14 at 10:38 PM in Using UE4

avatar image

SFtheWolf
384 34 39 45

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Apr 24 '14 at 06:27 AM

avatar image

Dieselhead
1.2k 27 22 210

avatar image SFtheWolf Apr 24 '14 at 05:55 PM

I never thought of doing it in a shader! That's clever as it will mean that static lighting will still bake properly without further setup.

I still see a few potential issues with this for my particular use case:

  • There's nowhere to put the skybox in the level that the player can't hypothetically reach.

  • Shadows can't be cast from the skybox onto the playing field, and my skybox has towering buildings that can block the sun.

  • This method would probably mess up particle effects and such, and my skybox also uses those, often at close range (there's a thick layer of smog and traffic beneath the player at all times that acts as a visual representation of the kill volume).

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question