POV-Ray : Newsgroups : povray.general : Raytracing vs Scanline Server Time
7 Aug 2024 19:20:54 EDT (-0400)
  Raytracing vs Scanline (Message 1 to 8 of 8)  
From: Nekar Xenos
Subject: Raytracing vs Scanline
Date: 1 Jun 2001 07:31:15
Message: <3b177d03@news.povray.org>
Another dumb question. With all this talk about scanline rendering, I have
difficulty visualising how it differs from raytracing. Could someone maybe draw
me up a diagram to show the difference? Maybe a side view of a sphere and how
the  ray is reflected,etc.

Thanks,

--
/* Nekar Xenos */#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);
blob{#while((K-N).x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(
vlength(N-K)<vlength(X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N
,1,1 scale.02}sphere{<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1
scale.01 }#end pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 07:54:00
Message: <3b178258$1@news.povray.org>
In article <3b177d03@news.povray.org> , "Nekar Xenos" 
<j-p### [at] citywalkcoza> wrote:

> Another dumb question. With all this talk about scanline rendering, I have
> difficulty visualising how it differs from raytracing. Could someone maybe
> draw me up a diagram to show the difference? Maybe a side view of a sphere and
> how the  ray is reflected,etc.

Look at any 3D video game.  They all use (hardware accelerated of course)
scanline rendering of some sort.

     Thorsten


Post a reply to this message

From: Warp
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 07:59:31
Message: <3b1783a2@news.povray.org>
Nekar Xenos <j-p### [at] citywalkcoza> wrote:
: Another dumb question. With all this talk about scanline rendering, I have
: difficulty visualising how it differs from raytracing. Could someone maybe draw
: me up a diagram to show the difference? Maybe a side view of a sphere and how
: the  ray is reflected,etc.

  Scanline rendering has nothing to do with raytracing. I'll try to list
the differences between raytracing and scanline rendering:

1. Scanline rendering works only with polygons (usually triangles) while
raytracing works only with mathematically defined objects.

2. Scanline rendering works by projecting the vertices of the polygons to
screen-space and then "filling" the 2D-polygons got from this (although
the depth information is used for texturing, z-buffering, etc). Raytracing
works by (mathematically) calculating the intersection of a line and the
mathematically defined object.

3. Due to the nature of scanline rendering reflections are very difficult
to calculate (they have to be "faked" in some way or another, eg. using
proper environment maps) and refraction is almost impossible. Also mutually
reflecting objects are extremely difficult. In raytracing reflection and
refraction are extremely easy to calculate (you just send additional rays).

4. In scanline rendering calculating shadows is not trivial either, but you
have to use rather complicated algorithms. In raytracing it's extremely
trivial. On the other hand, with certain scanline algorithms it's easier
to calculate smooth shadows of area lights accurately than it is in
raytracing (well, relatively speaking, as the shadow calculations are always
more complicated in scanline rendering).

5. Scanline rendering has also other problems which usually don't exist in
raytracing. These include different kinds of perspective correction (textures,
z-information, surface lighting, etc. have all be perspective corrected in
order to get a correct result), hidden surface removal, etc. In raytracing
you usually don't need to worry about perspective correction as, due to the
nature of the raytracing algorithm, you always get the right parameters.

6. Scanline rendering is usually much faster than raytracing (that's why
3D accelerator cards use it). This is because filling a polygon (even
when you need to make complicated perspective correction calculations) is
faster than calculating line-object-intersections with all the things it
needs.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 08:09:42
Message: <3b178606$1@news.povray.org>
"Nekar Xenos" <j-p### [at] citywalkcoza> wrote in message
news:3b177d03@news.povray.org...

<snip>

The following link might be of interest:

http://www.3dgate.com/techniques/000424/0424rendering.html


Post a reply to this message

From: Nekar Xenos
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 08:35:10
Message: <3b178bfe@news.povray.org>
Thanks Warp :)

--
/* Nekar Xenos */#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);
blob{#while((K-N).x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(
vlength(N-K)<vlength(X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N
,1,1 scale.02}sphere{<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1
scale.01 }#end pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}


Post a reply to this message

From: Rick [Kitty5]
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 09:41:21
Message: <3b179b81$1@news.povray.org>
Very nice explanation warp


--
Rick

Kitty5 WebDesign - http://Kitty5.com
Hi-Impact database driven web site design & e-commerce
TEL : +44 (01625) 266358 - FAX : +44 (01625) 611913 - ICQ : 15776037
POV-Ray News & Resources - http://Povray.co.uk

PGP Public Key
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA


Post a reply to this message

From: Gail Shaw
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 10:09:22
Message: <3b17a212@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote in message news:3b1783a2@news.povray.org...
>
>   Scanline rendering has nothing to do with raytracing. I'll try to list
> the differences between raytracing and scanline rendering:
>

<snip explaination>

Thanks, that clears a few things up. Is that in the VFAQ? If not maybe
it should be added.

Gail
*************************************************************************
* gsh### [at] monotixcoza                *   Step into the abyss,           *
* http://www.rucus.ru.ac.za/~gail/   *   and let go.        Babylon 5   *
*************************************************************************
* The difficult we do immediately, the impossible takes a little longer *
*************************************************************************


Post a reply to this message

From: Warp
Subject: Re: Raytracing vs Scanline
Date: 1 Jun 2001 12:24:16
Message: <3b17c1b0@news.povray.org>
Gail Shaw <gsh### [at] monotixcoza> wrote:
: If not maybe it should be added.

  You are completely right. I'll do it when I feel less lazy... ;)

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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