POV-Ray : Newsgroups : povray.general : rendering skyboxes : Re: rendering skyboxes Server Time
3 Aug 2024 04:19:59 EDT (-0400)
  Re: rendering skyboxes  
From: John VanSickle
Date: 8 May 2004 20:21:55
Message: <409D79A0.E4ECEEAE@hotmail.com>
Barron Gillon wrote:
> 
> I have an OpenGL project, and I was wanting to use pov to render textures
> for my skybox.  Dos anyone have any experience with this?  I've been messing
> with the sphere camera and, surprisingly enough, its textures map very well
> to a sphere.  But I want to map to a box.  I've been playing with the output
> of the sphere camera and concluded that it is a dead end.  Does anyone have
> any insight?  Your help would be greatly appreciated!

Note for more ambitious developers:

Instead of one polygon for the directions x, -x, y, -y, z, and -z, you can
render 26 polygons (all combinations of -1, 0, and 1 in x, y, and z, except
for <0,0,0>).  The images (and the polygons) only need to be half the size
(in both width and height) of the ones used for the cubes.  This will involve
a slightly higher memory requirement (26 quarter-meg images instead of 6 one-
meg images), but the images will be higher quality (less "wide-angle"
distortion).  If you do not allow the user to look too near to straight up or
straight down, you can forget those two patches and have the exact same
amount of image data.

The camera statement for rendering all 26 views of a single scene would look
like this:

camera {
  direction z*(sqrt(2)+1)/2
  right x
  up y
  location 0
  #switch(frame_number)
    #case( 0) look_at <-1,-1,-1> #break
    #case( 1) look_at < 0,-1,-1> #break
    #case( 2) look_at < 1,-1,-1> #break
    #case( 3) look_at <-1, 0,-1> #break
    #case( 4) look_at < 0, 0,-1> #break
    #case( 5) look_at < 1, 0,-1> #break
    #case( 6) look_at <-1, 1,-1> #break
    #case( 7) look_at < 0, 1,-1> #break
    #case( 8) look_at < 1, 1,-1> #break
    #case( 9) look_at <-1,-1, 0> #break
    #case(10) sky x look_at < 0,-1, 0> #break
    #case(11) look_at < 1,-1, 0> #break
    #case(12) look_at <-1, 0, 0> #break
    #case(13) look_at < 1, 0, 0> #break
    #case(14) look_at <-1, 1, 0> #break
    #case(15) sky x look_at < 0, 1, 0> #break
    #case(16) look_at < 1, 1, 0> #break
    #case(17) look_at <-1,-1, 1> #break
    #case(18) look_at < 0,-1, 1> #break
    #case(19) look_at < 1,-1, 1> #break
    #case(20) look_at <-1, 0, 1> #break
    #case(21) look_at < 0, 0, 1> #break
    #case(22) look_at < 1, 0, 1> #break
    #case(23) look_at <-1, 1, 1> #break
    #case(24) look_at < 0, 1, 1> #break
    #case(25) look_at < 1, 1, 1> #break
  #end
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.