POV-Ray : Newsgroups : povray.binaries.images : Smooth height field normal bug found and fixed : Re: Smooth height field normal bug found and fixed Server Time
14 Aug 2024 13:15:54 EDT (-0400)
  Re: Smooth height field normal bug found and fixed  
From: Slime
Date: 8 Oct 2002 17:39:05
Message: <3da35079$1@news.povray.org>
> This is great! Magnificient!


Hee hee, thanks =) I was *very* glad to find the solution after 2 days of
frustration.

> I still remember all those long discussions about
> reworking the entire code etc... I guess it was just
> in the nature of the bug that everyone assumed it
> to be working correctly, and that some calculation
> discrepancies were the cause, and checking these
> would surely mean that the code would have to be
> redone in an entire different way...

I guess that conversation was back during 3.1, I wasn't here for it...

> I mean, think about: Calculate the normals, normalize
> them, done... Who would expect that there's a mistake
> in that assumption?

Yeah, and in fact, there isn't really anything wrong with it. The reason for
the artifact is that interpolating normals isn't really an exact science. It
just happens to create a nice effect when done linearly. The transformation
after interpolation was causing it to be nonlinear, sorta, but it was still
interpolated. Just not quite like we wanted it to be. It's one of those
cases where the algorithm is doing exactly what you intend it to, but the
final result isn't exactly what you expected.

At first I thought it was a problem with the loss of data when typecasting
from double to short, but it turns out that that's hardly noticeable.
(however, since most of the normals tend to have a Y value that's extremely
small, it's not entirely unnoticeable, and I'm going to look for a way to
store the data differently so that there's no visible difference between
doubles and shorts. The screenshot I showed used doubles to store the normal
vectors.)

> So, will this make it into POV-Ray 3.5a or 3.51?
> :-)

Heh, well, I'm not a member of the POV team, so of course I don't know, but
if anyone desparately needs this fix for their IRTC entry, I'm willing to
hand out the code. In the meantime, I'm working on other things too, and I
plan to release a small patch of some sort with this, the normal accuracy
bugfix that I mentioned in povray.programming, 4D noise, and a couple other
things that I'm working on.

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


Post a reply to this message

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