Modeling a jar of water

Dear Radiance community,

I hope you’re keeping well in these difficult times.

I was wondering if you could give me some advice, what would be a more or less reliable approach to model a jar of colored water in Radiance?

The building design I am dealing with aims to use jars of water at the outside layer of its facade.

All the best,
Farhang

The physically correct way to do it in Radiance is to describe your outer jar surface as a dielectric with the index of refraction of glass, the top surface of your liquid with an appropriate transmissivity color per unit distance in world space, and the boundary of the liquid and glass jar as an interface type containing both sets of information.

The easiest way to understand this is by example, so here is a glass of wine described in this fashion using the genrev utility:

Wine in a glass

void dielectric glass
0
0
5 0.985957182188 0.985957182188 0.985957182188 1.5 0

void dielectric wine
0
0
5 0.850775418894 0.591493988288 0.734128039707 1.3 0

void interface glass_wine
0
0
8
0.985957182188 0.985957182188 0.985957182188 1.5
0.850775418894 0.591493988288 0.734128039707 1.3

glass cylinder stem
0
0
7
0 0.745 0
0 8.5675 0
0.3725

glass cone base_top
0
0
8
0 0.745 0
0 0.3725 0
0.3725 3.725

glass cylinder base_outside
0
0
7
0 0.3725 0
0 0 0
3.725

glass cup base_bottom
0
0
8
0 0 0
0 0.3725 0
3.725 0

!genrev glass top_outside ‘hermite(0,1,0,2,t)+1.15’ ‘hermite(.05,.5,1,0,t)’ 15 -s | xform -rx -90 -s 7.45

glass ring rim
0
0
8
0 16.0175 0
0 7.45 0
3.576 3.725

!genrev glass top_inside ‘hermite(.02,1,0,2,1-t*.2)+1.15’ ‘hermite(0,.48,1,0,1-t*.2)’ 3 -s | xform -rx -90 -s 7.45

wine ring content_level
0
0
8
0 13.350996 0
0 7.45 0
0 3.442496

!genrev glass_wine content ‘hermite(.02,1,0,2,.8-t*.8)+1.15’ ‘hermite(0,.48,1,0,.8-t*.8)’ 12 -s | xform -rx -90 -s 7.45

1 Like

Hi Farhang,

you have two model two solids for water and glass by their boundary
surfaces. Interfaces between glass/water and air are modelled by
“dielectric” in Radiance, those between glass and water by the more
general reflection and transmission model “interface” [1]. The former
takes one index of refraction and rgb triplet to define the color and
transmission, while the latter requires two. Note the orientation of
surfaces normals. I would recommend to double-check everything by
applying glow, which will affect only the front surfaces, and than
switch to dielectric / interface. Let me know if this helps, or if you
need more information - somewhere I have an example of such a model.

Note that is you want to account for the typical caustics cast such
solids, you would require the photon map with caustic photons [2].

Best, Lars.

[1] https://floyd.lbl.gov/radiance/refer/ray.html
[2]
https://www.radiance-online.org/learning/documentation/photonmap-user-guide

2 Likes

Dear Lars and Greg,

Thanks for the detailed advice. I tried it as far as I understood you, but there seems to be some problems with my model. I simplified the model as far as I could, so perhaps you have time to have a look at it and spot my mistake.

In my simple model I made the following geometries and assigned materials suggested by Greg as follows:

A) A box for wine. All surfaces facing outward. The roof surface with wine dielectric material, other surfaces with glass_wine interface material.

B) A box without the roof surface for the glass surrounding the wine. All surfaces facing outward. All surfaces with glass dielectric material.

C) A box without the roof and floor surfaces for the upper part of glass. All surfaces facing outward. All surfaces with glass dielectric material.

And here the resulting render that does not look right to me:

You can also see below my rad file with the same order of surfaces as above.
I would really appreciate your comments.

All the best,
Farhang

wine polygon wineTop_0
0
0
12
-3.0000 0.0000 0.8000
-2.4000 0.0000 0.8000
-2.4000 0.6000 0.8000
-3.0000 0.6000 0.8000

glass_wine polygon wineEnclosed_1_0
0
0
12
-3.0000 0.0000 0.0000
-3.0000 0.6000 0.0000
-2.4000 0.6000 0.0000
-2.4000 0.0000 0.0000

glass_wine polygon wineEnclosed_2_0
0
0
12
-2.4000 0.6000 0.0000
-3.0000 0.6000 0.0000
-3.0000 0.6000 0.8000
-2.4000 0.6000 0.8000

glass_wine polygon wineEnclosed_3_0
0
0
12
-2.4000 0.0000 0.0000
-2.4000 0.6000 0.0000
-2.4000 0.6000 0.8000
-2.4000 0.0000 0.8000

glass_wine polygon wineEnclosed_4_0
0
0
12
-3.0000 0.6000 0.0000
-3.0000 0.0000 0.0000
-3.0000 0.0000 0.8000
-3.0000 0.6000 0.8000

glass_wine polygon wineEnclosed_5_0
0
0
12
-3.0000 0.0000 0.0000
-2.4000 0.0000 0.0000
-2.4000 0.0000 0.8000
-3.0000 0.0000 0.8000

glass polygon glassAroundWine_1_0
0
0
12
-2.4000 0.0000 0.0000
-2.4000 0.6000 0.0000
-2.4000 0.6000 0.8000
-2.4000 0.0000 0.8000

glass polygon glassAroundWine_2_0
0
0
12
-2.4000 0.6000 0.0000
-3.0000 0.6000 0.0000
-3.0000 0.6000 0.8000
-2.4000 0.6000 0.8000

glass polygon glassAroundWine_3_0
0
0
12
-3.0000 0.0000 0.0000
-2.4000 0.0000 0.0000
-2.4000 0.0000 0.8000
-3.0000 0.0000 0.8000

glass polygon glassAroundWine_4_0
0
0
12
-3.0000 0.6000 0.0000
-3.0000 0.0000 0.0000
-3.0000 0.0000 0.8000
-3.0000 0.6000 0.8000

glass polygon glassAroundWine_5_0
0
0
12
-3.0000 0.0000 0.0000
-3.0000 0.6000 0.0000
-2.4000 0.6000 0.0000
-2.4000 0.0000 0.0000

glass polygon upperGlass_1_0
0
0
12
-2.4000 0.6000 0.8000
-3.0000 0.6000 0.8000
-3.0000 0.6000 1.0000
-2.4000 0.6000 1.0000

glass polygon upperGlass_2_0
0
0
12
-2.4000 0.0000 0.8000
-2.4000 0.6000 0.8000
-2.4000 0.6000 1.0000
-2.4000 0.0000 1.0000

glass polygon upperGlass_3_0
0
0
12
-3.0000 0.6000 0.8000
-3.0000 0.0000 0.8000
-3.0000 0.0000 1.0000
-3.0000 0.6000 1.0000

glass polygon upperGlass_4_0
0
0
12
-3.0000 0.0000 0.8000
-2.4000 0.0000 0.8000
-2.4000 0.0000 1.0000
-3.0000 0.0000 1.0000

Rather than dealing with coordinates, I made a diagram:


Your various parts need to have thickness, as shown. All surface normals for the dielectric materials should point towards the air. Note that the rim of the glass has thickness, and the inner surface normals point inwards.

The wine/glass interface normals can point either inwards or outwards, which changes the order you need to specify the “interface” arguments. I hope this is clearer (literally).

1 Like