Modulating diffuse albedo by an image

Dear List members,

I have written a function file which allows me to project real images
taken with a calibrated camera onto the (manually) modelled geometry of
the scene (see attached images). Writing the function file was dead
simple thanks to the really powerfull and well-designed function file
framework.

I have used colorpict to modify a plastic material with parameters (1 1
1 0 0), i.e. a perfect diffuse reflector. My function file tells
colorpict what uv coordinates to use for a given ray.

My question/problem is: how to handle the ray intersection points that
do not map to a pixel in the back projected image (i.e., points that are
outside the field-of-view of the original image). The attached image
clearly shows how the top and bottom image lines, and left and right
image columns get smeared across the geometry because I am computing uv
coordinates which in fact are outside the image bounds.

What I really want is to be able to return a controlled (constant) RGB
value for all uv coords falling outside the image bounds.

Suggestions, anyone?

Best,
Claus

Hi Claus,

Assuming you are using "picture.cal" for your coordinate mapping, you
can take advantage of the "inpic" variable to create a mixture
between your colorpict and a constant value, e.g.:

void colorfunc constRed
4 0.8 0.02 0.02 .
0

void colorpict myPic
7 red green blue myPic.hdr picture.cal pic_u pic_v
0
1 0.667

void mixfunc myMix
4 myPic constRed inpic picture.cal
0
1 0.667

myMix plastic myMat
0
5 1 1 1 0 0

etc...

Naturally, you'll want to apply the same transformations to both
colorpict and mixfunc if you have any, and the 0.667 value I've
specified for the picture aspect ratio should be adjusted to match
your source image (height/width). I hope this is clear enough.

Best,
-Greg

ยทยทยท

From: "Claus B. Madsen" <[email protected]>
Date: December 13, 2007 5:28:41 AM PST

Dear List members,

I have written a function file which allows me to project real images
taken with a calibrated camera onto the (manually) modelled
geometry of
the scene (see attached images). Writing the function file was dead
simple thanks to the really powerfull and well-designed function file
framework.

I have used colorpict to modify a plastic material with parameters
(1 1
1 0 0), i.e. a perfect diffuse reflector. My function file tells
colorpict what uv coordinates to use for a given ray.

My question/problem is: how to handle the ray intersection points that
do not map to a pixel in the back projected image (i.e., points
that are
outside the field-of-view of the original image). The attached image
clearly shows how the top and bottom image lines, and left and right
image columns get smeared across the geometry because I am
computing uv
coordinates which in fact are outside the image bounds.

What I really want is to be able to return a controlled (constant) RGB
value for all uv coords falling outside the image bounds.

Suggestions, anyone?

Best,
Claus