The appropriate choice of glazing in a facade depends on many factors. They include amongst other criteria: location, orientation, climatic condition, energetic efficiency, usage of the building, required user comfort, and the architectural concept. On the south facade of high-rise buildings in particular, it is a challenge to have simultaneously large glazed area, no glare, no excessive cooling loads, a clear view and sufficient natural light flux. In Switzerland, electric lighting, heating and air conditioning account for about 74% of the total energy demand in private housing and 32% of the overall Swiss electricity usage. This energy consumption can be strongly influenced by using the most appropriate fenestration system. A software was developed during this thesis to engineer new complex fenestration system (CFS) that have a two dimensional profile. The originality of the implemented Monte Carlo ray tracing algorithm is the separation of intersection and interaction. The model also calculates an accurate bidirectional transmission distribution function that is used in combination with Radiance to obtain a rendering of the daylighting distribution in an office space or dynamic daylight metrics such as the daylight factor and daylight autonomy. Finally, to estimate the thermal performances, a simple nodal thermal model was added to simulate the temperature evolution and the thermal loads in a given office. This tool was validated. A glazing combining several functions and that can contribute to significantly reduce energy consumption in buildings was developed using this novel ray tracing approach. It was designed to obtain a strongly angular dependent transmission and a specific angular distribution of transmitted light. The engineered geometry provides elevated daylight illuminance by redirecting the incoming light towards the depth of the room. This redirection simultaneously reduces the glare risk. For an optimised usage of available solar radiation, the transmission of direct sunlight is maximised in winter and minimised in summer. Taking advantage of the changing elevation of the sun between seasons, such a seasonal variation can be created by a strongly angular dependent transmittance. A fabrication process was identified and samples of embedded micromirrors were produced to demonstrate the feasibility. The fabrication of such structures required several steps. The fabrication of a metallic mould with a high aspect ratio and mirror polished surfaces is followed by the production of an intermediate polydimethylsiloxane mould that was subsequently used to replicate the structure with a ultraviolet (UV) curable polymer. Selected facets of these samples were then coated with a thin film of reflective material. Finally, the structures were filled with the same polymer to integrated the mirrors. The blocking effect can be obtained by a combination with well placed reflective stripes, those were fabricated by lift-off lithography. The samples were characterised during the various fabrication steps using various microscopy techniques, energy-dispersive X-ray spectroscopy, profilometry and optical measurements. A setup was built for the measures of angular dependent transmittance. The final samples redirect up to 70% of the light flux and are very transparent when looking through at normal incidence.