Archived

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

Hlubocky

Lighting and skybox questions...

Recommended Posts

Hlubocky    122
I have been making a 3d space shooter (think Gradius / Lifeforce with an Einhanderish 3d feel) and I just recently needed a skybox. The way my views go I only need two of the six cubes faces, one for the front (behind the ship looking along the nose) and one for the left side (when the view shows the ships side). I don''t think I need a top, but let me know what you think. Anyway, my first question involves lighting. I''m fairly new to opengl and most of my levels so far have been really long quads for the floor, ie, extending the length of the level and really long walls that are one quad each. I have been playing around with moving the lights and different types of lights and I''m not seeing any kind of difference in the way the light affects the polygons. I think it might be because all of the geometry so far in the level has been made up of only four vertices. If I wanted to make a spotlight on the floor or wall or some such effect, would I have to make the wall a grid of textured triangles/quads? How do game developers make flat surfaces light well?

My second question is regarding the skybox itself. I currently am only using one face to cover the whole screen using ortho mode. I am having trouble thinking about how to cover the entire back z-plane with a texture. A few posts to this forum mention turning off the zbuffer and then writing a quad that would only cover the camera. I''m not sure I totally understand this concept...how a 2x2x2 quad could fill the entire screen.

If someone could clear up these two points I would be very grateful!

Share this post


Link to post
Share on other sites
Wavarian    850
A skybox, as its name suggests, is a cube drawn around the player. You disable the depth buffer to draw it so that everything after is drawn over the top of the cube, and you move it _with_ the player.

Share this post


Link to post
Share on other sites
zedzeek    528
with opengl lighting its done per vertex so the more vertices u have the better it looks.
also for skyboxes normally u disable lighting when u draw them

Share this post


Link to post
Share on other sites