Skip to main content
GameDev.net gamedev.net
🔒 Locked

Parallax skybox problem

Started by Jake S. C++ Dec 17, 2011 at 4:24 AM 3 replies 2.5k views
Original Post
Jake S. C++
Jake S. C++
Hi I have this problem with my 3d game, I programmed a skybox and made it move at a different speed as the player to give the illusion of depth(Parallax) but the problem with this technique is that the player will eventually cross the confines of the skybox and even before that he will come close enough it to realize it's a box. How can I have a moving skybox but still prevent the player from leaving the box?
Krohm
Krohm
You don't. The skybox does not move, it's infinitely far away so movement has 0 relevance.
What you're looking for is probably a 3D skybox like this. Notably, it is not a box.
Previously "Krohm"
osmanb
osmanb
The OPs problem will still exist. We use this technique in our engine/game as well. The important thing is that it's only (easily) usable if your gameplay area is confined enough to prevent the player from walking forever (This is what we do, and it's what the Source engine does...). Another option might be a tileable skybox texture/model (although that's going to look pretty bad in the general case).
Jake S. C++
Jake S. C++
so the only way to prevent this is to make my skybox the same size as my level?
the_edd
the_edd

so the only way to prevent this is to make my skybox the same size as my level?

The sky box can be any size if you render it first with depth-writes disabled. But you have to scale the amount by which you move it to ensure you never cross (or get anywhere near to) the boundary.

As previously mentioned, as sky box typically doesn't move at all, relative to the camera.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.