Forums

Full Version: skybox management
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all!
I looked into the code and into the data folder, but I'don't understand how the skybox works...
does somebody explain me how it works?

thanks!
General info on what a skybox or skydome is:
http://en.wikipedia.org/wiki/Skybox_(video_games)

VDrift organizes all of the rendered geometry using a scenegraph:
http://en.wikipedia.org/wiki/Scenegraph

Each node in the scenegraph can have multiple DRAWABLE objects. Each DRAWABLE object represents a render-able piece of geometry. When a track is loaded the parameters of each drawable object are set up based on the track's objects/list.txt file. Here's a description of the list.txt file's format:
http://wiki.vdrift.net/Track_files_and_f...2Flist.txt

One of the parameters define whether or not the object is a skybox. When VDrift does the final rendering of the scenegraph, it draws skyboxes slightly differently than normal objects (no lighting, no depth buffer writing, and no camera translation). Search in graphics.cpp for skybox and you'll see exactly how it's used.
thanks joe, but I see that the textures in the track folder doesn't have clouds for example...
how are managed the different weather conditions?
ghiboz Wrote:thanks joe, but I see that the textures in the track folder doesn't have clouds for example...
how are managed the different weather conditions?

there are no different weather scenarios...

--alex--
thanks, but the clouds are drawn in the sky...
how?
Which track are you looking at that has clouds in VDrift but you can't find a texture file with the clouds?
joevenzon Wrote:Which track are you looking at that has clouds in VDrift but you can't find a texture file with the clouds?

sorry... there were a misunderstanding...
how many texture are read to draw the sky? and how are manage into the code?
ghiboz Wrote:sorry... there were a misunderstanding...
how many texture are read to draw the sky? and how are manage into the code?

All track object meshes are stored in the track's objects/objects.jpk file. All track object textures are stored as objects/*.png. In the file objects/list.txt, each track object mesh and texture is listed, along with some information that tells VDrift how to use the object. Here's the part that's important to answer you question:
the sky is a normal track object and it's treated exactly the same as any other track object that the track modeler has put in the track. The only difference is that it has its information in list.txt set so VDrift knows to draw it in a way that it'll look correct as a skybox (not light it, etc).

There is no code that draws only the sky. Since the sky is a track object put there by the track modeler (like any other), the same code that draws all of the other track objects draws the sky.

In an old, old version of VDrift the sky was drawn specially, and it allowed changing weather and moving clouds... but most tracks are modeled with their own skyboxes as track objects, so now that is what's used. Are you wanting to add that changing weather capability back?