|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am aware of the trace macro that returns the intersection point and normal at
that point on a object given a ray (point and direction). But is there a way to
get the colour?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Paul Bourke" <pau### [at] gmailcom> wrote:
> I am aware of the trace macro that returns the intersection point and normal at
> that point on a object given a ray (point and direction). But is there a way to
> get the colour?
Hi Paul!
Good to see you on here.
In functions.inc, there is eval_pigment which returns the pigment at any given
vector location.
Pre defined functions
eval_pigment(Pigm, Vect): This macro evaluates the color of a pigment at a
specific point. Some pigments require more information than simply a point,
slope pattern based pigments for example, and will not work with this macro.
However, most pigments will work fine.
Parameters:
Vect = The point at which to evaluate the pigment.
Pigm = The pigment to evaluate.
Thanks for all of the information you've posted over the years - it's been a
great help as well as an inspiration.
Bill Walker
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 27.10.2018 um 13:16 schrieb Paul Bourke:
> I am aware of the trace macro that returns the intersection point and normal at
> that point on a object given a ray (point and direction). But is there a way to
> get the colour?
If by "colour" you mean apparent colour (as it would appear in the
output image), the answer is a clear "nay".
If by "colour" you mean pigment, the answer is "well, sort of"; you can
use the `eval_pigment` function Bald Eagle mentioned already, but you'll
have to separately keep track of transformations and stuff, POV-Ray
doesn't do that for you. Also, `eval_pigment` doesn't work with pigments
that depend on properties of the object surface, the ray, or interaction
betweent the two, such as pigments using the `slope` or `aoi` patterns.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
eval_pigment returns the 'linear' color of an object, not a gamma-bent color
(i.e., not at gamma 2.2.) I.e., it returns an rgb color, not an srgb one. If the
*original* color of your object was chosen to be srgb <...> rather than rgb, and
you want to use the returned srgb equivalent in your scene or for some other
purpose, the result should be used as srgb <0.2,0.5,0.75>, for example, not rgb
<...>.
But if your original color was rgb <...>, then eval_pigment will return that
same color.
As Clipka noted, eval_pigment doesn't take into account the *illumination* of
the object-- lighting, shadow, phong, etc--, just the basic strict color found
there.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 18-10-28 à 12:50, Kenneth a écrit :
> eval_pigment returns the 'linear' color of an object, not a gamma-bent color
> (i.e., not at gamma 2.2.) I.e., it returns an rgb color, not an srgb one. If the
> *original* color of your object was chosen to be srgb <...> rather than rgb, and
> you want to use the returned srgb equivalent in your scene or for some other
> purpose, the result should be used as srgb <0.2,0.5,0.75>, for example, not rgb
> <...>.
>
> But if your original color was rgb <...>, then eval_pigment will return that
> same color.
>
> As Clipka noted, eval_pigment doesn't take into account the *illumination* of
> the object-- lighting, shadow, phong, etc--, just the basic strict color found
> there.
>
>
>
>
Also, it probably won't work for UV mapped textures.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Paul Bourke" <pau### [at] gmailcom> wrote:
> I am aware of the trace macro that returns the intersection point and normal at
> that point on a object given a ray (point and direction). But is there a way to
> get the colour?
What do you have in hands to determine the intersection point?
there lies a solution for some of the mentioned limitations - in combination
with a mesh camera.
Norbert
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Paul Bourke" <pau### [at] gmailcom> wrote:
> I am aware of the trace macro that returns the intersection point and normal at
> that point on a object given a ray (point and direction). But is there a way to
> get the colour?
I want this function, too. But I want it for UV map...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 10/11/2018 à 05:20, And a écrit :
> "Paul Bourke" <pau### [at] gmailcom> wrote:
>> I am aware of the trace macro that returns the intersection point and normal at
>> that point on a object given a ray (point and direction). But is there a way to
>> get the colour?
>
> I want this function, too. But I want it for UV map...
>
>
UV mapping of object does make sense (in term of trace), but I'm still
perplex about getting the colour...
There could be more than a single texture (layered), or a complex
texture, and there is finish too which can interfere (a white pigment
with a mirror finish reflecting a complex environment).
So, when asking for "colour" at intersection point, what is expected ?
#1: the colour (<r,g,b>) of the point as it would appear on a rendered
image (e.g. a white sphere in the dark would return black)
#2: the intrinsect colour(<r,g,b>) of the object at that point (e.g. a
white sphere in the dark would return white)
(Yes, I'm repeating C.Lipka's question, because it went unanswered)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 10/11/2018 04:20, And wrote:
On 11/11/2018 08:43, Le_Forgeron wrote:
>> I want this function, too. But I want it for UV map...
>>
>>
> UV mapping of object does make sense (in term of trace), but I'm still
> perplex about getting the colour...
>
> There could be more than a single texture (layered), or a complex
> texture, and there is finish too which can interfere (a white pigment
> with a mirror finish reflecting a complex environment).
>
> So, when asking for "colour" at intersection point, what is expected ?
> #1: the colour (<r,g,b>) of the point as it would appear on a rendered
> image (e.g. a white sphere in the dark would return black)
> #2: the intrinsect colour(<r,g,b>) of the object at that point (e.g. a
> white sphere in the dark would return white)
>
I’ve thought about this in the past.
I think that your option #1 is too complicated. It seems to me that it
would involve a secondary raytracing operation with maybe a limit to the
depth of reflective and/or refractive bounces. (Sorry, I don’t have the
right vocabulary.)
Option #2 is closer to what I would find useful. If “trace” also
returned the RGB* value of the uv image map at the point of intersection
of the object by trace. That would be usable.
* Also filter and transmit values, if possible.
> (Yes, I'm repeating C.Lipka's question, because it went unanswered)
Your option #2 opens up the discussion. Christoph's answer on first
reading is too similar to what every other reply to this question has
been. Which is: No, nay, never.
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 27-10-2018 13:16, Paul Bourke wrote:
> I am aware of the trace macro that returns the intersection point and normal at
> that point on a object given a ray (point and direction). But is there a way to
> get the colour?
>
>
That would be nice to have. IT can of course be done now with a
combination of (1) the trace macro, and (2) the eval_pigment() function.
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|