|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|