Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
skybox management
12-03-2008, 09:49 AM,
#1
skybox management
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!
www.ghiboz.com
Reply
12-03-2008, 11:27 AM,
#2
 
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.
Reply
12-03-2008, 11:54 AM,
#3
 
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?
www.ghiboz.com
Reply
12-03-2008, 01:01 PM,
#4
 
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--
Reply
12-04-2008, 02:41 AM,
#5
 
thanks, but the clouds are drawn in the sky...
how?
www.ghiboz.com
Reply
12-04-2008, 11:15 AM,
#6
 
Which track are you looking at that has clouds in VDrift but you can't find a texture file with the clouds?
Reply
12-05-2008, 05:44 AM,
#7
 
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?
www.ghiboz.com
Reply
12-05-2008, 12:09 PM,
#8
 
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)