[Radiance-general] artifact while rendering glass in tmesh solved?

Iebele Abel iabel at iebele.nl
Fri Feb 3 01:32:37 PST 2012


Hi Greg,

Thanks for digging into this problem. The model I send you was just a
try to see how tessellated nurbs would behave when rendering in
Radiance using HDR skies. The actual project is simulating the
behavior of biological cells exposed to strong mental attention. I
have no geometry of that at this stage, it (the nurbs) should be
generated in an automated way. That's quite a task on its own, so in
my case the easiest way will probably be to re-hack glass.c. Since I
use osx I haven't used the source distribution for a while, but that
should not be a problem. Many thanks for your quick and detailed
reply. I'll keep you updated,

Cheers,
Iebele


2012/2/3 Greg Ward <gregoryjward at gmail.com>:
> Hi Iebele,
>
> Just so this answer doesn't get lost like Francesco's, I'm taking us back online to discuss this.  Thanks for sharing your model and results.
>
> The problem occurs because of a hack I introduced into the glass material type, about which I had completely forgotten.  It was my answer to the question, "Should a texture applied to an infinitely thin layer of glass perturb transmitted rays?"  I decided it should, because in most cases, a texture is applied to introduce some effect to the surface.
>
> The problem here is that the texture is being applied to correct the effects of triangulation, thus smoothing rather than roughening the surface.  Without a texture, the transmitted component would be unaffected, but the reflected component would show your model's tessellation.  There are three possible solutions.
>
> The first possible solution is to give your car windows real thickness and use a dielectric material rather than glass.  You would need to be careful that your surface normals were directed outwards for the outer layer and inwards for the inner layer.
>
> The second possible solution is to turn off surface normal smooth just for the window layer.  This will as I said show up the tessellation of your reflections, but it would fix the transmission.
>
> The third possible solution is to re-hack the source file rt/glass.c.  At line 114, simplify:
>
>                        if (!(r->crtype & SHADOW) && hastexture) {
>                                VSUM(p.rdir, r->rdir, r->pert, 2.*(1.-rindex));
>                                if (normalize(p.rdir) == 0.0) {
>                                        objerror(m, WARNING, "bad perturbation");
>                                        VCOPY(p.rdir, r->rdir);
>                                }
>                        } else {
>                                VCOPY(p.rdir, r->rdir);
>                                transtest = 2;
>                        }
>
> to read:
>
>                        VCOPY(p.rdir, r->rdir);
>                        transtest = 2;
>
> This should fix the problem without having to change your model.  Of course, the problem will come back the next time you update Radiance, unless folks convince me that my hack was ill-conceived to begin with.  I'm open to the possibility.
>
> Cheers,
> -Greg
>
>> From: Iebele Abel <iabel at iebele.nl>
>> Date: February 2, 2012 11:38:28 AM PST
>>
>> Hi group,
>>
>> Can the artifact which occurs when rendering glass in a tmesh
>> (obj2tmesh) be solved? This artifact has already been described in the
>> following thread, but it does't seems to be followed up by an answer.
>> Any help would be appreciated.
>>
>> http://www.radiance-online.org/pipermail/radiance-general/2005-June/002777.html
>>
>> Thanks,
>>
>> Iebele
>
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general



More information about the Radiance-general mailing list