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 / Creating a space scene

Author
Message
Thistle Studios
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 6th Apr 2011 15:04
I just want to put out there that I just cannot stand skyboxes. The majority of the time I cannot get them to work. I want to render a space scene similar to the X series of games where you can just fly your spaceship forever and ever into an endless space filled with white dots for stars. How can I go about doing this without a skybox?

Intel Core i5 3.2 GHz, 4 GB RAM, NVIDIA GeForce 9800 GT
Endangered City. An Endangered Species
JRH
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Stirling, UK
Posted: 6th Apr 2011 21:22
No replies

C++ is labourless... if your name starts with 'L' and ends with 'ee'.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Apr 2011 11:19 Edited at: 7th Apr 2011 12:50
I made a simple starfield once using an array of 50 or so stars, I was aiming for something along the lines of "Elite", so hopefully will work for you as well.

I'll see if I can find it for you when I get home this evening.

>Edit<



Sooner than expected, but here is my old starfield code. It's not brilliant, but hopefully will give u a prod in the right direction

It uses cloggy's d3d command for speed, but if you don't have it, just remove the 2 d3d plug in commands and unrem the normal dot command.

Thistle Studios
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 7th Apr 2011 22:27 Edited at: 7th Apr 2011 22:58
I tried implementing that into my code, but it doesn't seem to mesh. I get an "array out of bounds error." It could well be an error in my program structuring since I use multiple source files.

EDIT: Okay, it works... Somewhat. Unfortunately this game currently plays in 3rd person since I am terrible at camera controls and can't seem to do a first person cockpit view. The stars appear in front of the Earth, and also the object I am controlling, and the background is green.

EDIT 2: Okay, using COLOR BACKDROP I made it black, but what about having a backdrop image instead and using a scroll command? Unfortunately I have no idea what happened to TEXTURE BACKDROP since its no longer recognised by DB...

Intel Core i5 3.2 GHz, 4 GB RAM, NVIDIA GeForce 9800 GT
Endangered City. An Endangered Species

Attachments

Login to view attachments
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Apr 2011 23:00
There really is no good way to render a complicated scene like what you want without using a skybox. However, when used properly, sky boxes can look just as good, if not better than an actual 3d scene. I would really recommend you take another look at them. Later today I can upload some code for you, if you want.

Thistle Studios
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 7th Apr 2011 23:10
Well, all I am really looking for is a virtual skysphere, since I hate skyspheres because of the enormous scale I need which they can't seem to handle. I just hate the idea that the player is stuck inside a fixed box/sphere when it would be better to be inside a sphere that scales as the object moves further away from the centre.

Intel Core i5 3.2 GHz, 4 GB RAM, NVIDIA GeForce 9800 GT
Endangered City. An Endangered Species
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 8th Apr 2011 15:00
Quote: "Unfortunately I have no idea what happened to TEXTURE BACKDROP since its no longer recognised by DB..."


What version are you running? TEXTURE BACKDROP works for me. However, SCROLL BACKDROP was taken out.

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 8th Apr 2011 21:45
Quote: "Well, all I am really looking for is a virtual skysphere, since I hate skyspheres because of the enormous scale I need which they can't seem to handle. I just hate the idea that the player is stuck inside a fixed box/sphere when it would be better to be inside a sphere that scales as the object moves further away from the centre."

You're actually misunderstanding the idea of a skybox, I think. Basically, you create the box/sphere, and every loop position it where the camera is. Then, you set the sphere to render to the back, so that it is always drawn behind other objects (this way it doesn't need a huge scale). The two commands combined create a sky that does not have any distortion from perspective, will always stay with the camera, and is always drawn in the background behind other objects.

Thistle Studios
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 8th Apr 2011 22:25
But the question is, where do I make a skysphere? Enviroscope does not work, it simply won't run despite my best efforts.

Intel Core i5 3.2 GHz, 4 GB RAM, NVIDIA GeForce 9800 GT
Endangered City. An Endangered Species
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 14th Apr 2011 22:36
Quote: "But the question is, where do I make a skysphere? Enviroscope does not work, it simply won't run despite my best efforts."

All skyspheres follow basically the same format, so there are huge numbers of free ones. Just searching the forums for "free skybox" gives a huge number of results.

Login to post a reply

Server time is: 2024-11-22 23:39:22
Your offset time is: 2024-11-22 23:39:22