Sunday, 8 September 2013

Nvidia OptiX ray-tracing, the future of graphical fidelity

Today's piece is a bit different to the usual. I have been experimenting with graphical rendering techniques and wanted to share some of my findings with you. Obviously my decision on what to use was aided by the fact that I have an Nvidia GPU!

OptiX by NVidia is an SDK based on the ray tracing algorithm. OptiX is a framework for development of applications utilising ray tracing. Ray tracing is a technique that is an extension of the light rendering procedures used in contemporary animation and video games. Ray tracing sets each individual pixel of a monitor using an algorithmically generated model of light reflections. The path is of the light determined by an interpretation of how real light waves behave. The model is then displayed as if it were a reflection created by light, interpreting it as the human eye would see a real object. The visual effect created on each pixel is as if it had been reflected from an object in the image plane.

Raytracing is the closest rendering technique currently available to modelling actual light and is considered an enormous leap towards photorealism in graphical rendering. This comes at a huge performance cost, no commercially available graphics card for home users can currently preform ray-tracing for complex graphics while maintaining a solid frame-rate. The images produced are far beyond the level of realism that can be achieved by traditional graphical rendering. Ray tracing can be used to create absolute photorealistic shadows, lighting effects, reflection and refraction, scattering, and chromatic aberration.

Snooker Balls created with OptiX, it's difficult to tell
thatthey aren't real!

Ray tracing is becoming an increasingly popular method for graphical rendering. This growth is caused by an increase in graphical rendering power available. OptiX’s ray tracing algorithm’s ability to create a realistic simulation of lighting is the future for all computer generated images. When compared to other rendering methods, such as the more traditional ray casting or scanline rendering, ray tracing is found to be far superior.

When creating complex graphical effects ray tracing has the power to overwhelm its competition. For example, when creating resource-intensive effects like reflections and shadows using traditional methods they need to be programmed separately. The rendering of these also tends to be performed on the CPU, especially in the case of shadows which need to be programmed and rendered individually even when relatively simple. When using ray tracing, reflections and shadowing, including self-shadowing of objects and all conceivable complex graphical effects, that wouldn’t be possible using traditional techniques, are an innate product any graphics created using the ray tracing algorithm.

With a traditional rendering algorithm all lighting effects have to be programmed separately and making them photorealistic is unrealistically resource intensive. Using ray tracing all lighting effects are rendered by the algorithm, this means that the graphical power to render properly ray traced light remains fixed. Because of the static nature of the computational power required, though obviously more complex scenes require more power, ray tracing will eventually completely replace traditional rendering techniques when the power of graphics cards gets over a certain threshold.
A demo of ray tracing showing the effect of light on non-refractive
 surfaces, running on a high-end home computer.
The NVidia OptiX ray tracing engine represents a new benchmark of authentic light effects in computer generated images. The engine increases ray tracing speeds exponentially when rendering 3D models on GPUs using NVidia’s CUDA architecture. The time taken to produce ray traced graphics has been reduced from minutes to milliseconds. This allows professional animators and graphic designers to inspect outcomes in real time, using their own machines. This makes development with ray tracing favourable to traditional development where effects are added one at a time in post-production.

NVidia recommend using products from the Quadro or Tesla lines in the machines that the rendering is being performed though the GeForce cards are technically capable as well. NVidia’s recommended products start at around £6,000 and increase to £10,000 and above at the top end, though these prices are considered industry standard for rendering CGI. The more expensive Qudaro branded collection is considered to currently be unsurpassable by their competition, with NVidia claiming that “Quadro is where professionals turn when combining graphics and ray tracing”.

The Bugatti demo, showing the realistic effects of ray
 traced light and the OptiX engine in use.
The OptiX engine isn’t limited like traditional renderers to only graphical interpretation. The OptiX engine, as a result of the nature of ray tracing, encompasses procedural delineations that guarantees the results are exact, well composed, balanced and produced quickly. Hybrid rendering is also possible due to the nature of the content created.

While graphical rendering is the most obvious use of the OptiX engine, it is also being used by physicists for research into electromagnetic radiation behaviour modelling, particle collision analysis and the propagation of light though and around objects with proportions larger than its wavelength. The engine reaches its limitation for use for physicists at this point though as interference and diffraction are calculated using wave theory and complex computations around the phase of the wave and thus cannot be computed using ray tracing which models waves based on ray theory.

Ray tracing can also be used for calculation of acoustics of rooms with the OptiX engine being one of the most easily available and well supported methodsFor an architect or engineer designing any room or building when acoustics are important OptiX is the only engine that can be used for high quality graphical rendering, lighting effects and using ray tracing to model sound. This can speed up development times and increase the quality of the engineers work.

Optix’s application for modelling the behaviour of light means
Raytraced light causing reflections through simulated
 glass, no extra programming required

it is increasingly used in architectural design. A huge advantage of using the OptiX engine from a designer’s point of view is that the 3D model that needs to be created for acoustic testing can also be tested to see how bright the room will be in real time using natural light of varying strengths or electric lights. This is ground-breaking in terms of graphical rendering and the luxury afforded to anyone wanting to be able to use these cutting edge techniques. Increased access to OptiX is likely to allow it to step into the computer aided design market and revolutionise the way blueprints are created. The techniques and deep analysis tools created for complex particle modelling are a significant step towards procedural design of actual buildings and revolutionary power efficiency developments. This is all made possible by the speed of rendering afforded by the OptiX engine.

Interpretation of the ray tracing algorithm is hard coded into all CUDA architecture hardware, meaning that all of NVidia’s products are able to produce it. NVidia announced in 2009 that they predict that affordable processing units that are capable of ray tracing will be available in around 2016. This is also when they announced the release of the OptiX engine and it’s SDK to the world. The work done over the past 3 years as well as the continuing efforts of NVidia alongside their many high profile supporters (including John D. Carmack of id Software and NASA) have left them in a position where there is currently no competition in the market. The speed of their development also means that nobody will be able to catch up with them at any point in the foreseeable future. With main rivals ATI, the loudest detractor of the CUDA architecture, ultimately being forced to design an analogous system for their own graphics cards.

An example of graphically rendered glass and it’s
interaction with light created using NVidia OptiX.
Certain programming techniques that are not designed for graphical acceleration, such as adobe flash, are unable to utilise the power of the OptiX SDK and will suffer from artefacting and video lag when rendering more complex graphical output, leaving any attempt at ray tracing futile. Though this criticism of these languages is traceable back to all graphical rendering, particularly 3D rendering and is not unique.

The OptiX engine is extremely limited in its use cases, however it is extremely good at what it does. For the average user the financial outlay is currently too high to begin work with this technology. Even if NVidia release schedule goes to plan, in 2016 ray tracing will still only be used in a few of the most cutting edge games and will be un-usable for most people. The next major victory for ray tracing will likely be in the early 2020s which is the earliest prediction of a generation of home games consoles that could be released with ray tracing capabilities. Until then the OptiX engine will remain extremely niche, although from NVidia’s point of view the OptiX engine’s success will make their cards preferable for that generation of consoles to use.

A room rendered on a Tesla GPU showing the full potential of
OptiX, and what we can expect out of future games consoles.
The OptiX engine programs the ray tracing itself, completely bypassing the extremely complex computational side of producing ray-traced images. This allows users to focus on the actual design. For someone wanting to utilise design specialists the engine facilitates the practise of focus on what they are best at, i.e. design. This can also be extended to physicists, architects, engineers or any professional whose output is design. Using the OptiX engine you can yield the results you want from ray tracing quickly and without impeding on the design process.

It is very difficult to criticise NVidia over OptiX. It may be possible to criticise OptiX’s failings in relation to its ability to programme some high intensity physics mapping, such as wave theory. This is unavoidable with the stage we are in in graphical processor development. Any complaints about its inaccuracy are negated by how cutting edge it is. With no competition, no other commercial sources of ray-tracing currently available and a demand for the technology, NVidia have made all the right moves with OptiX when trying to out-manoeuvre their competition. With their main rivals in cutting-edge graphical technology conceding that the CUDA architecture was superior. Their moves towards ray tracing for graphical rendition of photorealistic computer generated images is a ground-breaking success, the full scope of which is only just now being discovered. 

Moving on from ray tracing, fully accurate physics models can be created in future versions of OptiX or its successors. This will pave the way for new scientific research as well as photorealistic graphics for video games and movies. The effect of dynamic and realistic lighting moving as if reflected from within the screen removes many of the criticisms of computer generated images. Ray tracing is currently being used in conjunction with techniques such as bump-mapping and Perlin noise to create totally procedurally generated vistas, towns and even continents, all with photorealistic features. The 2009 release of NVidia OptiX represented the most important milestone since the birth of 3D graphical rendering and todays bleeding edge techniques are tomorrow’s reality for all home computer users.

If you have a medium to high end PC at home and you want to check out OptiX for yourself you can download most of the demo's shown here. Prepare to have you mind blown!




References:

Whitted T. (1979) An improved illumination model for shaded display. Proceedings of the 6th annual conference on Computer graphics and interactive techniques.

Nikodym, T. (June 2010). Ray Tracing Algorithm For Interactive Applications. Czech Technical University, FEE.

GPU Gems 2, Chapter 38. High-Quality Global Illumination Rendering Using Rasterization, Addison-Wesley

Proceedings of 4th Computer Graphics Workshop, Cambridge, MA, USA, October 1987. Usenix Association, 1987. pp 86–98

No comments:

Post a Comment