[comp.sys.amiga] DBW-Tracer on UNIX

milo@ndmath.UUCP (Greg Corson) (05/01/87)

Recently I was messing around with the DBW (AMIGA) ray tracing program on a
SUN workstation here at Notre Dame.  The main program (RAY) compiles and runs
just fine here, however there are some things that seem puzzling to me.  The
documents to DBW tracer state the demo program "glass" runs for about 11 hours
on an Amiga.  On the Sun with SKY floating point board it ran 14 hours...the
only reason I can figure is that the Sun version might have automatically 
calculated the picture to greater precision.  If anyone out there has actually
run "glass" on an Amiga I would be interested to see a copy of the output that
comes out at the end of the program run (particularly the number of pixel's 
calculated/guessed info) so I can figure out what's going on here.

The only unfortunate thing is that nobody around here has a high quality color
device to display the pictures on, all the Sun's have monocrome monitors with
no greyscale capability and nobody has any nice frame-buffers or anything along
those lines.  I guess I will have to download the 200k file to an amiga if I want
to see what it looks like.

Anyway, for those who are interested the main ray-tracing program "ray" in the
DBW package (the program that does all the real work of image generation) will
probably run under just about any decent C-compiler on any machine without 
modification.  The thing compiled like a shot on the Sun, no changes required
at all.  The output of the "ray" program should be very easy for anyone to 
convert for display on a good color display.

By the way, please don't write me asking that I send you copies of the DBW tracer
program.  The license on the program states you must distribute only "COMPLETE"
copies with all files and, unfortunately, the copy I have of the distribution
is not complete.  The program is on a lot of on-line services and in users
groups though...so it shouldn't be too hard to find.  Perhaps someone with
a complete copy could post it to net.sources.  Since the program looks like it
could be used on any Unix machine (as well as the Amiga it was designed for) 
I think a lot of people would be interested.

Greg Corson
19141 Summers Drive
South Bend, IN 46637
(219) 277-5306 (weekdays till 6 PM Central)
...seismo!iuvax!ndmath!milo

webber@klinzhai.RUTGERS.EDU (Webber) (05/02/87)

In article <213@ndmath.UUCP>, milo@ndmath.UUCP (Greg Corson) writes:
> Recently I was messing around with the DBW (AMIGA) ray tracing program on a
> SUN workstation here at Notre Dame.  The main program (RAY) compiles and runs
> just fine here, however there are some things that seem puzzling to me.  The
> documents to DBW tracer state the demo program "glass" runs for about 11 hours
> on an Amiga.  On the Sun with SKY floating point board it ran 14 hours...the
> only reason I can figure is that the Sun version might have automatically 
> calculated the picture to greater precision.  If anyone out there has actually

Well, I think you are close to the problem, but got it backwards.  On
most unix systems (including sun) it is faster to work in double
precision than single precision.  This is because all the libraries
are double precision, so anytime you pass a float variable or capture
a result in a float variable, a conversion has to be done.  You can
probably speed things up by changing all your `float' declarations
to be `double' declarations.  (Even when you pass a varible of type
float to a procedure whose formal parameter is declared to be of type
float, it still usually gets converted to double.)

There is also a big difference between a Sun II and a Sun III (as well
as among the various variations of Sun III), so it might be useful if
you were more precise than just saying a `Sun'.

Enjoy.

-------------------- BOB (webber@aramis.rutgers.edu ; rutgers!topaz!webber)

mwm@eris.BERKELEY.EDU (Mike (My watch has windows) Meyer) (05/03/87)

In article <214@brandx.klinzhai.RUTGERS.EDU> webber@klinzhai.RUTGERS.EDU (Webber) writes:
<In article <213@ndmath.UUCP>, milo@ndmath.UUCP (Greg Corson) writes:
<> Recently I was messing around with the DBW (AMIGA) ray tracing program on a
<> SUN workstation here at Notre Dame.  The main program (RAY) compiles and runs
<> just fine here, however there are some things that seem puzzling to me.  The
<> documents to DBW tracer state the demo program "glass" runs for about 11 hours
<> on an Amiga.  On the Sun with SKY floating point board it ran 14 hours...the
<> only reason I can figure is that the Sun version might have automatically 
<> calculated the picture to greater precision.  If anyone out there has actually
<
<Well, I think you are close to the problem, but got it backwards.  On
<most unix systems (including sun) it is faster to work in double
<precision than single precision.  This is because all the libraries
<are double precision, so anytime you pass a float variable or capture
<a result in a float variable, a conversion has to be done.  You can
<probably speed things up by changing all your `float' declarations
<to be `double' declarations.  (Even when you pass a varible of type
<float to a procedure whose formal parameter is declared to be of type
<float, it still usually gets converted to double.)


To quote: No, NO, NO!!!

Anybody who's serious about supporting C fixed their compiler long ago
to have a flag that makes things happen in single precision instead of
double. For the Sun, under SunOS 3.0, that flags is -fsingle. I'd try
that instead. But I'm working on the assumption that DBW will have
declared things as double if he felt they needed double precision.
It's not clear what to check on to verify it, but I suspect that
things will work right with -fsingle. In any case, this is easier than
converting all your floats to doubles, and will make things go even
faster.

Also, for some ungodly reason, the default in that same environment is
to do "software floating-point calls." Not sure what this means, but I
suspect that its software emulation. It looks like you want -fsky if
you can use it, otherwise -fswitch with the environment set right. All
this is for SunOS 3.0 (3.2? not sure where the man pages are coming
from with rman), so check your man pages.

HH: How about working for Apple?
Me: Will they pay me to write Amiga applications?
HH: No.
Me: No.
HH: Well, then, how about Sun?
Me: Will they expect me to support their software?
HH: Yes.
Me: No.

	<mike
--
Take a magic carpet to the olden days			Mike Meyer
To a mythical land where everybody lays			ucbvax!mwm
Around in the clouds in a happy daze			mwm@berkeley.edu
In Kizmiaz ... Kizmiaz					mwm@ucbjade.BITNET

bill@dayton.UUCP (William T. Argyros) (05/04/87)

In article <213@ndmath.UUCP> milo@ndmath.UUCP (Greg Corson) writes:
>Recently I was messing around with the DBW (AMIGA) ray tracing program on a
>SUN workstation here at Notre Dame.  The main program (RAY) compiles and runs
>just fine here, however there are some things that seem puzzling to me.  The
>documents to DBW tracer state the demo program "glass" runs for about 11 hours
>on an Amiga.  On the Sun with SKY floating point board it ran 14 hours...the
>Greg Corson
>...seismo!iuvax!ndmath!milo

What I done with the Glass.dat pic is to set the 
'resolution' (R line) to 999 hours.  This hase the
effect of telling RAY not to guess any of the pixels.
Set this way, it runs almost exactly 30 hours on my
Amiga.  

The thing I want to do now is move the source to 
our IBM 3090 (got Lattice C for System 370 on it)
and see how much this time drops.
	-Bill

-- 
UUCP: rutgers!dayton!bill               Bill Argyros/1060
ATT:  (612) 375-6651                    Dayton-Hudson Dept. Store. Co.
                                        700 on the Mall
                                        Mpls, Mn. 55402

phil@scubed.UUCP (05/05/87)

I ported DBW-Render to a CRAY XMP/24 running Unicos
and the "glass" example runs in 20 mins.  


-- 
Phil Cohen (phil@scubed.arpa, sdcsvax!phil)