POV-Ray : Newsgroups : povray.general : rendering skyboxes : Re: rendering skyboxes Server Time
3 Aug 2024 04:21:01 EDT (-0400)
  Re: rendering skyboxes  
From: John VanSickle
Date: 9 May 2004 03:24:45
Message: <409DDCBA.D3A66A69@hotmail.com>
Slime wrote:
> 
> > 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>).
> 
> Interesting. How are these images to be mapped to polygons? I can't think of
> a way which uses squares in all directions (except for methods which involve
> allowing polygons to clip each other).

The corners are done with triangles (and there is some wasted image space
around the triangles).  All the rest are squares.

> > the images will be higher quality (less "wide-angle"
> > distortion).
> 
> How is that? If the camera is always perfectly centered in the sky box with
> the simple model, there won't be any distortion, as far as I can tell.

The standard projection distorts the view near the edges of the image.  This
is because the angle between any two pixels is not constant across the image.
The effect is decreased when the camera angle is smaller.

In the example I gave, a 1024-pixel view across an angle of 90 degrees gives
an angle of roughly .112 degrees near the center of the image, but an angle
of roughly .056 between the pixels are the left and right ends of the range.
This a 2:1 ratio going from the center to the edges.  Granted, this stretched
look is recompressed when rendered in OpenGL, but it makes more sense to
reduce the stretching and squeezing, if possible, as it may produce unwanted
artifacting.

A 512-pixel view, across the angle of 45 degrees, gives an angle of roughly
.0927 degrees between pixels in the center of the image, and .0792 near the
edges, giving a ratio of about 1.171:1.  The potential for artifacting is
reduced.

Note that if the rendering does not require images to have dimensions that
are a power of two, then the quality of the cube map using 1024x1024 images
can be achieved by the higher-polygon method using 424x424 images, at a
significant savings in total image size (25%).

Regards,
John


Post a reply to this message

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