Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Skyboxes and corners...

  1. #1
    Intern Newbie
    Join Date
    Mar 2000
    Location
    New Jersey
    Posts
    30

    Skyboxes and corners...

    Not sure if this is an advanced topic but here goes:
    What is the correct way to implement a skybox?

    Take a look at the following picture: http://www.cornflakezone.com/gallery.php?galleryitem=14

    notice the sky has a visible corner in the center of the screen? What am I doing wrong?

    The sky in this case is a dome shape, like the inside of a breakfast bowl. I disable the Depth test and draw it first before everything else, It's also quite large, huge in fact compared to the models.

    I've also seen people use a flat sky which is parallel to the ground and box in the sides at 90 degrees to one another but again I get the corners. I know someone can help me, I just never figured this simple thing out. There's some trick I'm missing...
    Francis Shanahan
    Architect

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Cambridge, England
    Posts
    190

    Re: Skyboxes and corners...

    You have to predistort the textures to avoid this effect.
    How you would do this precisely I don't know (I just nick my textures from elsewhere).

    If you have Bryce I think there's a skybox generator in there.
    To put the skybox at an infinite distance, just translate it to the position of the viewer (then you can make it as big or small as you like and it won't make any difference (as long as it is within the clipping bounds)).

    [This message has been edited by Don't Disturb (edited 12-05-2000).]

  3. #3
    Intern Newbie
    Join Date
    Mar 2000
    Location
    New Jersey
    Posts
    30

    Re: Skyboxes and corners...

    Ehh, run that by me again, "pre-distort the textures" ? What do you mean by that ?

    What about the parallel plane type skyboxes. Any ideas ?
    Francis Shanahan
    Architect

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    807

    Re: Skyboxes and corners...

    You don't need to distort anything. If you render your skybox as a cube, with its center exactly in the viewer's position, it will look just dandy.

    The only thing you need to take care of is that you render the six sides of your cube with a 90 degree FOV. Unfortunately, there's a bug in Bryce, which causes the FOV to get slightly messed up. As such, you need to multiply your FOV by 1.25. So the FOV you need to assign to your camera in Bryce is 112.5 degrees.

    Good luck

    - Tom

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    926

    Re: Skyboxes and corners...

    Whats Bryce? And where can I get it from?

    cheers,
    Nutty

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,505

    Re: Skyboxes and corners...


  7. #7
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,074

    Re: Skyboxes and corners...

    Tom, that is actually what is meant. If you distort it while creation of the textures or if you distort them afterwards is the same. (Where the first attempt should give better result though...)
    To Bryce3D, how much does that cost? Is it payable?

    [This message has been edited by Michael Steinberg (edited 12-06-2000).]
    - Michael Steinberg

  8. #8
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Huntsville, AL. USA
    Posts
    302

    Re: Skyboxes and corners...

    Another solution is to usr a really tall cylinder instead of a cube. Make it tall enough or restrict the camera pitch so that the viewer can't see the top and the problem is solved. I used have used this approach with a single texture mapped onto a cylinder and with a single repeating texture mapped onto each quad of a cylinder. It works really well for me.
    Obsessive - A word used by the lazy to describe the motivated.

  9. #9
    Intern Newbie
    Join Date
    Mar 2000
    Location
    New Jersey
    Posts
    30

    Re: Skyboxes and corners...

    I tried the cylinder approach. I still get stupid corners though.
    Francis Shanahan
    Architect

  10. #10
    Guest

    Re: Skyboxes and corners...

    That is because you're using a "straight"
    texture that's not fitted for skycube
    mapping. The projection (or distortion) of a
    texture for skycube mapping is similar to
    that of cubic environment mapping.

    Try getting a set of skycube textures for
    QuakeII and stick that on your cube walls,
    and see if that doesn't help. The gamasutra
    article pointed at by a previous poster is
    also very useful, even though it's aimed at
    artists, not coders -- mainly, because your
    problem is one of the art you put in, not of
    the code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •