Advertisement

Space game graphics with Depth perception

Started by November 07, 2012 08:23 PM
19 comments, last by Norman Barrows 11 years, 10 months ago
"stars only twinkle if there's atmosphere"

good point.

ok, lose the animated skybox in deep space scenes.

that means fewer textures, a good thing.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

As for stars, using pixel shading can increase performance over using a skybox, if only stars are needed in the distance.



Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

Advertisement
For visual orientation, you could use a Milky Way effect (which also happens to be perfectly realistic). It would be big cloudy band 360 around the player to give them a sense of what's "level". You could then put a galactic core on one end, thin it out on the other to give a sense of direction, and do something like Norman Barrows was saying and put (for example) a brightly colored nebula 'above', and a pure white-ish galaxy in the distance 'below'.

-Mark the Artist

Digital Art and Technical Design
Developer Journal

Thanks for the answers. I see now that fog really was the wrong approach.
I have worked on the suggestions and thought I'd share the results:
  • I had a hard time drawing a Skybox myself, mostly due to parallax errors in the corners and my inability to mask the transitions at the edges. For anyone searching, try Spacespace (http://alexcpeterson.com/spacescape). It does the job beatifully and I'm glad I stumbled on this. For the time being, I could get away with a single rendering pass, since there are no distant objects and the skybox is 10000 big, as suggested.

  • The Skybox helped with orientation in a relative manner, like you can tell which way you are turning/looking. But what I needed was an absolute reference point, so I followed Prinz Eugn's advice and added a milky way band all arround one axis (It's actually tilted, but there is no way to notice, which I'm pretty happy about). The galaxy is additively blended over the background which works great.

  • The galactic core on the side of the sky box further helps with orientation. I made it really bright and added directional lighting. sharp lighting really is the way to go, I more than doubled the intensity and it looks good. smile.png

  • HUD: For now I added a line for each ship to indicate its current target. There is a lot to be done, like showing the estimated flight path (which should be curved rather than straight). Right now it is a wirefrime line, but I would want it to be a translucent and add a subtle glow effect.

  • Particles: Added a threaded particle system. This makes things come to life, I added basic explosions and engine trails, but they are really ugly because I can't draw ;). I am working on that "star dust" thing right now, which will be hard because I cannot reposition particles right now to implement an infinite scrolling cube, only spawn new particles.
I attached a few screenshots.

Oh, I feel that you are on the right track! It is really coming together.smile.png

Be careful of "feature creep". The star seems a bit too bright for my liking, but maybe that's only my opinion. Many objects in the field of view will lose some people, but I actually like the challenge.

The choice of colors is wonderful! Keep up the good work!

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

HUD: For now I added a line for each ship to indicate its current target. There is a lot to be done, like showing the estimated flight path (which should be curved rather than straight). Right now it is a wirefrime line, but I would want it to be a translucent and add a subtle glow effect.

Particles: Added a threaded particle system. This makes things come to life, I added basic explosions and engine trails, but they are really ugly because I can't draw ;). I am working on that "star dust" thing right now, which will be hard because I cannot reposition particles right now to implement an infinite scrolling cube, only spawn new particles.

Looks beautiful!

You're definitely getting there.

The stars do look a smidge on the bright side, as mentioned elsewhere.

I myself like the busy screen, reminiscent of scenes from star wars. More action than the player can track can help with immersion. Although too much can lead to confusion and then frustration.

For the HUD, have you considered the horizontal and vertical onscreen compass displays used in early HUDs on fighter aircraft? With a big giant compass down the left side reading 10 degrees up pitch and another one across the top reading a heading of 270, its hard not to tell which way you're going.

re: particles:

I assume you mean you have yet to implement moving particles and only have stationary types.

if so, and you keep different types of particles in the same array (linked list etc) with a type field (rock, explosion, etc), then the moving cube is easy to implement using your current array. define a new type: moving_particle (or whatever). create 100 or so at random locations in a cube around the ship. each frame, call a routine that moves the moving_particles towards the back of the ship by an amount based on the speed of the ship by changing the x/y/z position. when they reach the back of the cube, generate a new random position at the front face of the cube. in a left hand coordinate system in object space this would be moving them in the -z direction, then regenerating them at the positive z face of the cube, at a random x,y location on that face. This is probably the best way to implement it, in object space. when it comes time to draw, you have a nice cubic particle field surrounding the ship already specified in object space coordinates. for each particle, simply apply the ship's world transform to move it out to the ship's position and orientation, then draw as usual.

for drifting space dust, you may want to consider alpha blended billboards or some other technique that lets you represent more than one chunk of dust with a single particle to keep the overhead of the particle system down. but try it first and see. Like Michael Abrash said at the '96 Gamedev conference lecture on the Quake engine, computers are really good at doing the same simple thing (like moving a particle) lots of times in a row really really fast. the problem is that graphics cards are not good at drawing large numbers of batches of just a few dynamic triangles per batch, which is exactly what games do and need. vidcards are good at the opposite, drawing a few batches of a vary large numbers of static triangles. So 10,000 particles may be doable, but not drawable. OTOH, I've gotten pretty good results on the infamous "10,000 blades of grass" challenge in my current project on a baseline PC with just an on-board graphics chip, so the horsepower may be out there to go stardust crazy. Note however that i'm definitely not using one triangle per blade of grass, something more like 2500 triangles to draw 500 meshes with grass blade textures, and yes, they do move!

stardust - grass blades. swaying - drifting. same idea - different texture.

can't wait to see the next round of screenshots!

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in. That's some great stuff right there.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

for each particle, simply apply the ship's world transform to move it out to the ship's position and orientation, then draw as usual.

actually, i think you want to translate to ship position, but NOT rotate to ship orientation. that way when you turn, the particles don't turn with you.

or maybe not, have to think about that. been a long time since i did this effect. but it is possible to get a ship that flies and turns through a star field (space dust, whatever) just like in Star Trek.

anyone else out there remember how to do this?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in. That's some great stuff right there.

actually i think its the dramatic lighting the really makes the difference.

the skybox is to die for (although the flare is strong).

but imagine the foreground from the first screen shots with the new skybox. its the lighting that makes the real difference, although you don't notice it unless you think about it. Lighting is everything. I used to do raytracing before i got into realtime 3D. I'm still waiting for a realtime raytracer graphics engine.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in. That's some great stuff right there.

actually i think its the dramatic lighting the really makes the difference.

the skybox is to die for (although the flare is strong).

but imagine the foreground from the first screen shots with the new skybox. its the lighting that makes the real difference, although you don't notice it unless you think about it. Lighting is everything. I used to do raytracing before i got into realtime 3D. I'm still waiting for a realtime raytracer graphics engine.

You're right, I didn't notice it because it just "looks right". But those shots from "beneath" the shaded side really highlight what you're talking about.
Either way, bravo OP!

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

This topic is closed to new replies.

Advertisement