Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Skybox first attempt...

Author
Message
Qweeg
19
Years of Service
User Offline
Joined: 23rd Sep 2004
Location: Kent
Posted: 3rd Feb 2005 19:02
I am trying to set up a skybox for the first time - without much success. I have loaded a sample matrix from the limit rush tutorial for the terrain and have downloaded a skybox from Mark Alsip's free collection (I have included the link to this as it is too big to include as an attachment even zipped).

http://www.alsip.net/gamedev/media/skybox/sunsets/cold2/index.html

But things do not look as they should. Could anyone give me a pointer as to where I am going wrong. I have attached a zipped version of the project including the matrix.

Many thanks,

Attachments

Login to view attachments
Zokomoko
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 3rd Feb 2005 20:45
Haven't downloaded the zip.
But here are a few pointers about a skybox.

Make object box 10,-20000000000
That'll create a skybox with a negative size, that means that only if your camera is INSIDE you could view it.
if you create a skybox with a positive size, that's not good, cuz only if your camera is OUTSIDE you could view it, and that's not what we want.

after you create the skybox object, texture it, and you're done.
Every loop, reposition the skybox at the player's position.

That's the approach i'm using, and i'm satisfied with it.
Qweeg
19
Years of Service
User Offline
Joined: 23rd Sep 2004
Location: Kent
Posted: 3rd Feb 2005 21:22
Thanks for the tips Zokomoko. I think I am pretty much there now. It was a bit strange, in that the skybox .x model I downloaded seemed to have the top and bottom face textures round the wrong way - so the horizon line was correct all the way round but there was nothing directly above and sky directly below.

When I swapped the names of these two texture files round it was then just a case of getting the size of the skybox and the range of the camera correct. Now I've got the hang of setting them up using a pre-build skybox model I'll have a go at making my own, using your method.

Cheers,
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 5th Feb 2005 09:43 Edited at: 5th Feb 2005 09:46
Hi Qweeg,

Quote: "It was a bit strange, in that the skybox .x model I downloaded seemed to have the top and bottom face textures round the wrong way "


Mark Alsip here... The skybox is a cube I made in GameSpace, with all of the faces inverted, and the textures were mapped to the faces with that in mind. It loads up "strange" (as you were kind enough to phrase it) in DirectX without a couple of lines of code to set things right.

The first three skybox packs I gave away had the sample code in the zip file and the later ones omitted it. Sorry about that. Here are the key points you want to cover in your code for those skyboxes:

1. Scale the object BIG. Like, 20,000 or 30,000 units. The actual .X model is only 60 3D units!

2. Position your camera INSIDE the box.

3. Use SET TEXTURE to change the default behavior for textures (see code snippet below). The default mode isn't suitable for most any skybox-type of object as you'll get visible lines in the corners. This includes the professional boxes in SkyMatter. Somewhere on the TGC site is an excellent PDF-format skybox tutorial that goes into detail on the subject (they user 6 flat planes but still have to stretch the sides or the textures)

Here's a snippet from the free planets demo on the web site, it uses a skybox with its own camera to "beam" video up from a planet surface.



I've been moving all the skybox stuff to a new web site (alsip.net has reached its disk quota), complete with better example code and tutorials. But work has had to come first this month so I'm behind on that.
Qweeg
19
Years of Service
User Offline
Joined: 23rd Sep 2004
Location: Kent
Posted: 7th Feb 2005 05:44 Edited at: 7th Feb 2005 05:54
Thanks a lot Mark.

Please don't take any offence at my wording - and my apoliges for the use of the the word "strange". I fully expect that the reason most issues I encounter at the moment exist is because I am doing something wrong - as is the case here, and I really didn't intend to imply that there was something wrong with your skybox.

Thanks for pointing me in the right direction though, and for being kind enough to allow us all access to your great skyboxes. Now that I am using it correctly it looks fantastic.

Cheers,
Tim
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 8th Feb 2005 08:21
Your wording was absolutely fine Qweeg. I was actually poking a bit of fun at myself there in my reply! Please don't think I was at all offended -- "strange" is indeed a kind word for the appearance of the box if loaded up in, for example, the DirectX mesh viewer, or GameSpace, or anything else that doesn't include a few lines of code to account for the box being created for viewing from inside-out.

You should have heard what I called the thing the first time I brought it up in mesh viewer to show off the skyboxes to some programmers at work...

Anyway, thank you for using the darned things and providing feedback. Its way too easy for me to forget really basic things such as including a sample program and README file with each and every skybox. The new web site will correct some of that I hope...

Cheers,

Mark

Login to post a reply

Server time is: 2024-09-23 11:27:08
Your offset time is: 2024-09-23 11:27:08