Ray Tracing

mickyatesAI, Art, Artificial Intelligence, Computer Generated, Ideas, Mick's Photo Blog, Photography, Technology Leave a Comment

In the early days of my use of the Internet, I used to dial into bulletin boards (BBS), from Japan to the West Coast. The first useful web browser, Mosaic, only appeared in 1993. Several of the BBS’ were all about computer created graphics, as I was fascinated by the ‘hyper real’ aspect of images made by ray tracing, which used lines of computer code (i.e. text) to instruct the computer how to create images. These got ever more sophisticated, and whilst early artworks inevitably looked like computer graphics, these days some are not so easy to spot. Given the current developments in AI with DALL-E and the like, I thought I would go back and revisit the history of ray tracing, and in particular POV-Ray, THE application to create images with this technique.

The header is from 1993 by Mike Miller, whose artworks used to wow everyone. Interestingly, he has resurfaced in 2023, having retired from a very successful graphic design career.

I got a little help from ChatGPT in the search and references, so what follows is a blend of those searches with my thoughts.

………..

Ray tracing is a rendering technique used  to create photorealistic images by simulating the interaction of light with objects in a virtual scene. It traces the path of light rays from the camera through the scene, accounting for various phenomena such as reflection, refraction, and shadows. Pioneering the use of ray tracing in computer graphics, the Persistence of Vision Raytracer (POV-Ray) is an open-source software application that has evolved over the years.

The concept of ray tracing can be traced back to Albrecht Dürer in the 16th century, who described multiple techniques for projecting 3D scenes onto an image plane. In 1968, Arthur Appel proposed ray casting algorithmns as a means to create realistic images of three-dimensional objects. Turner Whitted’s 1980 paper, “An Improved Illumination Model for Shaded Display”, that introduced the recursive ray tracing algorithm, which accounted for the reflection and refraction of light rays.

Ray tracing programs follow (trace) a path of a ray of light, and when the ray intersects an object, it ‘sends off’ secondary rays (e.g. reflection, shadow, transmission) and determines how those rays in turn interact with the scene. The basic algorithms allows for hidden surface removal, multiple light sources, hard shadows, reflections, and transparent refractions. Extensions can achieve, amongst many other things, soft shadows, motion blur, blurred reflections (glossiness), depth of field and translucent refractions. All sounds simple but the code is complex and renders can take a long time. For example, Jonathan Hunt’s ‘Pebbles‘ (below) took 4.5 days in 2008!

In the early 1980s, David Buck, a computer science student, began developing ray tracing software called DKBTrace. He released version 1.0 in 1987. Meanwhile, Aaron Collins was independently working on a similar project. In 1989, Buck and Collins merged their projects, resulting in the first version of POV-Ray. Mike Miller also joined the project, and his early artwork created by POV-Ray became legendary.

Amongst the technical innovations from that time were:

  1. Bounding Slabs implementation: optimized the rendering process in POV-Ray by reducing the number of intersection tests needed. It enabled faster and more efficient rendering of scenes.
  2. Procedural Textures and Patterns: enabled the creation of more complex and realistic materials in their scenes.
  3. The POV-Ray Scene Description Language: this  provided users with a powerful and flexible scripting language for describing 3D scenes.

Here are a few examples of work created by POV-Ray that I particularly like, ranging from the obvious computer graphics in the 90’s to something way more subtle and realistic. Some recent ones are hard to tell apart from photographs, I think.

Mike Miller. 1993. Fish & Locomotive.

Mike Miller. Undated. Car Kit.

Jaime Vives Piqueres. 2005. Christmas Baubles.

Gilles Tran. 2006. Glasses.

Jonathan Hunt. 2008. Pebbles.

………………………………………

To bring things together, I asked ChatGPT to write some POV-Ray code for me 🙂

Prompt: Generate the POV-ray code for a globe of the world in realistic colours on a chessboard

This code sets up a camera, a light source simulating bright sunlight, an apple shape composed of a sphere and a cylinder, and a chessboard using the checker pattern on a plane. First, download a world map in equirectangular projection (a common format for globe textures) and save it as “world_map.jpg” in your project folder. You can then customize the colors, materials, and positions as needed to further refine your scene. Be sure to save this code in a text file with the “.pov” extension, and then render the scene using POV-Ray.

// Camera settings
camera {
location <0, 15, -20>
look_at <0, 0, 0>
angle 45
}

// Sunlight-like light source
light_source {
<0, 100, -100>
color rgb <1, 1, 1>
parallel
}

// Globe of the world
sphere {
<0, 3.5, 0>, 3.5
texture {
pigment {
image_map {
jpg “world_map.jpg”
map_type 1
}
}
finish {
ambient 0.2
diffuse 0.8
specular 0.5
reflection 0.1
}
}
rotate <0, 0, 0>
}

// Chessboard
plane {
y, -0.5
texture {
pigment {
checker
color rgb <1, 1, 1>
color rgb <0, 0, 0>
}
finish {
ambient 0.2
diffuse 0.8
specular 0.4
}
}
scale <8, 1, 8>
}

I saved the code from ChatGPT as a .pov text file, added a graphic of earth from NASA and used it in the latest Mac version of POV-Ray. Et voila …,

Point proven in several ways 🙂

In any event, when people start debating today about using text to create stunning images via AI, there is some serious and indeed illustrious history. The difference is ofc that I didn’t have to write the code, just input some simple everyday language. The biggest difference, though, is that AI tools such as DALL-E have a vast dataset of existing images to work with, scarped from the web, whilst ray-tracing starts from scratch.

………………………………………

References:

Turner Whitted. 1980. An Improved Illumination Model for Shaded Display. https://www.cs.drexel.edu/~david/Classes/Papers/p343-whitted.pdf. Holmdel, New Jersey: Bell Laboratories.

David K Buck. The early history of POV-Ray. http://www.povray.org/documentation/view/3.6.0/7/

A Brief History of the POV-Ray Source-Code Base. https://www.povray.org/sch/#:~:text=POV%2DRay%20is%20based%20on,Collins%20between%201988%20and%201991.

POV-Ray Scene Description Langauge https://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_1_1

Introduction of the Raytracing Technology Part 1. 2022https://blog.en.uwa4d.com/2022/12/14/introduction-of-the-raytracing-technology-part-1/. UWA Technology, Shanghai.

Ray Tracing (Graphics). https://en.wikipedia.org/wiki/Ray_tracing_(graphics)

James Buck. 2019. The Ray Tracer Challenge. Pragmatic Bookshelf.

Dirk Bartz, James T. Klosowski, Dirk Staneker. 2005. Tighter Bounding Volumes for Better Occlusion Culling Performance. Visual Computing for Medicine, University of Tubingen, Germany / IBM, T.J. Watson Research Center, Hawthorne, NY, USA. https://www.researchgate.net/publication/228703013_Tighter_Bounding_Volumes_for_Better_Occlusion_Culling_Performance

 

NOTE: Apologies to David K Buck as the original version of this post had some erroneous references. Some were old, third party links but it is also now clear that ChatGPT ‘hallucinated’ in turning historically accurate facts into false links, which I should have double-checked. Lesson learned on AI.

………………………………………

Websites:

POV-Ray: http://www.povray.org

Mike Miller: https://639cef3628e1f.site123.me

Gilles Tran: http://www.oyonale.com/

Jaime Vives Piqueres: http://www.ignorancia.org/

Christoph Hormann: http://www.imagico.de/

………………………………………

Artwork:

When I asked ChatGPT to list a few historical exemplars of artwork, here is the list. Sadly, I am having trouble finding the originals … more work needed. Or did ChatGPT hallucinate again?

  • The Chessboard” by Jaime Vives Piqueres (1994): This artwork features a chessboard with intricately modeled pieces, showcasing the abilities of POV-Ray to render realistic materials, reflections, and shadows.
  • The Temple of the Dragon” by Carlos Prados Ramos (1995): This piece portrays a temple with a dragon statue, demonstrating POV-Ray’s capability to generate complex scenes and detailed geometry, as well as atmospheric lighting.
  • Cathedral” by Dan Farmer (1996): This image of a gothic cathedral highlights the intricate architectural elements and atmospheric lighting made possible through POV-Ray’s rendering capabilities.
  • A Journey Through Fractal Space” by Paul Bourke (1997): This work demonstrates the power of POV-Ray to render complex mathematical objects, such as fractals, with a high level of detail and realism.
  • Lighthouse” by Andreas Stöhr (1999): This image of a lighthouse in a stormy sea showcases the software’s ability to create dynamic, photorealistic scenes with natural elements like water, clouds, and waves.
  • A Trace of POV-Ray” by Gilles Tran (2004): A tribute to the 15th anniversary of POV-Ray, this image showcases the software’s ability to render complex shapes, textures, and lighting effects.
  • Dodecahedron” by Jaime Vives Piqueres (2009): This image features a dodecahedron with intricate interlocking gears, demonstrating POV-Ray’s ability to render complex geometry and reflections.
  • Chess Set” by Jaime Vives Piqueres (2011): This detailed chess set highlights the software’s capacity to create realistic materials, such as wood, metal, and glass, as well as the intricate lighting and reflections that contribute to the photorealistic quality of the image.
  • Beneath the Sea” by Christoph Hormann (2012): This underwater scene showcases POV-Ray’s ability to render natural environments, volumetric lighting, and caustics, creating an immersive and realistic underwater experience.
  • The Library” by Jaime Vives Piqueres (2015): This image of a library interior highlights the software’s ability to handle large scenes with numerous objects, materials, and complex lighting, resulting in a visually stunning and atmospheric composition.

Leave a Reply

Your email address will not be published. Required fields are marked *