# In VR Games, i frequently notice that skyboxes look too close. Would this be a method for making them appear more distant, especially for space games?

I was playing Star Trek Bridge Crew, and noticed that the starfield looks oddly close. The same goes for the sky in other games. I realized that this is because when rendering the skybox in a game, VR games render the skybox once for each eye. But because games use a large dome or sphere for the skybox, instead of the appearance of the skybox being located extremely far away (Which happens convincingly in non-vr games), the parallax is quite detectable to our eyes and we see the skybox for what it is, a relatively close wall of stars.

To fix this, I propose that when rendering for the right eye, the right eye camera be temporarily moved to the position of the left eye camera to render the skybox, then moved to the correct position before continuing to render the scene's foreground. Alternately, you could move the skybox model's position by a few pixels (as many as the distance between the cameras) to achieve the same effect.

This should make the appearance of the skybox appear at "infinite" distance since that's how we see stars ourselves, with both eyes seeing the photons arriving at almost parallel vectors.

The effect, in VR, should be convincing. Put simply, stars don't move their apparent position when you close one eye. That should be true in vr games too.

My question is whether, to the game devs of stack exchange, this would be possible using this method. I think the main challenge would be in changing the position of an object in the middle of a render pass.

• Do you mean is this possible technically? (Trivially, yes.) Or do you mean is it possible in the sense that it will solve the visual issue you're describing and still look good? – Josh Jan 4 '18 at 18:19
• Really I guess I'm asking both questions. I know that typically a render pass happens in a discrete step in a frame in most game engines, and in VR you perform a render pass first from the left eye's camera position, then another render pass from the right eye's camera position. This would require the below sequence of events: 1. Render the left eye 2. Move the Skybox over a few pixels 3. Render the right eye 4. Move the skybox back over a few pixels I also don't know if this would solve this problem. – NazzerDawk Jan 4 '18 at 18:27
• Instead of moving the camera during the render cycle, why not have two skyboxes, one visible to each camera and only that camera? – Stephan Jan 4 '18 at 19:11
• That might work better then, yeah. I like that idea. – NazzerDawk Jan 4 '18 at 19:15
• Usually we just render skyboxes using the view vector as input to a cubemap. That means they're effectively at infinite distance, with no parallax at all between the eyes. Even without this trick though, parallax between the eyes is only noticeable out to a few meters, so it's unlikely to be parallax that's making the skybox appear close unless someone made a serious error. The scale of the texture detail, or perception of the screen itself as sitting at a finite distance, might be stronger contributors to this effect. – DMGregory Jan 4 '18 at 19:41

Also on a side note, there's no need for the skybox to be any particular size or sphere-shaped - it can be a small box, it just needs to be big enough not to clip with the camera's projection plane, and it needs to lose the depth test against other objects. You can set the depth in the fragment shader like this:gl_FragDepth = 0.9999999f;