[Radiance-general] Generating alpha channels using vwrays and rtrace

Andy McNeil amcneil at lbl.gov
Fri Feb 24 14:25:00 PST 2012


I kinda like Iebele's method approach better than using black and white materials.  Using rtrace -om you can create alpha channels using the same octree that you use for a rendering.  And you can also create many alpha images for different materials with the same model.  It just seems less work than fussing with material files.

Iebele, the main thing you're missing is pvalue to convert the data stream to image format.  I also used awk for the if statement.  Here's a complete command:

vwrays -ff -vf test.vp -x 100 -y 100 | \
	rtrace `vwrays -d -vf test.vp -x 100 -y 100`  -ffa -om test.oct  | \
	awk '{if($1=="window") print 1.0; else print 0.0;}'  | \
	pvalue +x 500 -y 500 -h -da -b -r | \
	ra_tiff - alpha.tif

Andy



On Feb 24, 2012, at 1:29 PM, giulio antonutto wrote:

> yes, this was :-) 
> (sorry missed your reply)
> G
> 
> On 24 Feb 2012, at 19:45, Jack de Valpine wrote:
> 
>> Hi Iebele,
>> 
>> I have done a few different things to achieve this over the years. The one that come most readily to mind is to prep an alternate material file with a black (0 0 0) and white (1 1 1) material assigned as needed. This is one reason the "alias" material option can be quite handy when assigning materials to geometry! With the correct black/white materials this can be rendered out very quickly with -ab 0 and -av 1 1 1.
>> 
>> I have also done something where (with scripting) you can specify a material name that then get white and everything else gets black. It has been a while so I do not quite remember off hand, but I think that this can also be setup as a big pipe in radiance and using radiance's functional language.
>> 
>> The first way is pretty easy and if you need to do lots of it then it is possible to script the switching of material assignments. One challenge though is that if you use instances (frozen octrees) you need to remember to assign a material accordingly. Another challenge is thinking about transparencies that might need to be captured in the process...
>> 
>> Regards,
>> 
>> -Jack
>> -- 
>> # Jack de Valpine
>> # president
>> #
>> # visarc incorporated
>> # http://www.visarc.com
>> #
>> # channeling technology for superior design and construction
>> 
>> On 2/24/2012 2:24 PM, Iebele Abel wrote:
>>> 
>>> Hi group, 
>>> 
>>> Whilst finding a method to create alpha channels for my rendered image, I'm playing with vwrays and rtrace. What I intend is to create an image in which 
>>> geometry modified by a particular modifier  is rendered white, whilst the geometry modified otherwise is rendered black. The command below comes close to this, it has as output the modifiers for each surface hit:
>>> 
>>> vwrays -ff -vf test.vp -x 100 -y 100 | rtrace `vwrays -d -vf test.vp -x 100 -y 100`  -ffa -om test.oct  | more
>>> 
>>> Output of this command is like:
>>> ...
>>> floor
>>> floor
>>> floor
>>> window
>>> window
>>> etc...
>>> 
>>> Now I want that, for example, each occurrence of "window" sends 3 "bright" RGBE primaries to stdout, and every other string sends 3 "dark" RGBE primaries to stdout. I can do this by writing a small program (instead of piping to 'more' as in the example above), but I wondered if there is a method using native Radiance tools to do it.   
>>> 
>>> In pseudo code (bold) I think about something like this (where 1 represents a value considered as white in the output, and 0 represents black) :
>>> 
>>> vwrays -ff -vf test.vp -x 100 -y 100 | rtrace `vwrays -d -vf test.vp -x 100 -y 100`  -ffa -om test.oct  | if (stdin == "window") fprintf(stdout, "1 1 1" ); else fprintf ( stdout, "0,0,0"); | ra_tiff - alpha.tif
>>> 
>>> So my questions are:
>>> 1. how do I format the output of stdout as Radiance RGBE? 
>>> 2. can I do this using native Radiance tools? 
>>> 
>>> Thanks for any hints. 
>>> 
>>> -Iebele
>>> 
>>>  
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Radiance-general mailing list
>>> Radiance-general at radiance-online.org
>>> http://www.radiance-online.org/mailman/listinfo/radiance-general
>> _______________________________________________
>> Radiance-general mailing list
>> Radiance-general at radiance-online.org
>> http://www.radiance-online.org/mailman/listinfo/radiance-general
> 
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20120224/03f9434b/attachment-0001.html>


More information about the Radiance-general mailing list