making a skybox?

Started by
24 comments, last by baddogj 19 years, 5 months ago
does anyone know of tutorial that teaches how to make a skybox in your game that doesn't require any programs. i searched all around google and couldn't find anything. thanks in advance. [Edited by - baddogj on October 24, 2004 9:30:05 AM]
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="88" height="70" id="H2lvl" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" /> <param name="quality" value="high" /> <param name="wmode" value="transparent"> <embed src="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" quality="high" bgcolor="#ffffff" width="88" height="70" name="H2lvl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
Advertisement
Try gametutorials.com, they have a skybox example in the DX section. Later on you may want to speed up your skybox rendering using cubemaps ..

good luck
www.pokersniffer.org
Check out Steg's new web site
[size="1"] [size="4"]:: SHMUP-DEV ::
thanks for the posts. could someone possibly email me the tutorial at gametutorials for making a skybox as i am not able to download it. thanks in advance
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="88" height="70" id="H2lvl" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" /> <param name="quality" value="high" /> <param name="wmode" value="transparent"> <embed src="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" quality="high" bgcolor="#ffffff" width="88" height="70" name="H2lvl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
if any of you are wondering, my email adress is jdwilliams3@comcast.net if some of you don't know
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="88" height="70" id="H2lvl" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" /> <param name="quality" value="high" /> <param name="wmode" value="transparent"> <embed src="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" quality="high" bgcolor="#ffffff" width="88" height="70" name="H2lvl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
Quote:Original post by Mille
Later on you may want to speed up your skybox rendering using cubemaps ..


erm... how so? not that something like an old-fashioned skybox would need much of a speed boost anyway, but the only advantage of using a cubemap comes into play if you also want to use it for cubemapping on objects. else its just a fancy but useless thing to do. except you want to say that clipping a few unused quads and sending one quad instead of 2 strips or 6 quads is making any difference when looking at the fillrate its eating one way or another.
f@dzhttp://festini.device-zero.de
Is there something more to making a skybox then simply texturing a big box then centering it on your scene? Because thats what I do but I see so many questions about them it sounds like its harder then just that.
______________________________________________________________________________________With the flesh of a cow.
I found the tutorial slightly helpful. It suggests making a huge cube centered on the camera. It dawned on me I could just make a tiny cube centered on the camera, render it first and then clear the depth buffer with a statement like this: glClear(GL_DEPTH_BUFFER_BIT); . It's only an illusion (not real rendered geometry) anyways. If you have some generic texture loading code (like me) that does things like automatic mipmap generation, you may want to bypass that as a mipmap is pointless and a waste of memory. This is especially true with detailed skybox textures. Also, you should disable lighting and other effects.

As far as overhead is concerned, you can disable the skybox when the camera is in a room without windows, etc.

If anyone has any other ideas, or disagrees with me, I'd love to know about it. This is new to me.
steveth45 = new gamecoder;
Quote:Original post by Trienco
Quote:Original post by Mille
Later on you may want to speed up your skybox rendering using cubemaps ..


erm... how so? not that something like an old-fashioned skybox would need much of a speed boost anyway, but the only advantage of using a cubemap comes into play if you also want to use it for cubemapping on objects. else its just a fancy but useless thing to do. except you want to say that clipping a few unused quads and sending one quad instead of 2 strips or 6 quads is making any difference when looking at the fillrate its eating one way or another.

The benefit doesn't come from sending one quad vs. 6 quads, it comes from only having to set one texture and then make one draw call rather than have to set 6 textures and make 6 draw calls. API calls and texture changes are relatively expensive and avoiding them is in general a good thing, though in this case it's probably not going to make a huge difference. If you're CPU limited though (as many games still are) it will be slightly faster than making 6 draw calls.

The biggest cost of rendering a skybox is fillrate so in general you want to clear your depth buffer at the start of the frame using specific API clearing calls (rather than drawing a full screen quad) which sets up the hierarchical z buffer on modern cards then draw your scene (in roughly front to back order) and then draw your skybox last with it's z value set to the maximum z. Doing it that way gets you early z rejection on pixels where the skybox is hidden by other objects which saves fillrate. Drawing the skybox first without writing z, whilst it's a nice simple approach, means you write every pixel with the skybox colour and then overwrite many of them with your scene and so wastes fill rate.

As usual, these sorts of optimizations are not worth worrying about until you've profiled and identified this area as a bottleneck. If you do find yourself fill rate limited though it can be worth arranging your sky box rendering like this.

Game Programming Blog: www.mattnewport.com/blog

I used a squashed hemisphere.

It gets rid of lots of artefacts.
No bombs, No guns, just an army of game creators...

This topic is closed to new replies.

Advertisement