# Calculation of View Factors for Building Simulations with an Open-Source Raytracing Tool
## 2 RADIANCE: Theoretical Basis and General Calculation Methodology
### Specifying Inputs and Interpreting Outputs  
As illustrated in Figure 3, the inputs for calculating the view factor between a differential surface and a finite surface with RADIANCE are \"differentialSurface\", \"surfaceldentifier\" and \"surfaceGeometry\". \"Surfaceldentifier\" and \"surfaceGeometry\" relate to the material properties and shape of the finite surface respectively. Multiple differential surfaces and finite surfaces can be specified at a time by listing them in text files and specifying the path of the text files as the inputs in place of the \"surfaceldentifier\" and \"differentialSurface\". The results thus generated are a matrix comprising of view factors between individual differential surfaces and finite surfaces. The format for specifying materials and shapes in RADIANCE is shown in Figure 6. The fundamental material and shape-type that are used for the view factor calculations in this paper are _plastic_ and _polygon_ respectively. Figure 6a describes the general template that can be used for defining _plastic_ and _polygon_ and Figure 6b,c provide an example of each of them, respectively. While RADIANCE supports a multitude of materials and shapes, for the purposes of calculating view factors, the _plastic_ material and the _polygon_ shape are ideal as they can be combined to create complex shapes [29]. _Plastic_ is as an opaque surface that is analogous to conventional diffusing materials assumed in the calculation of view factors. The definition for plastic material as shown in Figure 6b is \"void plastic shape 0 0 5 1 1 1 0 0\". The term \"void\" indicates that this material is not modified or affected by any other textures or materials. The term \"shape\" was arbitrarily chosen and can be any combination of ASCII characters. The numbers \"0 0 5 1 1 1 0 0\" as a whole specify that the reflectance of this material is uniformly diffused white. The three numbers \"1 1 \" after \"0 0 5\" relate to  
Figure 5: The proposed workflow for calculating view factors with RADIANCE. RADIANCE programs are identified through rectangles, and inputs and outputs are denoted through ellipses. The dotted figures represent a script and output that is external to RADIANCE. The colors used in this figure are complimentary to the ones used in Figure 3c. Figure 6: Specifying materials and shapes in RADIANCE. (**a**) Shows the general template. (**b,c**) Provide examples of a material type and shape type respectively. (**d**) shows a visualization of the geometry defined through the combination of (**b,c**). the spectral power of the three channels that RADIANCE employs to describe the color of a surface or a radiation source. These three channels, namely Red, Green, and Blue, relate to primary colors within the human visual system [23]. The definition for a polygon is specified in Figure 6c as \"shape polygon object 0 0 12 0 0... \". Here, the term \"shape\" indicates that this polygon is of the plastic material type defined in Figure 6b. The term \"object\" was arbitrarily chosen and can again be any combination of ASCII characters. The numbers \"0 0 0 1 0 0 1 1 0 0 1 0\" specify the four cartesian coordinates to define the surface shown in Figure 6d. The raytracing methodology implemented in _rontrib_, and other RADIANCE programs, has a physical basis. So, finite surfaces are defined according to their actual dimensions. For example, based on the vertices defined in Figure 6c, the resultant polygon shape is a square of unit dimensions. Radiance supports SI units of measurement for distances and the values can be expressed in integer or floating-point numerical format. The units themselves are not specified explicitly in Radiance input formats. It is possible to combine multiple polygons and materials together. The definition and visualization for a surface comprised of two polygons is shown in Figure 7. Surfaces and surface-combinations of further complexity are visualized in Figure 8.  
The methodology to be followed for creating polygons of any number sides is described in detail in [23].