[Radiance-general] rendering without shadow

Greg Ward gregoryjward at gmail.com
Thu Jan 20 12:06:43 PST 2011


Another option is to use rtcontrib to separate light source contributions.  Something like:

	vwrays -ff -x 1024 -y 1024 -vf view.vf \
		| rtcontrib -ffc `vwrays -x 1024 -y 1024 -vf view.vf -d` -ab 0 -dj 0 -ds 0 -o shad_%s.hdr -m src1mat -m src2mat -m src3mat input.oct

The id's "src1mat," "src2mat" and "src3mat" must correspond to different materials for different sources in the octree.  Each will produce a separate output file from rtcontrib, "shad_src1mat.hdr," "shad_src2mat.hdr," and "shad_src3mat.hdr".  If you have many sources, you can put the different material names into a single file and use the -M option to load it. 

Afterwards, you can use Thomas' trick of thresholding the results to determine what is in shadow from what is not.  The "-dj 0 -ds 0" options make all the sources act as points, but if you want penumbras to show up in the output, you can remove these options.

Best,
-Greg

> From: Thomas Bleicher <tbleicher at googlemail.com>
> Date: January 20, 2011 8:59:14 AM PST
> 
> Thanks for clarifying.
> 
> On Thu, Jan 20, 2011 at 10:39 AM, Brajesh Lal <brajeshlal at yahoo.com> wrote:
>> Hi Thomas,
>> Sorry for ambiguity. I need shadow pixel ids of the scene.
>> I am wondering if i can disable or enable the shadow casting feature
>> of a particular object or scene ( like any other 3D packages).
> 
> Radiance is not like a typical 3D engine where lighting effects and
> surface qualities are synthetic. In Radiance you have some "physical"
> restrictions for what you can model and render. However, Radiance is
> also very flexible so that with some extra effort you may be able to
> achieve your desired result.
> 
>> Then i can have rendered image with and without shadow.
>> Their difference can give me shadow pixels.
> 
> You can render one image with only the direct light visible (no
> ambient light). Everything that lies in shadow will be black. Try to
> render an image with the option "-ab 0" and see if the dark areas are
> what you expected your shadows to look like.
> 
> You can then render a second image with indirect contribution and
> subtract the two images. But the result will not be limited to the
> shadows but will also show the difference in the lighting levels of
> lit areas. To render the second image use "-ab 1" or "-ab 2".
> 
> To calculate the difference of the images use this command:
> 
> pcomb -e 'ro=ri(1)-ri(2);go=gi(1)-gi(2);bo=bi(1)-bi(2)' -o
> no_shadow.hdr -o shadow.hdr > diff.hdr
> 
> You can modify this calculation to introduce a threshold which will
> clean up the shadow image a bit. But first you have to see if this is
> in principle the right way to go.
> 
>> Or
>> If i can render the scene with some constant background color, then i can
>> read the shadows pixel ids (low pixel value) in matlab.
> 
> You can also define a coloured "ambient light" to give the shadow a
> red or green tint.
> 
>> my scene has only diffuse objects (diffuse reflectance can
>> be of any value, no black object) and a single direct light.
> 
> Light sources in Radiance are not point lights but need a physical
> surface area to attache to. You should use a small object here and set
> the rendering parameters right to avoid a subdivision of the surface
> during the rendering process which would result in fuzzy shadow edges.
> 
> Regards,
> Thomas



More information about the Radiance-general mailing list