POV-Ray : Newsgroups : povray.general : Why the dark triangle? Server Time
5 Nov 2024 07:19:02 EST (-0500)
  Why the dark triangle? (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Shay
Subject: Why the dark triangle?
Date: 10 Aug 2007 02:17:37
Message: <46bc0301@news.povray.org>
camera { location <0,0,-2> look_at <0,0,0> }
background { rgb <1, 1, 1> }
light_source { <0,0,-25> rgb 10 shadowless}

#local Ob1 = smooth_triangle {
<-0.1, 0.5, 0.0>, <0.0, 0.1, 1.0>,
< 0.1, 0.5, 0.1>, <0.0, 0.1, 1.0>,
< 0.0, 0.6, 0.0>, <0.0,-0.1, 1.0>
pigment { rgb <1,0,0> }}

#local c0 = 0; #while ( c0 <= 264 )
	object { Ob1 rotate <c0/4.0, -c0, 0.0> }
#local c0 = c0 + 33; #end

Shows several light and one dark triangle on latest Linux version. This
is just a minimal scene to show the effect; Entire areas of my full
scene are turning black this way.

 -Shay


Post a reply to this message

From: Slime
Subject: Re: Why the dark triangle?
Date: 10 Aug 2007 03:19:52
Message: <46bc1198$1@news.povray.org>
I didn't take a lot of time to read your code (I'm a little tipsy), but my
immediate reaction is to wonder if it's this:

http://tag.povray.org/povQandT/SmoothTriangleArtifact/index.html

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Shay
Subject: Re: Why the dark triangle?
Date: 10 Aug 2007 11:40:07
Message: <46bc86d7$1@news.povray.org>
Slime wrote:
> I didn't take a lot of time to read your code (I'm a little tipsy),
> but my immediate reaction is to wonder if it's this:
> 
> http://tag.povray.org/povQandT/SmoothTriangleArtifact/index.html
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
> 

Possibly, but double_illuminate does not correct the problem.

 -Shay


Post a reply to this message

From: Alain
Subject: Re: Why the dark triangle?
Date: 10 Aug 2007 15:21:58
Message: <46bcbad6$1@news.povray.org>
Shay nous apporta ses lumieres en ce 2007/08/10 11:40:
> Slime wrote:
>> I didn't take a lot of time to read your code (I'm a little tipsy),
>> but my immediate reaction is to wonder if it's this:
>>
>> http://tag.povray.org/povQandT/SmoothTriangleArtifact/index.html
>>
>>  - Slime
>>  [ http://www.slimeland.com/ ]
>>
>>
> 
> Possibly, but double_illuminate does not correct the problem.
> 
>  -Shay
double_illuminate can reduce the problem, not remove it.
Your problem triangle may be shadowed on it's back by another one.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you've gained twenty pounds 
sitting at the computer, but can't tell because your beard covers your stomach.
Taps a.k.a. Tapio Vocadlo


Post a reply to this message

From: Tim Attwood
Subject: Re: Why the dark triangle?
Date: 10 Aug 2007 18:21:30
Message: <46bce4ea$1@news.povray.org>
> #local Ob1 = smooth_triangle {
> <-0.1, 0.5, 0.0>, <0.0, 0.1, 1.0>,
> < 0.1, 0.5, 0.1>, <0.0, 0.1, 1.0>,
> < 0.0, 0.6, 0.0>, <0.0,-0.1, 1.0>
> pigment { rgb <1,0,0> }}
>
> #local c0 = 0; #while ( c0 <= 264 )
> object { Ob1 rotate <c0/4.0, -c0, 0.0> }
> #local c0 = c0 + 33; #end
>
> Shows several light and one dark triangle on latest Linux version. This
> is just a minimal scene to show the effect; Entire areas of my full
> scene are turning black this way.

OK, first things first. Your normals in your smooth_triangle
are not normalized unit lengths, they should be unit length.

Secondly, the normal of your smooth_triangle points away from
the camera when it's not rotated. We're looking at the "inside",
the curve cups instead of bulging, it's supposed to be darker in
cupped spots at some angles. The normals should all point
outward on an object.

Third, your normals are all tilted in the same directions, in other
words, the normals are conveying that this triangle is part
of a "wrinkle" area, besides just being cupped.
The normal of a flat triangle ABC can be figured as
vcross(A-C,B-C). The normal of a point on a smoothed
section (not on a seam) of a mesh made of smooth_triangles
should be the average normal of the adjacent triangles.

Fourth, you are using a bright light which increases the
falloff of the shading in objects. If you don't want your
object to be shaded, use finish{ambient 1}.


Post a reply to this message

From: Shay
Subject: Re: Why the dark triangle?
Date: 11 Aug 2007 01:18:31
Message: <46bd46a7@news.povray.org>
Tim Attwood wrote:
> 
> OK, first things first.
> Secondly
> Third
> Fourth

Thank you, but none of this makes a difference. The same thing can
happen with every normal set to <0,0,-1> ( a flat triangle ). Take a
look at my "high school math" post in p.b.i and you will see that there
are shadows which aren't.

 -Shay


Post a reply to this message

From: Warp
Subject: Re: Why the dark triangle?
Date: 11 Aug 2007 03:52:10
Message: <46bd6aa9@news.povray.org>
Tim Attwood <tim### [at] comcastnet> wrote:
> OK, first things first. Your normals in your smooth_triangle
> are not normalized unit lengths, they should be unit length.

  Says who?

  Smooth triangles can have normals of any length. It doesn't matter what
their length is. (AFAIK povray normalizes them internally when it parses
the smooth triangle.)

> Secondly, the normal of your smooth_triangle points away from
> the camera when it's not rotated. We're looking at the "inside",
> the curve cups instead of bulging, it's supposed to be darker in
> cupped spots at some angles. The normals should all point
> outward on an object.

  Why can't a triangle "cup in"? It can be part of a concave surface.
Not all surfaces are convex.

> Third, your normals are all tilted in the same directions, in other
> words, the normals are conveying that this triangle is part
> of a "wrinkle" area, besides just being cupped.
> The normal of a flat triangle ABC can be figured as
> vcross(A-C,B-C). The normal of a point on a smoothed
> section (not on a seam) of a mesh made of smooth_triangles
> should be the average normal of the adjacent triangles.

  "Should be"? Calculating the average of the normal vectors of adjacent
triangles is just one algorithm for automatically smoothing a mesh. It's
in no way the only "correct" way of doing it. It's just one way.
  There's no requirement nor reason for limiting vertex normals to be
the average of the triangle normals of adjacent triangles. The vertex
normals can be calculated in other ways too, for alternative lighting.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Why the dark triangle?
Date: 11 Aug 2007 03:54:01
Message: <46bd6b19@news.povray.org>
Shay <shay@s.s> wrote:
> Possibly, but double_illuminate does not correct the problem.

  How about "no_shadow"?

-- 
                                                          - Warp


Post a reply to this message

From: Grassblade
Subject: Re: Why the dark triangle?
Date: 11 Aug 2007 06:25:00
Message: <web.46bd8dc6877f21f6364ceeb90@news.povray.org>
Shay <shay@s.s> wrote:
> camera { location <0,0,-2> look_at <0,0,0> }
> background { rgb <1, 1, 1> }
> light_source { <0,0,-25> rgb 10 shadowless}
>
> #local Ob1 = smooth_triangle {
> <-0.1, 0.5, 0.0>, <0.0, 0.1, 1.0>,
> < 0.1, 0.5, 0.1>, <0.0, 0.1, 1.0>,
> < 0.0, 0.6, 0.0>, <0.0,-0.1, 1.0>
> pigment { rgb <1,0,0> }}
>
> #local c0 = 0; #while ( c0 <= 264 )
>  object { Ob1 rotate <c0/4.0, -c0, 0.0> }
> #local c0 = c0 + 33; #end
>
> Shows several light and one dark triangle on latest Linux version. This
> is just a minimal scene to show the effect; Entire areas of my full
> scene are turning black this way.
>
>  -Shay
I get one dark triangle on Windows version too. If you reduce the light's
rgb to 3 or less you'll see a number of other triangles turning dark. On
the other hand if you shoot it up to 100, the triangle that is currently
dark will have only a small dark zone near one vertex. Moving the light
elsewhere causes other triangles to go dark, so the "problem" is evidently
due to interaction between the light source and smooth triangle normals.
I'm pretty sure everything is working as intended.


Post a reply to this message

From: Tim Attwood
Subject: Re: Why the dark triangle?
Date: 11 Aug 2007 07:06:17
Message: <46bd9829$1@news.povray.org>
> Thank you, but none of this makes a difference. The same thing can
> happen with every normal set to <0,0,-1> ( a flat triangle ). Take a
> look at my "high school math" post in p.b.i and you will see that there
> are shadows which aren't.

A normal of <0,0,-1>  is not flat in this instance, since the
triangle is at a different angle.  It's not enough that the
three normals be the same, they need to match the triangle too.

That said, even a flat triangle will show up dark at some angles,
it's supposed to be that way. The fact that you are using a bright
light increases the falloff of the shading so that many of the triangles
are saturated, and the shaded ones are dark by comparison.


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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