The Personal Website of Stefan Webb

OpenRay: Ray Tracer with Global Illumination

I am working on a ray tracer that uses photon mapping. I would like to build a graphics chip that can render global illumination in real-time, and so I am writing this program to teach myself about ray tracing. Eventually this project will, I hope, support advanced features like custom shading, wavelet compression of BRDF's, NURBS surfaces, and photon mapping. Some of the code is shared with OpenPress, such as the XML-like parser. The first release is forthcoming.

13th September, 2009

I can perform ray casting on spheres and planes. You would be suprised how much work it has taken to accomplish this simple task! Below is an example of a description file and its output,

<openray version = '0.1'>
	<!-- Debug scene -->
	<scene id = "testScene">
		<camera
			location = "0, 0, 1"
			direction = "0, 0, -1"
			up = "0, 1, 0"
			focalLength = "0.2"
			hRes = "480"
			vRes = "300"
			hScale = "0.48"
			vScale = "0.3"
		/>
		
		<sphere
			center = "0, 0, 2"
			radius = "0.5"
			color = "0.8, 0.2, 0.1"
		/>
		
		<sphere
			center = "-0.5, 0, 2"
			radius = "0.25"
			color = "0.2, 0.2, 0.7"
		/>
		
		<plane
			normal = "0, 1, 0"
			point = "0, -1, 0"
			color = "0.1, 0.8, 0.3"
		/>
	</scene>
</openray>

7th September, 2009

The parser now allows nodes to be deleted, inserted, and modified dynamically. Also, I been thinking about how I can improve the parser for the next version.

31st August, 2009

So far I have written a parser for an XML-like syntax, with a macro processing in Lua. Here is an example of how you can use the macro processor,

<openray version = '<?lua print(1.0) ?>'>
	<!-- These are the scenes -->
	<?lua for i = 1,10,2 do ?>
		<scene />
	<?lua end ?>
	
	<!-- This is a composition -->
	<composition />
</openray>
=>
<openray version = '1.0'>
	<!-- These are the scenes -->
	<scene /><scene /><scene /><scene /><scene />
	
	<!-- This is a composition -->
	<composition />
</openray>

This language will eventually be described in BNF. I will work on simple ray casting next.