Tuesday, March 31, 2009

Update 6

Sorry for the extremely overdue update! As we mentioned in our last post, our focus has been on restructuring our project to more clearly define our goals so we have a better idea of how to plan out the remainder of the semester. These new objectives will be detailed a little later on in the post.

Before spring break (March 6 - March 15), Becky and I created new lamp models with temporary glass textures, based on scans from the Glass of the Sultans book. We had Professor Holod critique them in terms of shape and proportion, and also asked her for more specific details on the textures of the glass lamps. According to Professor Holod, the original intended color for the glass would have been almost transparent and mostly colorless with a slight bluish tinge. She also suggested we try a glass texture with a yellowish tinge. As mentioned previously, these glass textures are temporary, as we plan to incorporate the data collected from the spectroradiometer to more accurately simulate how light should pass through the glass. For now however, the lamps can be seen pictured here:


In addition to the spectroradiometer readings taken as the museum, Joe Kider helped Becky and I take readings of an oil flame. Using a model lamp Cory obtained at the museum store, we filled it with olive oil and used a makeshift wick that Becky made by braiding book binding thread. It should be noted that the model lamp wasn't glass, but it still seemed to work well enough for our purposes.

More importantly, we also met with Professor Safonova, Dr. Badler, and Joe in order to get advice on how to best restructure our project. After much discussion, we've agreed that by May 1, we should have:

- One glass lamp filled with different fluids and a moving flame (appropriate indices of refraction should also be used)
- A still image of the lamp in a section of the mosque 
- A flythrough of a section of the mosque with the lamp and moving flame

Dr. Badler helpfully suggested that we treat our project as a small series of experiments leading up to the final goal, thus our first main goal is to produce a still image of the scene (lamp, flame, and mosque.) In order to achieve this first checkpoint, Becky and I must have finished:

- Successful exporting of Maya models into Radiance
- UV mapping
- Creating accurate glass shaders using spectroradiometer data
- Flame 

For the second phase (the animation):
- Animating a camera
- Animating cylinders
- Being able to analyze a video file
- Writing a script for the flame animation

At our last meeting, it was decided that the flame would be simulated by creating a stack of cylindrical light objects that vary in size and position throughout the animation. The movement of the light objects would be determined by analyzing a video of a real flame provided to us by Irfan Essa, who used the video as part of the "Video Textures" paper by Schodl et al. For the video analysis, we are going to try converting frames of the video into bmp files, and then collecting information on the bitmap's rgb values. We're still fleshing out details for this however, so at least for the present details on this will be vague.

We will also be working on a paper detailing the background and process of our project, which we will hopefully submit to the VAST conference. For now, we are responsible for writing about the art history aspect of the project: background work, details on what the materials were like back then and how we tried to simulate that, the reasoning behind our decisions, etc.

At present, I will be responsible for bringing Maya models into Radiance, UV mapping, using the spectroradiometer data to create more accurate glass shaders, and creating the flame. Becky will be responsible for writing code to analyze the video file and animation. These roles may change in the future, depending on how difficult a task is or how much our tasks overlap (i.e., rendering and animating the flame.)

As for bringing Maya models into Radiance, progress so far has been pretty good. As of last Thursday, I was able to successfully use obj2mesh to render one of our lamps in Radiance using a basic red plastic shader:


I am also acquainted with the process of UV mapping, and was able to take a basic textured cube in Maya and render it in Radiance. I have included renders from both Radiance and Maya below, so that comparisons between the two can be made. Render times were relatively the same, but it's clear that the image rendered in Radiance has a more clear and crisp texture. On Maya, I rendered it with the Mental Ray renderer with a production quality and ray tracing turned on, and I used two lights. In Radiance, I only used one basic light. 

Image rendered in Radiance

Image rendered in Maya Mental Ray

Right now, I am working on exporting a very small section of the Maya mosque scene file into Radiance. I'm a little concerned with the complexity of the scene, as there are several different textures being used, and I will be sure to report more as I continue working.

Monday, March 2, 2009

Update 5

We met last Wednesday to take spectral data readings of the glass lamp samples at the Museum of Archaelogy and Anthropology. Professor Holod, Joe Kider, and Katy Blanchard, keeper of the Islamic collections for the museum, were also there to assist us in our readings. We took measurements for a tumbler, a lamp, a shard from the bottom of a lamp, and another shard. Using a diffuser, two monochromatic white lights, and a tactical hunting light, we were able to take measurements under six different setups. Diagrams of these setups can be seen below (thanks to Joe for the diagrams!): 








The results of these readings will be posted as soon as Cory is able to retrieve them from the spectroradiometer. More pictures can be seen here.

We also looked into some of the books Professor Holod suggested; Cairo of the Mamluks was unavailable so we requested it through interlibrary loan, and we didn't find anything particularly useful in Meditation of Ornament. However, we will be using scans from Glass of the Sultans as references for our models. Professor Holod also suggested that we look into Lighting in Early Byzantium, which will be published sometime this month. 

The meeting scheduled for last Thursday was cancelled, but we were able to meet with Cory today to ask some of the questions we meant to ask last week. We've realized that some parts of our project have changed greatly from when we first began, and one of our main focuses for now is reassessing and defining our goals for the remainder of the semester. We plan on meeting with Professor Sofanova, Dr. Badler, and (hopefully) Joe this week, and we will post an update on the details of our project afterwards.

Wednesday, February 25, 2009

Update 4

Since last posting, we read a new series of papers regarding flame simulation, investigated a photon mapper extension of Radiance, and acquired book references and image scans from Professor Holod.

In anticipation of our spectroradiometer readings tomorrow, we finished reading Alan Chalmers' papers on illumination of archaelogical site reconstructions. In the papers, the authors discussed how they conducted light measurements with the spectroradiometer, so we passed on the papers to Cory. We also acquired a new perspective regarding light simulation- while we had initially assumed that we would light the scene with fluid simulations of candle flames, it was illuminating to read how Chalmers' team dealt the lack of light source representation for flame lighting in Radiance. In Chalmers' "Realistic Visualisation of the Pompeii Frescoes" and "High Fidelity Lighting of Knossos" papers, they overcame this problem by simulating candlelight first with a series of illum spheres (illum is a material type in Radiance that is an invisible light source) and later with light voxels tied to data taken from flame video clips.

Nancy looked into the other flame simulation papers listed in last week's entry, as well as a few new ones that were suggested to us by Dr. Badler. The most helpful and interesting paper was "Enhanced Illumination of Reconstructed Dynamic Environments using a Real-Time Flame Model" by Bridault-Louchez, Leblond, and Rousselle. This paper divided all flame simulation papers into three categories: physically based methods, approximation methods, and methods that incorporated real world data. Since we are interested in something that is more physically accurate, this eliminates approximation methods. The methods in Chalmers' papers can be categorized into the third category; Bridault-Louchez et al add that the downside to these methods is that while being high quality, they do not allow "interactive animations." We're not quite sure what "interactive" means, although it is important to be able to render images of the mosque from several different viewpoints. As for physically based methods, the paper mentions that "Physically Based Modeling and Animation of Fire" by Nguyen et al was the most realistic method in 2006; drawbacks include complexity and long computation times.

The paper then goes on to explain their method for simulating candlelight in archaelogical site reconstructions, which includes simulating flames with the Navier-Stokes equation, using particles as control points to create a NURBS surface, and using a spectophotometer to capture the photometric distribution of a real flame. The results are good and this method seems to have been designed specifically with lighting archaelogical reconstructions in mind, but we are unsure about its complexity, and plan to ask about this method and other papers' methods at the meeting on Thursday. As for the other papers, "Three Dimensional Tomographic Reconstruction of the Luminosity Distribution of a Combustion Flame" and "Digital Imaging-Based Three-Dimensional Characterization of Flame Front Structures in a Turbulent Flame" constructed a 3D flame based on 2D images captured on cameras, and "Extending the Photon Mapping Method for Realistic Rendering of Hot Gaseous Fluids" involved adding flash, flash reflection and emission maps in addition to the global and caustics maps usually involved in photon mapping. Hopefully, we'll be able to decide on the best path to take in regards to flame simulation on Thursday.

In our ongoing struggle to get a handle on Radiance, we discovered that there is a photon mapper extension of Radiance 3.7. Given our interest in rendering the scenes with both Radiance and a photon mapper, we decided to investigate the extension over the weekend. I made several attempts to either add the photon mapper code to an already installed version of Radiance or to install a version of Radiance compiled with the photon mapper code. However, due to compilation errors and our limited experience in Linux, we have yet to get the photon mapper code working. We plan to talk to friends of ours who have experience with Linux so that we can get this resolved by tomorrow.

Lastly, after many missed connections over the course of the last two weeks, we finally managed to receive a fuller set of glass lamp images and book references from Professor Holod. During the span of two meetings, Professor Holod gave us a set of relevant image files and provided direction on how she believes the lamps should be placed and lit inside the mosque. She also wrote out a list of books on reserve in the Fisher Library. We will stop by there tomorrow to scan select pages from Meditation of Ornament, Glass of the Sultans and Cairo of the Mamluks.

Monday, February 16, 2009

Update 3

Since our last update, we have made more progress in our work with Radiance. To familiarize ourselves with the basics of how Radiance works, we rendered a simple scene with a ball on a cube. However, since we are mostly interested with being able to render complex scenes of the Mosque of Cordoba, we didn't spend much more time creating and rendering basic geometry.


Sphere with crystal texture on a cube, rendered in Radiance

Our next focus was being able to render Maya scenes in Radiance. Here, we ran into some difficulties. Radiance offers two options for converting obj files into Radiance-compatible files: obj2mesh and obj2rad. obj2mesh compiles the obj file into a Radiance triangle mesh, and is supposedly more efficient and allows the use of local uv coordinates. On the other hand, obj2rad takes the obj file and compiles it into a Radiance scene. We attempted to use the obj2mesh method at first with a simple lamp model, but were unable to get anything to show up in the render window. We plan on continuing to troubleshoot this this week, and were thinking of also trying obj2rad, just to have a starting point.

Other than the tutorials and reference manual on the Radiance website, we haven't been able to find a lot of other documentation on Radiance. We did come across Render Toolbox, a set of tools that simplifies the process of rendering Maya files with Radiance. According to its wiki page, the project is in a beta stage and is headed by David Brainard, a psychology professor at Penn. If we are unable to resolve our problems with obj2mesh and obj2rad, we may contact Professor Brainard for help.

We also found two archaelogical papers: "High Fidelity Rendering of the Interior of an Egyptian Temple" by Ivana Rudolfova and Veronica Sundstedt and "High Fidelity Rendering of Ancient Egyptian Gold" by Carlo Harvey. Both of these papers have been useful examples of rendering Maya scenes; interestingly, we noticed that both of these papers used the obj2rad method.

Giulio Antonutto's Radiance website has been helpful as well; the website contains basic tutorials and links to Radiance workshops, where we found a PDF presentation on how to run Radiance on Windows. According to this presentation, there are five different Radiance distributions for Windows: Rayfront (development stopped in 2003), Adeline (development stopped in 2002), Desktop Radiance (development stopped in 2001), and the Cygwin and Mingw binaries, both of which are almost up to date. Following instructions, we installed Cygwin on a PC running Windows XP, and were able to successfully run and render a simple scene in Radiance. Previously, we had planned to conduct benchmarking tests between the Windows version and Linux version of Radiance. This was temporarily placed on hold when Cory informed us that he wasn't able to get the Windows versions to run. It now may be unncessary to conduct benchmarking tests; Cygwin allows the Linux version of Radiance to be run on Windows, so the same version of Radiance is essentially being used on both operating systems.

On February 5, we met with Professor Holod at the University of Pennsylvania Museum of Archaelogy and Anthropology to examine artifacts of ancient glass and a small candelabra. We plan to meet with Professor Holod again soon to take measurements of these glass artifacts with the spectroradiometer, and will also be obtaining scans of Islamic glass lamps from the book Glass of the Sultans later this week. Once we have the scans and measurements, we can begin modeling and texturing.

From our meeting on February 12, Dr. Badler informed us that we would receive the spectroradiometer sometime this week. Since we only have it until February 27th, one of our priorities till then will be taking measurements of the glass, paraffin, beeswax, olive oil, etc.

Becky and I also looked into flame simulation. As discussed at the meeting, one of the problems with flame simulation is that it is important to have an accurate physically based simulation of the candle for the photon mapper. Professor Safonova told us that unfortunately, the priority in computer graphics for flame simulation has been placed on a realistic appearance instead. Becky and I will be looking into some papers on this problem; so far, our list consists of:

- "Digital Imaging-Based Three-Dimensional Characterization of Flame Front Structures in a Turbulent Flame" by Bheemul, Lu, and Yan

- "Extending the Photon Mapping Method for Realistic Rendering of Hot Gaseous Fluids" by Kang, Ihm, and Bajaj

- "High Fidelity Lighting of Knossos" by Ioannis Roussos and Alan Chalmers

- "Simulation and Animation of Fire and Other Natural Phenomena in the Visual Effects Industry" Nguyen, Enright, and Fedkiw

- "Enhanced Illumination of Reconstructed Dynamic Environments Using a Real-Time Flame Model" by Bridault-Louchez, Leblond, and Rousselle

The paper "Visual Simulation and Animation of a Laminar Candle Flame" by J. Raczkowski also came up in our search, but we were unable to find a copy of the paper.

We also got in touch with the newest member of our group, Kaikai Wang. We gave him Brian Summa's photon mapping code, and plan to have some code review sessions soon.

Finally, we recently discovered that Radiance has a photon mapping extension, and plan on looking further into this for the upcoming week.

Sunday, February 1, 2009

Senior Project Update 2

Last Tuesday, we met with Professor Holod, Dr. Badler, Cory, and one of Professor Holod's grad students to learn more about the art history aspect of our project. From Professor Holod we found out more about the Mosque of Cordoba, a 7th century mosque in Spain. A 3D representation of the mosque will be lit in a historically accurate fashion during the lamp simulation component of our project. Professor Holod told us more about the glass lamps used inside the mosque, the materials used to make the lamps, and how they were made. We were also given some information on what Professor Holod was looking for in terms of lighting, and are planning to meet at the museum this Thursday to examine glass lamp samples.

We also met with Dr. Badler, Cory, and Joe on Thursday to go over project details in greater depth. We discussed Radiance, as well as an overview of a project schedule for the semester which will be listed below at the end of this entry.

Alan Chalmers kindly replied to our email and sent us three papers: "Realistic Visualisation of the Pompeii Frescoes", "High Fidelity Reconstruction of the Ancient Egyptian Temple of Kalabsha", and "High Fidelity Lighting of Knossos." At the moment, our priority is learning Radiance and being able to render out images with the photon mapper, but we will be sure to use the information in these papers later on in the semester.

We had somewhat mixed success with Radiance last week. Becky was able to download and install the latest version of Radiance (3.9), and by following a tutorial, rendered out a red ball. Since the latest version of Radiance is Unix software, I worked on installing Linux. Unfortunately, I ran into some technical problems--mainly, I found out that my laptop's wireless hardware isn't supported by Ubuntu's drivers, and I wasn't able to download Radiance. However, we discussed at the meeting on Thursday that we should be leaning towards the Windows version of Radiance anyway, so this is no longer a problem. That said, I now have wireless working on Linux.

This week, we will continue working in Radiance, conducting benchmarking tests between the Unix and Windows version and looking into what illuminants Radiances uses, and which ones are relevant to our project. We will also start looking at Brian Summa's photon mapping code, as well as looking up rendering Maya files in Radiance. During our trip to the museum, we will be making observations so that we can begin modeling and texturing.
=======================================
Project Schedule

At the moment, Becky and I have decided to work on things together. We're still at the stage that requires both of us to be familiar with aspects of the project---Radiance, the photon mapper, etc. For later parts of the project, we are planning to divide the work between individual tasks and peer programming.

By mid-February:
- Spectrometer is obtained; Cory will be taking measurements (liquids too)
[For photon map related tasks, Cory and Kaikai Wang will be helping us as well]
- We should have rendering that works with the spectral characteristics that we want (may need to modify the photon mapper to do this; will have to research wavelength dependent rendering)
- Tested out Brian's photon mapper (with modified environment, increased polygons); benchmark tests will be conducted to compare to Radiance

By March 1st:
- Should be able to render out an environment

Mid March:
- Render with Alan Chalmers' spectra, different material properties, and increased complexity

April:
- Implement flickering motion graph using methods from "Video Textures" paper
          --> Start with random flickering map, and check to see whether Radiance can handle this
          --> Start with one flame, and move onto several flames
- Render out movies and do write-ups

Saturday, January 24, 2009

Senior Project Update 1

This week, we focused on researching and further developing our project. Our initial design document was due on Friday, and in preparation for completing our first draft, we read a series of papers that Dr. Badler had suggested to us, including “Global Illumination Using Photon Maps” by Henrik Wann Jensen, “Extending the Photon Mapping Method for Realistic Rendering of Hot Gaseous Fluids” by Byungkwon Kang, Insung Ihm, Chandrajit Bajaj, and “Video Textures” by Schodl et al. We also emailed Alan Chalmers to request a copy of his paper "Authentic Illumination of Archaelogical Site Reconstructions" and emailed Alla Safanova for suggestions on papers regarding flame and smoke simulation.

On Thursday, we met with Cory Boatright, to go over our design document for the project. After he answered questions we had over various aspects of our document and the project in general, we talked about goals for the upcoming weeks, and shared what we each knew about the project's current status.

The next day, we received feedback on our design document from Joe Kider during a DMD Senior Project meeting, as well as general advice on how to navigate through our project successfully. Based on the feedback, we made minor changes to our initial design document, and submitted it online.

For next week, we intend to begin exploring and learning Radiance. We also plan to read or reread relevant papers to get a better grasp on methods and algorithms; new papers include "High Fidelity Lighting of Knossos", "High Fidelity Reconstruction of the Ancient Egyptian Temple of Kalabsha", and "Realistic Visualisation of the Pompeii Frescoes" from Alan Chalmers.

We plan to meet with Dr. Badler and other group members later this week to discuss developments on the project, define each team member's responsibilities, and to chart a course for the project over the semester. We were informed that we'd also be meeting with Professor Holod this week; if the meeting is early enough in the week, we will begin to work on glass and metal textures.

Project Abstract

In this project, we have a two-fold goal. First, we plan to produce a working photon-mapping renderer that can handle dynamic light sources. Secondly, we would like to use this renderer to animate light in order to simulate both the illumination from video screens and the illumination from medieval hanging glass oil lamps.

Initial objectives will include research and background reading, meeting with our advisors and group members to plan the overall project, splitting up responsibility for the various portions of the project, obtaining the photometric properties of the glass lamp and material refractive properties, altering a basic photon mapper, and modeling the lamp and the flame. Flame modeling methods will be based on the paper “Extending the Photon Mapping Method for Realistic Rendering of Hot Gaseous Fluids” by Byungkwon Kang, Insung Ihm, and Chandrajit Bajaj.

After successfully modeling the flame and setting up the photon mapper, the next step would be to generate video texture motion graphs with cached photon emission data based on methods explained in the paper “Video Textures” by Schodl et al. We will use this to create images and/or video clips of our two scenes with glass oil lamps and video screens.