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.

DarkBASIC Professional Discussion / 3D Space Environment Question

Author
Message
Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 8th Mar 2011 09:26
Hi All...

I have a question. I'm wanting to step up my game by learning the 3D aspects of DBPro. Once type of game that I enjoy playing, and one that seems to be missing a lot now-a-days, is a good space shooter. I would love to be able to create a beautiful 3D space environment. It doesn't have to be anything fancy. A few stars and maybe some colored cloud textures to start. I just want to be able to "fly" around a bit.

I took a look at the "reflective skies" demo and noticed the backgrounds are all square. I would like to avoid this at all costs if possible. Does anyone know about how to start this or a tutorial that I might can learn from? Thanks in advance!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2011 12:03 Edited at: 8th Mar 2011 12:04
You could use skyspheres not just skyboxes.

My half finished skybox/sphere maker is free here:
EnviroSCOPE

It'll produce space scenes and from those you can produce skyboxes or skyspheres (to the current display height) but frankly the skyspheres take a long time to render and the skyboxes work just as well.

Have a play, it's free and I'm still building on it now and then

There are also many free skysphere textures out there I just enjoy making my own!

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Mar 2011 16:00
Resolution stretching can be a real pain with spheres, so it detracts a little from the benefits in using a skysphere (single texture, optimised camera range etc)

What I would do, is make the sky sphere from plains, like sticking post-it's to a football, each post it with a basic star texture. That way, you have good detail, even with a fairly humble texture - and you can easily change the texture to nebula etc. And the sky would be different every time, if you wanted. Because this is so easy with plains, I would make a plain first, position it at 0,0,0 then rotate it randomly on all axis. Then just move the plain forward by the desired radius, and add a limb with the same rotation, and offset to the plain position.

I'm sure I have an example of this from yonks ago - I could dig it out if you want to see how it looks.

Health, Ammo, and bacon and eggs!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2011 16:13
@VanB, that's exactly how my skybox maker sets out the stars and nebulae in the editor

It's a great way to do it for sure. If you make all the planes limbs of one object it'll won't have a huge performance impact either.

I'd be interested in seeing your code too VanB. I was thinking of releasing the code for my skybox maker too since it's a free tool anyway...

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Mar 2011 17:15
Haven't any of you thought about the two's combination?

It is a bit rushed together, could be even better, but you may get the point. You get the easy to texture AND the spherical feel.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2011 17:26 Edited at: 8th Mar 2011 17:33
Quote: "Haven't any of you thought about the two's combination?

It is a bit rushed together, could be even better, but you may get the point. You get the easy to texture AND the spherical feel."

Not sure how that's easier than texturing than a plane? You couldn't rotate the textures easily either... looks nice though

Making randomly textured planes, randomly rotating them and moving them out a set distance is literally a few lines of code. I just released my code for EnviroSCOPE.

Here's the code I used:


Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Mar 2011 17:35
Here's mine...



For nebula, I'd just load in some images and add them as seperate limbs once the star mesh is finished. I use ghosting instead of transparency, as there are a lot of issues with transparency, and the sky will tend to be the backdrop anyway (the backdrop and fog colour could be adjusted to suit the atmosphere).

Health, Ammo, and bacon and eggs!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2011 17:41
Quote: "Here's mine..."

Nice. Looks great.

Quote: "I use ghosting instead of transparency, as there are a lot of issues with transparency, and the sky will tend to be the backdrop anyway (the backdrop and fog colour could be adjusted to suit the atmosphere)."

Never thought of that. Good point!

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Mar 2011 17:42
Easier to texture than a spere damnit...
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Mar 2011 17:52
Quote: "Easier to texture than a spere damnit..."

Yes true! As long as the UV mapping is done right of course.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Mar 2011 10:10
That would still have distortion, and need 6 textures. I don't think it is any more efficient than a skybox, it will look a bit better and would be better for the camera range though.

If you strongly disagree, then you have to make a demo to proove it .

Health, Ammo, and bacon and eggs!
Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 10th Mar 2011 05:40
Wow! All of these look pretty cool! I have to admit, 3D is a long step away from the 2D aspects. When creating textures for skyboxes/skyspheres, what screen sizes/resolutions would be best?
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Mar 2011 09:56
Quote: "When creating textures for skyboxes/skyspheres, what screen sizes/resolutions would be best?"

Using EnviroSCOPE? The larger the better but I'd just go with the current height of your desktop, if possible set it as high as you can when you run it as it'll make larger images quickly.

Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 10th Mar 2011 10:12
Well, I was meaning creating them in Photoshop for now. I guess I should have been more specific. I haven't had time yet to work with EnviroSCOPE. Fixing to now.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Mar 2011 10:18
Quote: "Well, I was meaning creating them in Photoshop for now."

If you're making just the star images etc. they can be quite small and still look great, 64x64 or even smaller. Nebulae can be much larger as you won't be using many. I'd experiment by saving large versions of the images and reduce the size of copies until it's noticeable in your game.

Quote: "I haven't had time yet to work with EnviroSCOPE. Fixing to now."

I hope it does what you want. It's fun to play with in space mode anyway Painting nebulae is my favourite part.

Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 10th Mar 2011 10:18
I just tried to run EnviroSCOPE. Sadly, Windows keeps saying the program closes has stopped running a few seconds after running the EXE. If it helps, I'm running an Acer Aspire 5515 Laptop with Windows Vista Home (32-bit), 2 GB RAM, ATi Radeon X1200. There is no other error message given.
Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 10th Mar 2011 10:25
Well, I was thinking about creating my own images using Photoshop using the skills I'm going to college for. I have tried to use some of my past 2D images from past courses in a Skysphere. But all of them look blown-up and pixelated. I don't mind the pixies I just wish everything didn't look so close up.

@Van-B I like what you've done. And I played with it a little by changing the mouse control to a keyboard control. I also tried to move the camera as if a player was "flying" in space and eventually lost the stars. For some reason, after adding a little camera movement I lost the planet object. I was using your code as a way to learn the 3D aspects of a space environment. Code is below.



What I was attempting to do was find a way to see if a player could set a traveling speed by pressing a single key. I also tried to allow the player to shut off "engines" to bring them to a halt. Guess I still have some learning to do LOL.
Kamakazi
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Moberly, Missouri
Posted: 10th Mar 2011 11:04
Below is the code I tried out to make a Skysphere. But, the image that goes into creating this Skysphere is like...in your face. Is there anyway to zoom the camera back a little to where there appears to be more detail?

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Mar 2011 16:21
This bit of code here:

move camera 0,cx

That appears to be moving the camera BY the cx amount - maybe that should be....

move camera spd

The move camera commands shifts the camera forward by the specified amount - that first parameter is the camera number, and not needed when you only have the default camera.

Health, Ammo, and bacon and eggs!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Mar 2011 17:20
What I did for Worlds Apart was a skysphere of size -800000, then used a 1024 x 1024 texture made up of random dots with some slight color variation, texture the sphere with it, and scale the texture so it repeats 4 times.

Camera range is set at 1100000 and I keep the skysphere moving with the player. You can adjust the texture scale to get the effect you want. If you want to add nebula or far off galaxies, then you can use SET BLEND MAPPING ON or a shader, and add that on another texture stage.

The reason for the big numbers is the sectors of space I use are 800,000 DBP Units in length and width.

Login to post a reply

Server time is: 2026-07-14 20:38:21
Your offset time is: 2026-07-14 20:38:21