Skip to content

twastvedt/heliocentric-vr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heliocentric Architecture VR

This is the virtual reality component of an architectural thesis which explores atmospheric spaces whose forms reveal latent celestial cycles. For more information on the thesis and the individual spaces please visit trygvewastvedt.com/heliocentric.

Traditional printed media afford limited potential for experiencing atmosphere. Thus, the thesis explores the use of video media and virtual reality to present an immersive experience of the architecture. Here I have developed VR experiences for two of the spaces. As these renderings claim to demonstrate the success of the thesis, it was essential that they be as physically accurate as possible. There is a long way yet to go on that front, but I will describe here the steps I've taken as documentation and in the hopes that it will be useful to others attempting physical accuracy in VR.

Viewing

The two spaces are viewable through this project's GitHub Page. Both are written using A-Frame, a framework for building virtual reality experiences on the web. You can view these in your browser (Firefox, Chrome, or Edge are best), but to get the full effect you'll need a headset.

Details

is an interstitial atrium linking two high-rise buildings. A spiral stair rises through the center and connects the floors of each building with each other. The stair planes and the walls are aligned so that direct sunlight in the building follows a similar path each day, illuminating the same series of surfaces.

The VR experience for this space is very straightforward. The rendering was done in 3DS Max using V-Ray and Domemaster3D to create a stereoscopic 360° panorama. This approach provides the best shading realism at the cost of a static location and time.

78°

78° is a monument to solar rhythms designed as a variant on Boullée’s cenotaph. The space takes the form of an inverted hemisphere with a single linear skylight cut into the flat roof. The line of light cast by the skylight occupies a stair which encircles the space, allowing visitors to follow the light through its diurnal cycle.

In contrast to 4°, the scale and geometric complexity of this space made the VR environment a much greater technical challenge. It still needs some work, but I have completed a first working pass on all aspects of the scene.

Light Color and Intensity

What color is the sun? The sky? In order to answer these questions more accurately than "yellowish and bluish" one must model the scattering of various wavelengths of sunlight through the atmosphere. For this I used the Hosek-Wilkie Sky Model which provides an algorithm to calculate the color of the sky based on the sun's location and the sky's turbidity. I chose this model for several reasons. First, it is relatively recent and thus builds on the work of previous models. The authors have also published an implementation of the model in C++ and, most importantly, have calculated the spectral radiance of visible sunlight, something most models don't do. The code in tools/sky color uses the model to compute the average spectral radiance of the sky and sunlight (Both from a grid of samples. The model accounts for the darkening of the edge of the sun, so sunlight too needs to be an average over a grid.) for a range of solar elevations and converts those values to an sRGB color and an intensity in lux. (There is a fascinating side topic of color theory here. See https://scipython.com/blog/converting-a-spectrum-to-a-colour/ for an intro and for the equations I used for the conversion.) In the A-Frame scene the location of the sun is computed using a library and then the solar elevation is used to interpolate the color and intensity lists to find the current values.

Direct Illumination

Three.js has an api for shadow calculation, but the scale of this space would require too large a shadow map in order to get crisp shadow edges. Fortunately the simple rectangular skylight, centered at (0,0,0), made the computation very straightforward to do manually in the shader. See hemisphere-steps.vert.glsl and hemisphere-steps.frag.glsl for the details, but the basic idea is to project the current vertex onto the y=0 plane along the angle of incoming sunlight and then test whether the projection is in the skylight. A faded edge is also calculated with a fade distance based on the size of the sun's disk and the distance from the vertex to the skylight.

Indirect Illumination

Using lightmaps for indirect illumination on the hemisphere would be possible, but would have involved a lot of asset management and a number of large images to download. Instead, since the ambient light changes gradually and the meshes are dense, I used mesh vertex colors to store the lightmap (except on the geometry at the top of the space where the lighting is sharper and the mesh is less dense). The Python script colorVertices-ambient calculates the solid angle of the skylight at each vertex in the model and stores that in a vertex color channel. The shader then multiplies the solid angle by the ambient light intensity and color. (For example a floor with an unobstructed view of the sky would receive a vertex color value of which, when multiplied by the current sky luminance, would yield the brightness of the surface in lux due to indirect illumination.) This accounts for the major source of indirect illumination, the skylight, but ignores any bouncing of light around the hemisphere. There is also the question of the effect of the windows around the top edge of the space. Further investigation should probably involve some multiple-day-long path-traced renders of the space to be used to calibrate additional terms in the vertex color equations.

Resources