[Radiance-general] Radiance animation questions

Greg Ward [email protected]
Tue, 16 Dec 2003 19:49:28 -0800


Hi Zack,

Nice animation, even with the path problems.  This is quite a model.   
I'll address your questions inline...

> From: Zack Rogers <[email protected]>
> Date: December 16, 2003 4:48:18 PM PST
>
> Hello group,
>
> I am attempting my first full blown Radiance animation and have  
> several related questions.  This link has a rough version of the  
> animation, done with -ab 0.
>
> http://www.archenergy.com/downloads/pub/images/Radiance/ 
> walkthrough_init3.mov
>
> and yes, i seem to trip up the curb, have several neck spasms, and  
> stare at a wall at one point....all have since been fixed but this  
> leads to my first question.
>
> 1.) What programs do people use to produce animation paths?  I  
> initially wanted to use rshow but couldn't get it working on our Suse  
> 8.2.  I understand programs like maya, studio vis, form-z?? have the  
> ability to generate these animations paths but are too much  
> (expensive) for what I need.  It would be nice to be able to just  
> export my spline path from autoCAD and then have the ability to adjust  
> frames/sec, slow down portions of the path, and adjust the view  
> direction throughout.

I posted something to the list about a year ago on generating animation  
paths, which I've attached to this message.  Perhaps this can help.

> 2.) There are portions of this path that I want to slow down and I  
> wanted to use pinterp to interpolate some extra frames.  How can I  
> generate a z-buffer file for a view without recreating the picture?  I  
> thought I could just run it at very low settings if nothing else.  And  
> yes, I am running ranimate using the windows version (our linux  
> machines were filled up with CFD calcs at go time and I was forced to  
> use our NT machines - btw: ranimate does not work on XP - error  
> "Windows socket operations not supported") and it is giving errors  
> using INTERPOLATE and MBLUR which would have created the zbf files  
> automatically.  Hence, I was planning on using pinterp afterwards to  
> achieve interpolation but now I have no z-buffer files.  which leads  
> to my next questions....

You can take out all your light sources, and this should give you a  
fast rendering of the z-buffer if that's all you're after.  With one  
source (the sun) and no indirect, there shouldn't be much difference  
from rendering all over, though.  (Also set -st 1 to avoid specular  
sampling -- then it's just like ray casting, really.)

> 3.) Where is pinterp?  I just installed the HEAD version on our linux  
> machines (yes, its been a while since I last dabbled in the linux  
> release) and i can't find pinterp.  It shows up in the man pages but  
> not in the bin directory.  BTW - pinterp does not seem to work in the  
> windows version either.

Beats me.  It should compile OK -- maybe you had a problem with ra_tiff  
or something and the files in src/px weren't installed as a result.  Go  
into src/px and run "rmake -k install" manually to see what happens.

> 4.) So, we then tried to install the last official release 3.5 and it  
> gave us a bunch of errors.  The error log is here.  Help!
>
> http://www.archenergy.com/downloads/pub/images/Radiance/installLog.txt

There's no fixing the 3.5 build on Linux at this point.  You have to  
work from the binaries or the HEAD -- sorry!

> 5.) Using an ambfile does not seem to be doing much for my animation  
> times?  I was expecting a big decrease in calc time the further i got  
> into my animation but at about 5/6 through it has not sped up much.   
> It has been building the ambient file the whole time, although it is  
> only 7MB after roughly 1000 frames, which seems too small (10  
> panoramic views I've been running on a different machine already has  
> an ambient file of 7MB).  Here is what one of my ranfiles looks like:
>
> DIRECTORY = anim/walkthrough_sect2
> VIEWFILE = anim_path2.pts
> START = 311
> END = 622
> OCTREE = octrees/bc.oct
> RESOLUTION = 768
> render = -av 2.5 2.5 2.5 -ar 46 -aa .1 -ad 4096 -as 2048 -ab 1 -af  
> ambfiles/bc.amb
> render = -dp 512 -ds .3 -dj 0 -dt 0.2 -dr 1 -dc .5
> render = -lr 6 -lw .002 -sj .9 -st 0.01

The time reduction after the first frame isn't noticeable as it doesn't  
progress much from there -- each new frame adds incrementally to the  
ambient file.  You are still much better off than not using one (MUCH),  
but don't expect your rendering times to continue decreasing as the  
animation progresses.

> 6.) Any suggestions on the parameters used?  I am no expert on  
> optimizing parameters.  These parameters give me a fairly good image  
> with about 1/2 hour calc time (which was the speed needed to meet  
> deadline).  But there are still a few splotches, the light from my  
> electric lights is a little too crisp, and I am not too happy with the  
> specular reflections.  You can see the quality I am getting in one of  
> the final images here:
>
> http://www.archenergy.com/downloads/pub/images/Radiance/frame741.tif

Looks pretty good to my eyes.  You could improve rendering times by  
removing some of the fussy details from the ambient calcultion with an  
ambient exclude file (-aE mat_excl.txt option).  I would remove the  
window frames in particular.  You might also increase your -ar value,  
as 45 seems very low for a model of this size, especially with all the  
exterior geometry.  I think you're losing resolution on the  
interreflection calculation as a result.  Divide the octree cube size  
(getinfo -d octree) by the length of your arm in your world  
coordinates, and that should give you a reasonable number.

> 7.) As can be seen, I have many curved surfaces in this model most of  
> which have been faceted.  I would like to use a function to smooth the  
> shading on these.  Is there any way to do this given the geometry is  
> already built?  Something like the Phong shading -s option in gensurf  
> or maybe with the new mesh primitive???  I apologize for my ignorance  
> on this topic, I rarely require this much detail.  I'm imagining a  
> modifier or something I could give to the polygons I want to smooth  
> over.

gensurf will take an ordered list of vertices on a grid and interpolate  
normals, but without simple connectivity, there's no general way to do  
this for an arbitrary mesh.  Obj2mesh won't do it either -- normals and  
(u,v) need to be specified on the input if you want them in your  
output.  You can pass the output of the new version of gensurf with the  
-o option to obj2mesh, however.

> 8.) I was initially mapping wood grain onto a lot of the interior wood  
> surfaces but given the varying distances of the wood I could never get  
> it to look very good.  When it looked good up close, it looks like  
> particle board far away.  And when it looks good far away (ie larger  
> scale) it looks like a zebra up close.  I would like to have the grain  
> at the correct scale, but don't want it looking like particle board  
> (i'm assuming this is just cause there are limited number of pixels to  
> display this detail).  What strategies have others used to get a good  
> looking pattern at varying distances?  Also, I would like to map the  
> textures better onto these surfaces rather than using xgrain,  
> ygrain...etc.  How could this be done?

Regarding sampling errors, you can use the fade(near_val,far_val,T)  
function defined in rayinit.cal to use an average value at distances.   
Otherwise, you have to rely on oversampling to clear up these problems,  
which we know is expensive.

Regarding arbitrary mapping onto surfaces, I don't have a good solution  
for woodgrain, which is a solid texture.  You sort of have to decide  
what the general orientation of your object is, or it's not going to  
look right.  The only other option is to get (u,v) coordinates into a  
.OBJ model and export through obj2mesh.

> Sorry for the long e-mail and so many questions clumped into one and  
> the various tangents my questions may have took.
>
> Best Regards,
> Zack
>

---- From radiance-general archives ----

Date: Wed, 27 Nov 2002 10:04:58 -0800
From: Greg Ward <[email protected]>
To: [email protected]
Subject: Re: how to specify the animation path

Hi Gurneet,

There really needs to be a FAQ on generating animation paths.  Peter
Apian-Bennewitz wrote a program called rshow that may be used to
interactively walk through a space using OpenGL rendering, and has
options for storing keyframes and generating view sequences, which may
then be rendered in batch mode or using ranimate.

I often choose keyframes myself in rview (or the new rholo program),
utilizing the "view" or 'V' commands to output views at desired points
along the animation path.  These may then be constructed into a path
using a spline generator or the spline.cal program that may be found in
ray/src/cal/cal in the radiance distribution.  You take the views
output by rview or rholo, which look like so (these are not commands --
they are views stored by rview into a file):

rview -vtv -vp 5.46 15.5 4.2 -vd 0.91674 0.347628 -0.196833 -vu 0 0 1  
-vh 60 -vv 49 -vs 0 -vl 0 -t 1
rview -vtv -vp 10.5 15.6 4.2 -vd 0.9896 -0.1408 -0.0294619 -vu 0 0 1  
-vh 60 -vv 49 -vs 0 -vl 0 -t 2
rview -vtv -vp 20.4 13.7 4.2 -vd 0.680414 -0.680414 -0.272166 -vu 0 0 1  
-vh 60 -vv 49 -vs 0 -vl 0 -t 4

The -t options at the end were added manually, indicating the expected
distance (in seconds) between the previous frame and this one.  These
options may be added within rview may appending them to the view
command, like so:

: view key.vf -t 2

Once you have the above file (key.vf), you can create a format file for
rcalc to extract the values you are interested in, and pass these to
the tabfunc program to get them into the form you need for spline.cal.
Create a file called "key.fmt" that contains the following single line:

rview -vtv -vp ${px} ${py} ${pz} -vd ${dx} ${dy} ${dz} -vu 0 0 1 -vh  
${vh} -vv ${vv} -vs 0 -vl 0 -t ${t}

Then, run the following command to extract the desired values from your
keyframe file and put them into a form that may be passed to rcalc as a
.cal file:

% rcalc -i key.fmt -e
'$1=recno;$2=px;$3=py;$4=pz;$5=dx;$6=dy;$7=dz;$8=vh;$9=vv;$10=t' key.vf  
\
	| tabfunc Px Py Pz Dx Dy Dz H V T > key.cal

This new file, "key.cal", may then be used with rcalc to generate a set
of desired inbetween views, spaced evenly in time.  If your total sum
of times is 30 seconds, for example, and you want to render 10
frames/sec, you might use the following command to generate the
individual frame views for ranimate:

% cnt 300 | rcalc -o key.fmt -f key.cal -f spline.cal -e 't=$1/10' \
	-e  
'px=s(Px);py=s(Py);pz=s(Pz);dx=s(Dx);dy=s(Dy);dz=s(Dz);vh=s(H);vv=s(V)'  
 > anim.vf

In this command, I have used the same "key.fmt" file to generate the
animation views, but you may want to produce something slightly
different, which had only the changing view point and direction, for
example.  The above sequence allows you to vary the view position,
direction, and zoom, but does not permit the up vector to change.  This
is rarely needed, but if you do have a tilting camera, you can always
modify the commands to include this information.

I hope this is enough to get you started.  Another excellent place to
look for tips is Peter's chapter on animation in "Rendering with
Radiance."

-Greg