Images

The end result of running <#107#><#1769#>rayshade<#1769#><#107#> is an image file. Depending upon how it was installed, <#108#><#1771#>rayshade<#1771#><#108#> writes images in either the Utah Raster <#109#>RLE<#109#> format or a generic but easily-manipulated <#110#>mtv<#110#> format used by Mark VandeWettering in his <#111#>mtv<#111#> ray tracer. The <#112#>mtv<#112#> format consists of a header giving the resolution of the image followed by interleaved red-green-blue values for each pixel. The <#113#>RLE<#113#> format supports an arbitrary number of color channels, an alpha channel, comments, a history field, and the ability to treat images as windows into a larger image. As a result of this flexibility, a number of <#114#><#1773#>rayshade<#1773#><#114#>'s features are not supported if the <#115#>mtv<#115#> format is being used. You are thus strongly encouraged to obtain a copy of the Utah Raster Toolkit.

If the <#116#>mtv<#116#> format is used, the image will (and must) consist of three eight-bit color channels. If the <#117#>RLE<#117#> format is used, the image file consists of three eight-bit color channels plus an eight-bit alpha channel. <#118#><#1775#>Rayshade<#1775#><#118#> also documents in the <#119#>RLE<#119#> header the command line and <#120#>gamma<#120#> value used in creating the image.

If more than one frame is rendered, the resulting images are appended in turn to the image file. The various utilities provided by the Utah Raster Toolkit can be used to manipulate the resulting ``movie'' files. If the Toolkit is not being used, you will probably need to write utility programs to handle the decidedly non-standard multi-image <#121#>mtv<#121#> format files.

By default, <#122#><#1777#>rayshade<#1777#><#122#> writes the computed image to the standard output. The image file may be written to a file instead by specifying a file name in the input stream.

<#4616#><#4616#>
<#1157#>outfile<#1157#> <#1158#>filename<#1158#>
Write the computed image to the named file.
The output file name may also be specified on the command line by using the <#127#>-O<#127#> option.

The size of the output image is measured in pixels. The <#128#>x<#128#> size is the number of pixels left-to-right, while the <#129#>y<#129#> size is the number of pixels bottom-to-top.

<#4617#><#4617#>
<#1161#>screen<#1161#> <#1162#>xsize ysize<#1162#>
Use a screen <#133#>xsize<#133#> pixels wide by <#134#>ysize<#134#> pixels high.
The screen size may also be set on the command line through the <#136#>-R<#136#> option. The default screen size is 512 by 512 pixels.

When rendering an image, it is often advantageous to split the image into a number of disjoint windows, each of which is rendered on a different machine. One then combines the images corresponding to the windows into a final image.

<#4618#><#4618#>
<#1165#>window<#1165#> <#1166#>minx maxx miny maxy<#1166#>
Render the image in the given window.
The window must be properly contained within the screen, i.e., <#141#>minx<#141#> and <#142#>miny<#142#> must be greater than or equal to zero, while <#143#>maxx<#143#> and <#144#>maxy<#144#> must be less than <#145#>xsize<#145#> and <#146#>ysize<#146#>, respectively. The Utah Raster tool <#147#>rlecomp<#147#> is useful for reconstructing the full image from sub-images. By default, the window is equivalent to the entire screen.

It is also convenient to be able to render a small portion of the window by specifying a subregion using normalized coordinates.

<#4619#><#4619#>
<#1169#>crop<#1169#> <#1170#>left right bottom top<#1170#>
Crop the rendering window.
The rendering window is cropped by rendering the screen area that falls within #math47#minx + left(maxx - minx) and #math48#minx + right(maxx - minx) in the X direction, and similarly for the Y direction. <#152#>Left<#152#> and <#153#>bottom<#153#> must be greater than or equal to zero. <#154#>Right<#154#> and <#155#>top<#155#> must be less than or equal to one. If <#156#>left<#156#> is greater than <#157#>right<#157#>, the two values are swapped, and similarly for <#158#>bottom<#158#> and <#159#>top<#159#>.

<#160#>Gamma correction<#160#> may also be applied to the three output color channels. See Appendix A for more details.