[Bf-committers] Normalise patch - don't apply it

Nathan Vegdahl cessen at cessen.com
Thu Feb 9 18:55:09 CET 2006

Yeah, that makes sense.  Okay, I agree, we shouldn't use my patch.

(Jump forward about ten minutes...)

    I just did some tests to verify previous results of mine, and they 
weren't verified.  So, yeah, I have no problem at all with leaving the 
code as-is now.  For those who are curious, here's the thing that 
happened to motivate my changing it in the first place:

Anyway, aside from that there's still something odd going on.

Take a look at these debug renders:


Both renders are simply blasting out bump-mapped normals to the RGB 
channels (i.e. X->R, Y->G, Z->B).  In both cases the Normalise function 
was the last thing done to the vectors before they were blasted.
    The first one uses the existing  code, the second one uses my 
so-called "fix".

    Regardless of the source of these vectors, with the existing code 
they should have either been valid normals (nice clean RGB values) or 
they should have been null vectors (solid black).  Instead we have 
patches of noise outlined by distorted normals.
    And remember, the only difference between the two images is the 
"fix" to the Normalise function.

    I guess it was just a fluke, because I can't seem to reproduce it. 
I swear the only thing I changed was the Normalise function.  But it's 
working now... so, yeah.  Let's leave it as is.  Sorry for all the ruckus.

--Nathan "Cessen" Vegdahl

Michael Reimpell wrote:
>>It was setting
>>super-small vectors to <0,0,0>, which really isn't a good behavior for
>>something that's supposed to return vectors of length 1.
> The normalise function is _not_ supposed to return a vector of unit length for 
> the zero element of the vector space! Mapping 0 to 0 is the most reasonable 
> mapping. Translation, e.g., 0 -> (0,0,1), has nothing to do with 
> normalisation! Of course this applies to all floating point representations 
> of the zero element, i.e., all vectors of length below a certain threshold.
> Regards,
> Michael
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list