Illegal Power warning

Hi,

I am trying to implement a measured BRDF using the BRTDfunc material type.

In my .cal file, I fit the LaFortune cosine lobe BRDF model for my data to the
diffuse and specular variables.

This seems to work ok in principal (although the results don't look quite
right), but when calculating the specular componets I get the following
warning:

rpict: warning - compute error for BRTDfunc "measured_surface"
rpict: Illegal power

As far as I am aware all the raised powers in my functions are reasonable
values, so I'm not sure why I'm getting this error.
Does any one know what the conditions are that would give rise to this error
(ie, do powers have to be integers for instance)?

Many thanks,
Glen Harding.

···

------------------------------------------------------------
This mail sent through IMP: http://webmail.brad.ac.uk
To report misuse from this email address forward the message
and full headers to [email protected]
------------------------------------------------------------

Hi Glen,

This error occurs when you pass a negative value (it can be very small, such as -1e-11) and raise it to a non-integer power. The result would be a complex number, but of course this doesn't work since a real result is required.

You can play with values using the "icalc" program, and it is even possible to debug a function file to some degree using the "debugcal" script, which uses rtrace to assign the variables described in rayinit.cal.

Good luck,
-Greg

···

From: [email protected]
Date: December 5, 2007 10:05:28 AM PST

Hi,

I am trying to implement a measured BRDF using the BRTDfunc material type.

In my .cal file, I fit the LaFortune cosine lobe BRDF model for my data to the
diffuse and specular variables.

This seems to work ok in principal (although the results don't look quite
right), but when calculating the specular componets I get the following
warning:

rpict: warning - compute error for BRTDfunc "measured_surface"
rpict: Illegal power

As far as I am aware all the raised powers in my functions are reasonable
values, so I'm not sure why I'm getting this error.
Does any one know what the conditions are that would give rise to this error
(ie, do powers have to be integers for instance)?

Many thanks,
Glen Harding.

Hi Greg,

Thanks for the reply.

I've solved the Illegal Power problem by setting some constraints on my
values when fitting the model to the data.

However, I seem to have run into a different problem when implementing the
model:

I need to calculate the relevant values for rbrtd(x,y,z), gbrtd(x,y,z) and
bbrtd(x,y,z) in my BRTDfunc function file.
In order to calculate the values using the Lafortune cosine lobe model (with
parameter fitted to my measured data) I need to find the angle between the
surface and the incoming ray from the light source.
Unfortunately when I try to do this, like so:

angle(x,y,z) = Asin(x*Nx + y*Ny + z*Nz);

I get an error, saying that x is an unknown variable (and so presumably are
y and z).

Is there a way of getting the light source vector when using BRTDfunc?

Thanks,
Glen.

Glen Harding

Division of Optometry

University of Bradford

Bradford, BD7 1DP.

Tel: 07969 797391

Hi Glen,

You need to pass the paramters given by BRTDfunc to its function calls explicitly. The x, y, and z values are not defined globally. See the attached .cal file as a simple example of how this is done.

If your refllection color changes as a function of angle, you need to stick with the BRTDfunc type, as metfunc only offers a single color for highlights. Keep in mind also that Radiance cannot calculate directional-diffuse components for anything other than highlights (i.e., light source reflections). This is a limitation in Radiance's ability to sample BSDFs in general, and has been covered previously in numerous posts.

-Greg

tim1.cal (692 Bytes)