[Radiance-general] Question about transdata usage

Greg Ward [email protected]
Wed, 2 Apr 2003 15:46:06 -0800


Oh, bother these questions that require one to think!

> From: Mark Stock <[email protected]>
...
> Right now, my scene.rad looks like this:
>
> void transdata layer1trans
> 5 noop layer1.dat translayer.cal pos_u pos_v
> 0
> 6 0.5 0.5 0.2  0.0 0.97 0.0
> # r g b  rspec trans tspec
>
> layer1trans polygon layer1
> 0
> 0
> 12  0 0.1 1  0 0.1  1 1 0.01  0 1 0.1
>
> [other scene stuff: ground plane, light "source"]
>
> The simplified data file that I am using now is (layer1.dat):
>
> 2
> 0.0 1.0 3
> 0.0 1.0 3
> 1 0 1
> 0 1 0
> 0 0 1
>
> And the .cal file contains:
>
> pos_u = Px;
> pos_v = Py;
>
> What this does is create a brown-ish semi-transparent plane
> with no variations across it. I can only change the trans component
> of the material, and that works properly. When I make the rspec
> or tspec non-zero, I get a "rview: pos_u: undefined function"
> error.
>

Your description is suffering from multiple problems.  First off, the 
transdata is not the type you want to be using, as it only varies the 
specular lobe for highlights from sources, where what you want is 
probably something which varies the transmitted component.  For this, 
you should use the basic trans type in conjunction with a brightdata 
modifier.  The brightdata value will act as a multiplier on the 
specular transmission of the trans material.  See the reference manual 
<http://radsite.lbl.gov/radiance/refer/ray.html> for details.  The 
second error, which the first makes irrelevant, is that you need to 
specify functions for the pos_u and pos_v parameters, even if they 
don't use their arguments:

pos_u(dummy) = Px;
pos_v(dummy) = Py;

Otherwise, the interpreter decides these are variables, and you get the 
error you got when you try to use them.  You didn't see any variation 
because you set the rspec and tspec values to zero, turning off the 
whole directional diffuse calculation.  Since transdata uses its 
function only for the directional diffuse component, there ended up 
being no variation in your results.

I hope this is enough to get you back on the right track.
-Greg