[Radiance-general] texfunc with -aa 0

Greg Ward gregoryjward at gmail.com
Tue Nov 1 11:34:47 PDT 2016


Hi Stephen,

Perfect -- thanks for the additional explanation and renderings.  Now I know what's happening, which I should have known had I only remembered the age-old limitation built into the indirect calculation from the beginning.

The basic problem is that the perturbed normal cannot be used to assign the sampling hemisphere, because this would inevitably lead to sampling behind the surface, which would introduce nasty light leaks in many situations.  This is one of the main problems with "bump mapping" as it is commonly referred to in graphics, and Radiance adds some special tests in the specular material sampling routines to avoid generating rays that penetrate an opaque surface.  Modeling the object as actually geometry avoids this problem, and is really the best way to get an accurate result if you don't mind all the extra polygons....

The trick I employ when using the ambient cache is to take the calculated "rotational gradient" and apply it using the perturbed surface normal to simulate the cosine effect you get with a different surface orientation.  Thus, the hemispherical ray samples are generated based on the unperturbed normal, but the perturbed normal is used to adjust the final value.

This trick doesn't happen with -aa 0, because I don't bother to calculate the rotational gradient, figuring that I'm not caching any values so I won't need it.  However, I *could* calculate it in cases where there is a normal perturbation, and use it in the same way I do with the irradiance cache on.  I don't think it would be that much trouble to add this capability after looking again at the code, so I might send you a version to try a little later today.

Cheers,
-Greg

> From: Stephen Wasilewski <stephen at coolshadow.com>
> Date: November 1, 2016 10:53:20 AM PDT
> 
> Hi Greg,
> 
> here is my cal file to simulate metal decking:
> 
> {
> A1 = length of 1 period
> A2 = angle of ribs (0-90)
> A3 = bottom length
> A4 = top length
> }
> angle = A2*DEGREE;
> 
> F1 = A3/A1;
> F2 = (A1-A3-A4)/2/A1 + F1;
> F3 = A4/A1 + F2;
> inc = frac(Px/A1);
> zcor = if(and(inc-F1,F2-inc),cos(-angle),if(inc-F3,cos(angle),0));
> xcor = if(and(inc-F1,F2-inc),sin(-angle),if(inc-F3,sin(angle),0));
> ycor = 0;
> 
> and here is the material I am applying:
> 
> void texfunc NS
> 6 xcor ycor zcor ./decking.cal -rz 14
> 0
> 4 .667 71.5673 .1808 .3186
> 
> NS plastic NSdeck
> 0
> 0
> 5 .8 .8 .8 0 0
> 
> here is the same scene with the geometry physically modeled, the pattern is more prominent because of self shading, but I would expect to see something like this because of the normal perturbation (even with the noise). 
> 
> 
> and here is the scene run with higher settings (-ad 20000) to reduce the noise (still no discernible texture):
> 
> 
> thanks,
> 
> Stephen Wasilewski
> LOISOS + UBBELOHDE
> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> 1917 Clement Avenue  Building 10A
> Alameda, CA  94501 USA
> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> 510 521 3800 VOICE
> 510 521 3820 FAX
> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> www.coolshadow.com
> 
> On Tue, Nov 1, 2016 at 10:06 AM, Greg Ward <gregoryjward at gmail.com> wrote:
> Hi Stephen,
> 
> I only now realize that I misread your initial post, thinking you were talking about the -ab setting rather than -aa.  Mea culpa.
> 
> Are you sure the texture isn't just being masked by all the noise you get with -aa 0?  Is it indeed a texture rather than a pattern you have applied?  In either case, it should have some effect whatever your -aa setting.  If you increase the -ad setting and decrease the -lw setting to 1/(ad) accordingly, the noise should go down to where you may be able to discern the texture again.  Can you share what texture you are using, exactly?
> 
> Cheers,
> -Greg
> 
>> From: Stephen Wasilewski <stephen at coolshadow.com>
>> Date: November 1, 2016 9:53:12 AM PDT
>> 
>> Hi Greg and Jon,
>> This is an indirectly lit surface (a ceiling).  I am not seeing the same patterning I get with -aa >0.  In a small test scene, I see the normal pertubation if I apply a specularity to the material, but not if it is purely diffuse, images below are with a diffuse material.  In longer runs that clean up the noise I see the same lack of pattern:
>> 
>> vwrays -ff -vf 1.vf -x 400 -y 400 | rtrace  `vwrays -d -vf 1.vf -x 400 -y 400` -ffc -n 8  -ab 3 -lr -4 -lw 1e-4 -ad 200 -as 0 -aa 0 -av .04 .04 .04  test.oct > nocache.hdr:
>> 
>> vwrays -ff -vf 1.vf -x 400 -y 400 | rtrace  `vwrays -d -vf 1.vf -x 400 -y 400` -ffc -n 8  -ab 3 -ar 300 -ad 500 -as 250 -aa .1 -av .04 .04 .04 -af cache.amb  test.oct > ambcache.hdr:
>> 
>> 
>> 
>> Thanks,
>> 
>> 
>> Stephen Wasilewski
>> LOISOS + UBBELOHDE
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>> 1917 Clement Avenue  Building 10A
>> Alameda, CA  94501 USA
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>> 510 521 3800 VOICE
>> 510 521 3820 FAX
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>> www.coolshadow.com
>> 
> 
> _______________________________________________
> 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/20161101/9cac393d/attachment.html>


More information about the Radiance-general mailing list