I am after information on how to use the data files for the
Texdata type. I want to be able to use a Radiance picture file
as a texture 'map'. Ie. using the picture file's red value to
change the x normal, the blue value to change the y normal and
the z value to change the z height. How might I go about this?
If you could supply an example, that would be great.
Many thanks,
Simon Crone.
Date: Wed, 21 Oct 92 11:48:02 PDT
From: greg (Gregory J. Ward)
To: crones@cs.curtin.edu.au
Subject: texture data
Hi Simon,
There is no direct way to do what you are asking in Radiance. Why do you
want to take a picture and interpret it in this way? Is it merely for the
effect? If you have a picture and wish to access it as data in a texdata
primitive, you must first convert the picture to three files, one for red
(x perturbation), one for green (y perturbation) and one for z
(z perturbation -- not the same as height). I can give you more details
on how to do this if you give me a little more information about your
specific application and need.
-Greg
Date: Thu, 22 Oct 1992 05:06:06 +0800
From: Simon Crone <crones@cs.curtin.edu.au>
To: GJWard@lbl.gov
Subject: Texture-data
Hi Greg,
The reason I wish to interpret picture files as texture data is as follows;
The raytracing program ( CAN Raytracing System ) that is being used in our Architecture department contains a number of texture pictures or "bump maps" that are used for various materials definitions.
I am currently converting the raytrace material list ( around 80+ materials ) to radiance material descriptions.
It would be a lot easier if I could use the existing raytrace "bump map" pictures to perturb materials rather than creating new procedural pattern.
A prime example of this is a water texture. The raytrace program has a very realistic water pattern, while my efforts to create such a procedural pattern have led to some fascinating, if not realistic textures ( The Molten Murcury pool is my favourite!
)
The blue channel ( z ) is used as a height for calculation of shadows across a perturbed surface in the raytrace program and does not perturb the z normal. I realise this may not be possible in Radiance.
I hope this helps.
Simon
Date: Wed, 21 Oct 92 17:50:17 PDT
From: greg (Gregory J. Ward)
To: crones@cs.curtin.edu.au
Subject: Re: Texture-data
Hmmm. Sounds like a nice system. Who makes it (CAN)? What does it cost?
Anyway, you are correct in thinking that Radiance does not provide height-
variation for shadowing, so this information may as well be thrown away.
First, you need to put your x and y perturbations into two separate files
that look like this:
2
0 1 height
0 1 width
dx00 dx01 dx02 ... dx0width
dx10 dx11 dx12 ... dx1width
.
.
.
dxheight0 dxheight1 dxheight2 ... dxheightwidth
Replace "height" with the vertical size of the map (# of points), and "width"
with the horizontal size. The y perturbation file will look pretty much
the same. (The line spacing and suchlike is irrelevant.) Let's say you
named these files "xpert.dat" and "ypert.dat".
Next, decide the orientation of your surface and apply the texture to it.
For a surface in the xy plane, you might use the following:
This just repeats the texture with a size of 1. You can use scalefactors
and different coordinate mappings to change this. If this works or doesn't
work, let me know. (I have NEVER tried to map textures in this way, so you
will be the first person I know of to use this feature.)
-Greg
Date: Fri, 23 Oct 1992 00:32:13 +0800
From: Simon Crone <crones@cs.curtin.edu.au>
To: GJWard@lbl.gov
Subject: Texture-data
Greg, hello again,
Well, the good news is that the texture mapping works!
I've converted the raytrace water bump map from RLE format to radiance PIC and used the pvalue program to create a large data file. A small C program then converts this data into the separate x and y perturbation files.
The example of the data file you suggested needed a bit of a modification.
It needed to be:
2
0 1 height
0 1 width
dx00 dx01 dx02 ... dx0(width -1)
dx10 dx01 dx12 ... dx1(width -1)
.
.
etc
i.e. the data was one array too wide and high.
The texture works well and is easy to adjust both in the tex.cal function file and through normal transformations etc. The only drawback is that the size of the data files can be quite large and radiance takes a while to read in and store all the data.
For example the water.rle bump map (a 256x256 image) takes up 203486 bytes.
The water.dat file generated from pvalue is 4194351 bytes.
The xpert.dat and ypert.dat files are each 655379 bytes.
As to your queries on the raytrace program ...
It is the Computer Animation Negus Raytracer (CAN) developed at the
School of Computing Science, Curtin University of Technology, Western Australia.
I am not sure of its cost but you can get more information from the following mail address:
raytrace@cs.curtin.edu.au
-Simon
Date: Thu, 22 Oct 92 10:12:11 PDT
From: greg (Gregory J. Ward)
To: crones@cs.curtin.edu.au
Subject: Re: Texture-data
Hi Simon,
I'm glad to hear that it works! Sorry about my error in the data file
description.
Yes, the data files are large and not the most efficient way to store
or retrieve data. Sounds like yours is taking about 10 bytes per value.
Different formatting might reduce this to 5 bytes per value, but that's
about the best you can hope for.
In most cases, the ASCII data representation is preferable for ease of
editing and so on. (Data files are most often used for light source
distributions.) The main exception is pattern data, for which I allow
Radiance picture files, as you know. Since you are currently the only
one I have heard from using texture data, it doesn't seem necessary at
this point to create yet another file type to hold it, and I don't favor
using a picture format to hold other types of data. (The Radiance picture
format doesn't allow negative values, for one thing.)