POV-Ray : Newsgroups : povray.binaries.images : texture interpolation... why rgb ? : Re: texture interpolation... why rgb ? Server Time
5 Nov 2024 04:23:14 EST (-0500)
  Re: texture interpolation... why rgb ?  
From: Le Forgeron
Date: 29 Nov 2007 15:52:44
Message: <474f269c$1@news.povray.org>
Le 29.11.2007 21:29, Trevor G Quayle nous fit lire :
> Le Forgeron <jgr### [at] freefr> wrote:
>> I had a try with RGB (the pov current way), HSL & HSV. (see attached
>> picture)
>>
> 
> I've been having a look at this.  One problem in your graphic is the
> interpolation of opposite colours in HSV and HSL.
> You are basically interpolating linearly between individual H,S and V/L values.
> The interpolation of H is done in the shortest direction around the
> circumference. This poses a problem because there is no logical way to choose
> the direction to interpolate H around the circumference, as both directions are
> equal in length, so you have chosen to interpolate directly across the colour
> space, which creates a discontinuity (eg: check the interpolation of
> <1,0,0><0,1,1> compared to <1,0,0><0.001,1,1>, they should be virtually
> indistinguishable, but the slight value added to the R value tips the shortest
> route from being undefined to defined).  It would be far better to interploate
> all colours directly across the colour space to remove this discontinuity.

Did you look at my code in p.b.sf ?
H was not linearly interpolated. There is a bit of vectors involved.
RGB or HSV/L: red & cyan mix as a shade of grey. (null saturation)
If one is shorter than, it is defined...
Now, should the path be alike is another problem: at any moment you
will have to choose between the upper path and the lower path...
There is two ways for opposites on a circle. And no good choice.



> 
> A second problem I see is that this really only shows the halfway colour, and
> not the full transition from one to the other.

I did as I could in SDL. Patching lighting.cpp around line 5251 is
an idea I'm not yet ready to perform for a continuous gradation. Not
tonight anyway.
May be next week... but I want more control than changing it from
RGB to HSL/HSV hardcoded.
So reflexion is needed before trying that.

A problem with your picture: it only uses saturated colors. What
about lighter, darker, white & black ?
Mixing a lighter blue & darker blue ? Not a saturated blue in RGB model.

-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

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