[Radiance-general] Rendering of normal map
Claus B. Madsen
cbm at imi.aau.dk
Mon Mar 9 12:35:41 PDT 2009
Hi Lars,
your little hint concerning glow was the final push I needed to crack
the nut. It turned out to be even easier than I expected. Here is my
material specification (glow, modified by colorfunc, which calls a
normalshader.cal function file that I wrote, listed further down):
----------------------------------------------------------------
# Materials
void glow normalglow
0
0
4 1.0 1.0 1.0 -1
normalglow colorfunc normalshadermaterial
4 red green blue normalshader.cal
0
0
------------------------------------------
The normalshader.cal looks like this (thanks to Greg for making function
files so easy to use and versatile):
{
normalshader.cal
Look in RADIANCE/lib/rayinit.cal for more info on builtin funcs and vars
}
red = (Nx + 1)/2;
green = (Ny + 1)/2;
blue = (Nz + 1)/2;
-------------------------------------------------------------------------
A example normal map is attached. It looks a little ugly because it is a
triangle mesh constructed from a stereo camera scan of an outdoor scene
(color image attached, too).
Best,
Claus
Lars O. Grobe wrote:
> Hi!
>> I wish to use Radiance to render a normal map of a scene. By normal map
>> I mean a floating point RGB image, where the RGB values of each pixel
>> correspond to the xyz coordinates of the surface normal in scene
>> coordinates. More precisely, for example for the red channel:
>>
>> R = (Nx + 1)/2
>
> I think I'd use rtace with -oN, pipe the result to rtrace to calculate
> your channel value, and convert the output into a radiance hdr format
> using pvalue.
>
> I guess that, if you want to do all this with rpict and render the
> surfaces "in your scene", you could try the glow modifier as a
> material to modify. Just as a starting point.
>
> CU Lars.
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meshcolor.jpg
Type: image/jpeg
Size: 19432 bytes
Desc: not available
Url : http://radiance-online.org/pipermail/radiance-general/attachments/20090309/fbb5a25a/meshcolor-0001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meshnormals.jpg
Type: image/jpeg
Size: 24722 bytes
Desc: not available
Url : http://radiance-online.org/pipermail/radiance-general/attachments/20090309/fbb5a25a/meshnormals-0001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbm.vcf
Type: text/x-vcard
Size: 354 bytes
Desc: not available
Url : http://radiance-online.org/pipermail/radiance-general/attachments/20090309/fbb5a25a/cbm-0001.vcf
More information about the Radiance-general
mailing list