POV-Ray : Newsgroups : povray.general : Povray 3DNow! optimized : 3DNow and its applications in 3D (was: Re: Povray 3DNow! optimized) Server Time
13 Aug 2024 03:11:21 EDT (-0400)
  3DNow and its applications in 3D (was: Re: Povray 3DNow! optimized)  
From: Chris Maryan
Date: 21 Nov 1998 23:30:44
Message: <365793E4.DEA09D73@geocities.com>
gilberto wrote:
> 
> 3DNow! can perform 4 floating point instruction in a clock cicle.
> It can hit 1.2 Gflops. 4 times faster than a Pentium II.
> 
> Gilberto

	This is not quite correct, the 3DNow instructions can not perform 4
floating point operations in a single clock cycle, in fact they can not
even complete a single instruction in one clock cycle (Well maybe some
instructions, but not the useful ones, read on). But neither can intel's
chips. An instruction takes several clock cycles to execute, depending
on the processor and the instruction. For example, a multiplication of
two floating point numbers in most modern processors requires
approximately 6 clock cycles, floating point division takes about 40.
	What the 3DNow instructions alow you to do is execute the same
instruction on several pieces of data at the same time, hence saving
time by doing essentially several things at once.
	Why do you want to do this? Well, 3D graphics, for the most part,
depends on one thing, the 3x3 (or is it 3x4 or 4x3, I can never
remember) transform matrix (Actually it's usually extended to 4x4, I'm
not sure why but it seems to have something to do with keeping with the
powers of two thing). By multiplying position vectors in 3D, by a
precalulated matrix, you can rotate, translate, scale and skew the
object that the position vector is a part of. This matrix multiplication
involves a series of multiply and add functions. 3DNow can accelerate
this by grouping some of these multiply and add functions together and
processing them in groups (i.e. grouping two or four floating point
numbers together and processing them as on 3DNow multiply instead of two
traditional multiplies). Admitedly there are other places where 3DNow is
useful, but the matrix multiply is the important one.
	But! The numbers that are being processed in this matrix multiplication
need to be quite well organized, even more so if you plan to process
some of the numbers at the same time (i.e. 3DNow). This is why Quake 2
(or whatever) will not run 4 or even 2 times faster on a K6-2 300 than a
PII 300 (alright, that's not the only reason but it contributes).
	So why won't 3DNow be useful in POV? POVRay does use the matrix
multiply and a lot of other floating point math; however, the way in
which it is written is not arranged well for combining numbers into
something usable by 3DNow. Also, most of the processing needed in povray
is used in the raytracing process, my limited knowledge of the
ray-casting/intersection-testing process tells me that this uses very
few things that could be usable by 3DNow.

At this point I must bring my ranting and raving to a close, those
seeking greater enlightenment should either email me or send me money.
Both are acceptable, cash is prefered.

 
Chris Maryan
mailto:cma### [at] geocitiescom
***
Will work for cash.
***
Email me if you are interested in donating
to the Chris Maryan needs money fund.
We will also accept donations to the Chris
needs a Pentium II or SGI workstation 
fund and the Chris needs a car fund.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.