[Radiance-general] Texture Baking?

Greg Ward gregoryjward at gmail.com
Mon Aug 11 08:51:51 PDT 2014


Hello Trygve,

To create an "illumination map," which is really just a map of (u,v) texture pixels that correspond to RGB irradiance values, you need to generate the (X,Y,Z) Cartesian world coordinates and (Nx,Ny,Nz) world surface normal direction vectors for each pixel in your map.

Feed these values to rtrace as ASCII (-fac) or raw floating-point (-ffc) to create your illumination map like so:

	rtrace -I -fac -x $xres -y $yres -n $nproc $render_options scene.oct < surface_positions.txt > illumination_map.hdr

The first option, upper-case "-I", tells rtrace to compute irradiance rather than radiance, and to expect surface positions and normals rather than ray origins and directions.  Your input file (surface_positions.txt) might start like this for a wall parallel to the X-Z plane:

10.0	3.70	1.51	0	1	0
10.1	3.70	1.51	0	1	0
10.2	3.70	1.51	0	1	0
...
10.0	3.70	1.61	0	1	0
10.1	3.70	1.61	0	1	0
...

I think you get the idea.  You need to specify the -x and -y options to rtrace to get it to generate a valid Radiance picture, which you may then convert to another format if you like.  The -n option allows you to run rtrace on multiple processors to speed the calculation up.  If you are computing interreflections, be sure to specify an ambient file (-af option) in that case.

I hope this is enough to get you started.

> From: "Lars O. Grobe" <grobe at gmx.net>
> Subject: Re: [Radiance-general] Texture Baking?
> Date: August 11, 2014 2:01:16 AM PDT
> 
> Hi Trygve,
> 
> you can do it... :) Greg demonstrated an example where he used something similar to render caustics on the inside walls of a swimming pool. For each surface, create locations on it to achieve a sufficient resolution and render the illuminance at each location. Alternatively, for simple geometry, you may find the location and extents of the surface, place a vtl-type camera just in front of it, and render an image (clipping all pixels not belonging to the surface using the rtrace object id output).
> 
> It is a bit of work though... :D
> 
> Cheers, Lars.
>> 
>> 
>> Hello,
>> Has anyone done any work with texture baking in Radiance? I'm looking for a way to create a rendered, hopefully eventually animated, texture of a space for use in a walkthrough video game. I found a couple references to something like this in the archives, but only fragments. The best example is this, which looks like it would work just fine if only I were Arup: http://www.radiance-online.org/community/workshops/2008-fribourg/Content/Guilio/Lightmaps_Radiance_Arup_GA_2008.pdf. Any thoughts?
>> 
>> Thanks,
>> Trygve



More information about the Radiance-general mailing list