• ### Popular Now

• 13
• 18
• 19
• 27
• 10

#### Archived

This topic is now archived and is closed to further replies.

# Background Image in DX8 - use a box?

This topic is 5492 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. I''m trying to create the standard starfield backdrop for a space flight sim. I''m going to default to the "texture the inside of a box" method unless there is a better way. Can you set a texture/graphic as the default infinitely distant background for a D3D scene? If so, would that be better than "the texture the inside of a box" method? I thought that I read somewhere in a book that you could set a texture as the default background for a D3D scene. I have gone back through the couple of books that I read on DX and haven''t been able to find where this might be mentioned. Perhaps I''m not finding that reference because my memory is faulty and this capability was from some other 3D engine doc that I read.

##### Share on other sites
quote:
Original post by Igilima
Hi. I''m trying to create the standard starfield backdrop for a space flight sim. I''m going to default to the "texture the inside of a box" method unless there is a better way.

Can you set a texture/graphic as the default infinitely distant background for a D3D scene? If so, would that be better than "the texture the inside of a box" method?

I thought that I read somewhere in a book that you could set a texture as the default background for a D3D scene. I have gone back through the couple of books that I read on DX and haven''t been able to find where this might be mentioned. Perhaps I''m not finding that reference because my memory is faulty and this capability was from some other 3D engine doc that I read.

Maybe you can, if you draw it first at close distance, clear the z buffer and draw the rest. The big downside is that it won''t move when the camera moves.

A sky box is good enough, and can be very convincing. Just make sure that you deform the textures, like ==--__--=='''' or else it will look like a box. A skybox with properly deformed textures is indistinguishable from a (much more expensive) skydome.

##### Share on other sites
If you set the right view and an orthogonal projection, and make it one unit wide by one unit high, and disable the z-buffer, you could render a 1 by 1 square, which would fill the entire scene, and as such, the entire screen. Then you could set everything to normal and draw the rest. Of course, it''s not as convincing as a cool moving box.

I''m interested in that skybox. Do you make it really small, and render it first, or is it okay to just make one gigantic box around your entire scene? And how, exactly, should your textures be deformed? What about the edges?

##### Share on other sites
quote:

Just make sure that you deform the textures, like ==--__--=='''' or else it will look like a box

I am working on this same problem right now. How would I deform the textures as you describe? I''m using DirectGraphics 9 w/ C++.

-Mike