POV-Ray : Newsgroups : povray.advanced-users : Gouraud Shading??? Server Time
25 Nov 2024 14:39:12 EST (-0500)
  Gouraud Shading??? (Message 1 to 7 of 7)  
From: annelize
Subject: Gouraud Shading???
Date: 30 Aug 2002 22:35:03
Message: <web.3d702a8b215c86447aca4b930@news.povray.org>
Hi
I just started learning Pov-Ray and I'm trying out different things. Is
tehre any way I can create Gouraud Shading ??

annelize :-)


Post a reply to this message

From: Tim Nikias
Subject: Re: Gouraud Shading???
Date: 31 Aug 2002 06:26:24
Message: <3d7099d0$1@news.povray.org>
Gouraud Shading may be used with smooth-triangles,
look it up in the docs.

Essentially, you give a corner for a triangle plus
a surface normal for every corner, like this:

smooth_triangle{
 Corner_1, Normal_1, Corner_2,Normal_2, Corner_3,Normal_3
}

POV-Ray will interpolate the normals on the surface.
Its supposedly best to have the normals be unit-length-vectors,
which can be easily achieved with vnormalize().

That's just a rough outline, the docs explain a little more in detail.

Regards,
Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
"annelize" <ann### [at] tiscalidk> schrieb im Newsbeitrag
news:web.3d702a8b215c86447aca4b930@news.povray.org...
> Hi
> I just started learning Pov-Ray and I'm trying out different things. Is
> tehre any way I can create Gouraud Shading ??
>
> annelize :-)
>


Post a reply to this message

From: Warp
Subject: Re: Gouraud Shading???
Date: 31 Aug 2002 07:23:56
Message: <3d70a74b@news.povray.org>
Tim Nikias <tim### [at] gmxde> wrote:
> smooth_triangle{
>  Corner_1, Normal_1, Corner_2,Normal_2, Corner_3,Normal_3
> }

  That does not do Gouraud shading.

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


Post a reply to this message

From: Herman Serras
Subject: Re: Gouraud Shading???
Date: 31 Aug 2002 07:42:45
Message: <3D70ABDD.38ED44F4@pandora.be>
Warp wrote:
> 
> Tim Nikias <tim### [at] gmxde> wrote:
> > smooth_triangle{
> >  Corner_1, Normal_1, Corner_2,Normal_2, Corner_3,Normal_3
> > }
> 
>   That does not do Gouraud shading.

In the Gouraud model in each vertex of all triangles a normal is
defined. Using this normals the light intensity in the vertices is
determined and the light intensity in each point of a triangle is an
interpolation of the light intensities in the vertices. The Gouraud
model uses an interpolation of LIGHT INTENSITIES.
In the Phong model (smooth triangles) in each vertex of all triangles a
normal is defined. Using this normals the normal in eacht point of a
triangle is an interpolation of the normals in the vertices. The Phong
model (smooth triangles) uses an interpolation of NORMALS. This model is
better adopted to handle reflection, etc...
> 
> --
> #macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
> N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
> N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -

-- 
Herman Serras
Gent (Belgium)
http://cage.rug.ac.be/~hs/


Post a reply to this message

From: Tim Nikias
Subject: Re: Gouraud Shading???
Date: 31 Aug 2002 10:32:09
Message: <3d70d369@news.povray.org>
Well. What can I say?

Bad me.

*slaps his head, runs against the wall, and ducks from the
neighbour throwing something*

:-)

Still, I think the effect is almost the same, isn't it?

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

>
> In the Gouraud model in each vertex of all triangles a normal is
> defined. Using this normals the light intensity in the vertices is
> determined and the light intensity in each point of a triangle is an
> interpolation of the light intensities in the vertices. The Gouraud
> model uses an interpolation of LIGHT INTENSITIES.
> In the Phong model (smooth triangles) in each vertex of all triangles a
> normal is defined. Using this normals the normal in eacht point of a
> triangle is an interpolation of the normals in the vertices. The Phong
> model (smooth triangles) uses an interpolation of NORMALS. This model is
> better adopted to handle reflection, etc...


Post a reply to this message

From: Niki Estner
Subject: Re: Gouraud Shading???
Date: 31 Aug 2002 11:25:59
Message: <3d70e007@news.povray.org>
> Still, I think the effect is almost the same, isn't it?

Nope, it's completely different.
Interpolating normals, you can get highlights in the middle of a triangle.
Gourond-Shading the same triangle would give a dull, dark triangle.
Highlights can hardly be rendered with gourond shading. (only with many
small triangles, so the highlight is close enough to one of the vertices)
Also, gourond shading doesn't combine good with reflection/refraction etc.
I don't think anyone ever used gourond-shading in a raytracer, since it
doesn't make much sense...


Post a reply to this message

From: Mark Wagner
Subject: Re: Gouraud Shading???
Date: 1 Sep 2002 00:13:17
Message: <pan.2002.09.01.04.10.57.126591.215@gte.net>
On Sat, 31 Aug 2002 10:33:24 -0400, Tim Nikias quoth:

> Well. What can I say?
> 
> Bad me.
> 
> *slaps his head, runs against the wall, and ducks from the neighbour
> throwing something*
> 
> :-)
> 
> Still, I think the effect is almost the same, isn't it?

Nope.  In general, Phong shading is slower and higher-quality than
Gouraud shading.  The Phong shading model is much better for things like
specular highlights.

-- 
Mark


Post a reply to this message

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