About companyProductsShopTechnical support
Moravian Instruments
Main page
About company
Software download
Documents download
Products
The Control Web System
VisionLab Machine Vision Software
DataCam Cameras and DataLight Lighting Units
DataLab industrial input/output system
Scientific cameras
Price list
Services
Custom-made Solutions
Technical support
Control Web Examples

Main pageProductsControl Web Software SystemArticles

Modern technologies of computer visualisation
 Don't you have a feeling sometimes that the industrial automation is a somewhat "boring field"? Maybe it is because people deal with it mostly for they have to under the pressure of circumstances. It is their job, their task.

Technologies used in industrial automation are therefore traditional, tested by years and sometimes even decades of practical usage. People investing in their hobby always want the best, they are actively interested in the state-of-the-art technologies and very carefuly consider the price-performance ratio. But at work they generally use assigned tools and the interest in utilizing the most sophisticated resources is not as essential. Fortunately even in this field isn't everything black or white. There are a lot of active and creative people, who are continuously in the quest of finding their way onwards.

Still relatively recently programs running in text mode were commonly used for industrial process visualisation. These programs were quickly displaying column indicators, pipe installations and open or closed valves with the aid of semigraphics characters. That was the time when we were writing letters and e-mails in Windows GUI programs already for many years. But where is the semigraphics now? Its usage could have been justified only by technical incufficiency of computers and the existence of text-based terminals. And those who said that it would always be enough, because semigraphics was utterly sufficient, were luckily not right (I still recall well those "productive" discussions). Today's standard in technological process visualisation is the usage of 2D vector graphics. And again it is certain that it will not last forever.

2D vector and bitmap graphics

In the following text we are going to deal with graphics technologies available in Microsoft Windows environment. The displaying of 2D graphics is done with GDI system (Graphics Device Interface). It is one of three main and oldest parts of the Windows system. Modules KERNEL, USER and GDI are the base of Windows since version 1.0, 2D graphics has therefore always been a solid part of operating system kernel services.

System GDI is being improved and widened with every new generation of operating system, but still maintains continuity with original, today quite aged, conception. Present-day requirement on 2D visualisation presume the existence of support for animation, transparency, gradient filling and picture transformation. That is why there is usually built a more complex and sophisticated drawing system upon the GDI. Today, even the Windows system is equipped with additional technologies for image creation. There is a GDI+ system, whose API consists of a C++ class hierarchy, and a very powerful Direct3D system. GDI+ brings many new possibilities in 2D vector graphics (for example gradient brushes, matrix transformations of coordinate system or color space, alpha blending, etc.), manipulation of bitmaps and also in typography. It is hard to guess future support of this interface at this moment, it may be a dead-end branch. Direct3D is, unlike GDI+, built upon the stadndard of COM interface. This 3D rendering system could be (like OpenGL) used for vector 2D graphics as well.

As stated before, GDI services are a part of operating system kernel (but it is quite hard to trace what is done on the side of the client and what is done inside the kernel). Plenty of calling these services from application to system kernel impose a context switching overhead. This overhead is usually longer than the actual realization of graphical primitive by an accelerator. Therefore even a high-end graphics card is unable to help better graphics performance. Accumulation of function calls and their consecutive massive delivery to system during image drawing completion helps solving these problems. This is the way 2D graphics is dealt with in vector drawing system in Control Web environment.

Fig.1: Own drawings can be in Control Web environment saved to libraries for later application

Next problem is disturbing flickering during screen refresh. It is caused by rendering system directly modifying graphics card memory, which is used for image gereration on monitor. System Control Web copes with it identically for the whole 2D graphics included in the application. Each panel can be with setting the property mode = off_screen ensured that it will be drawn to invisible memory and the result will be transfered to visible part of the memory all at once after finishing the image. This operation is always supported in hardware of the graphics card and is very quick. The resultant image is clear without any flickering.

Fig.2: An example of 2D vector image in Control Web environment.

If the resultant image is treated this way, the way it was created does not matter any more (it is the same for both 2D and 3D graphics). Modern rendering systems for image generation use vector processor with floating point arithmetics and a rasterizer for final bitmap image generation. That way works for example Macromedia Flash, Adobe PDF and Adobe SVG Viewer (Scalable Vector Graphics - W3C XML standard for portable graphics).

Future generation of Windows system called Longhorn is going to operate on a similar basis. New interface Avalon - XAML (eXtensible Application Markup Language) will give an oportunity to describe graphics user interface in a declarative way. Even though we use one of the modern technologies for image creation, we cannot avoid GDI at least for context manipulation and final image placement to destination window. GDI system is going to accompany us still for a very long time and is certainly going to be a part of the new OS Windows Longhorn. But we are more interested in what we can use for the benefit of our applications right now. Let's proceed to the most interesting part - interactive 3D graphics.

3D graphics

What makes a 3D rendering system so interesting? If we pass over unbeatably visually impressive images, then it is certainly the capabilities of today's graphics accelerators. We have a 3D accelerator in every contemporary computer and not using it would be a big waste. It would be like insisting on black-and-white imagery in the age of color monitors. The principle of image creation is similar to the one described in previous chapter. The base of accelerator's horsepower is pipelining and parallelism. For example the today's accelerator GeForce 6800 with more than 220 million transistors has 6 parallel vector processors and 16 parallel pixel processors in hardware (during writing to z-buffer and stencil buffer it has even 32 parallel pixel channels - and that is a big benefit for Control Web and other modern drawing systems). The product are dozens of gigabytes data bandwidth per second and the ability to render hundreds of millions of shaded triangles per second. Now admit - could you leave this potential lie idle?

Fig.3: OpenGL image creation pipeline

Remark:

The Data bandwidth of today's graphics cards may appear as overdesigned. Even the not so recent GeForce FX 5900 can handle a data flow of 27GB/s. But let's calculate the estimated requirements for rendering a scene in resolution 1280x1024 pixels with 60Hz frequency. If we consider z-buffer, color buffer with 32 bits per pixel and 24bit textures, then while rewriting a pixel (i.e. both reading and writing to z-buffer) with color blending (again both reading and writing to color buffer) and two textures with trilinear filtering we get 64 bytes per pixel (and, what is more, we do not consider multiple overdraw of the pixel). With these assumptions we get a data flow more than 5 GB/s. Image created this way would not look as realistic, usually we have to count with multipass rendering, writing to and reading from stencil buffer, etc. In real-world application we will need data bandwidth several times bigger. And what is more, there is a great load of vector data flow (150 million triangles per second means about 3.3 GB/s). It is obvious that we are able to utilise the great facilities of modern accelerators without problems.

Fig.4: Image with mirroring, specular reflections and volume shadows rendered by Control Web with the aid of multipass rendering techniques

A short glance at history

The 3D computer graphics field is coming through a rapid technological development. The driving force ot this progress are indisputably computer games. Thanks to the size of the computer games market, still more powerful 3D accelerators are being developed. The usual performance is about hundreds of millions of triangles per second and tens of gigapixels per second data flow

The milestone in 3D graphics development was the year 1992, when Silicon Graphics (SGI) introduced their Reality Engine. This graphics accelerator contained 8 graphics processors with hardware transform, lighting and rasterization including texture mapping. It cost about million dollars and the proportions were like a home refrigerator. Today, even cheap graphics cards for less than 50 dollars considerably overpower its, at that time revolutionary, performance. During 10 years the price of a comparable graphics accelerator dropped about 20000 times!

The era of cheap 3D graphics accelerators was started by 3Dfx in 1996 with their card Voodoo 1. This successful adapter convinced everyone about the usefulness of hardware support of 3D graphics. By now an accelerator became an implicit part of every home PC, like a mouse or a pair of reproductors. And the near future - hardrware support of 3D graphics is inevitably coming also to handheld computers and mobile phones.

As mentioned before, we can say from the user's perspective with a little bit of pragmatism that we do not care about the principle of image generation. The only thing we are concerned about is that the picture looks good and the rendering does not take too long. We stick to a rule, that what cannot be rendered in realtime, should not be rendered at all. And if we do not want to deal with specific problems of 3D graphics, we do not have to. While building an application in Control Web system we often do not have to bother with creating 3D scene, it is sufficient to make use of only a part of 3D drawing system for common 2D visualisation.

Fig.5: Visualisation of industrial technology rendered in one pass without additional effects

Even then brings us 3D rendering system in Control Web environment great benefits:

  • we use raw horsepower of 3D accelerator to carry over part of the burden from CPU to parallel GPU of graphics card

  • application gets perfect appearance of lit and three-dimensionaly modelled image

  • application program is faster and more precise in realtime - rendering server is in its own thread and his clients running in realtime do not care about graphics at all

Fig.6: With one pass rendering we use raw horsepower of graphics card and save the power of CPU

If we ever want to use more of this graphics technology, we have at hand:

  • editing the 3D scene "in-place" on the desktop of integrated development environment

  • free camera movement in the scene including position and angle interpolation both while editing and at application run

  • a number of prepared 3D objects for quick and easy-going visualisation building

  • tree system of transformation and animation and the possibility of full program control of the scene

  • particle system for realistic and dynamic displaying of three-dimensional effects with objects prepared before (fire, smoke, sparks, etc.)

  • editable materials with an option of transparency, texturing, etc.

  • import of 3D models (*.obj, *.3ds) from various 3D modelling programs

  • light source visualisation and simulation of reflections and light scattering in camera optics

    Fig.7: Volume shadows concurently with light source visualisation

  • mirror surfaces

  • planar shadows

  • volume dynamic shadows with efficient and robust algorithm

  • and much more ...

Fig.8: In-place 3D editor of Control Web development environment provides free movement in the scene being created including drawing all effects

These possibilities show technological advancement of rendering system and of course we do not have to use them always. But it is convenient to have them at hand.

Fig.9:3D rendering machine architecture in Control Web system

The information about 3D rendering system architecture and his placement in Control Web environment structures is important as well. As we can see in Fig.8 the rendering system grants his services only to appropriate virtual machines, not to the Control Web system kernel. Rendering system is therefore dynamicaly loaded with the first virtual machine that needs it. Thus we do not have to be worried that in soft PLC applications without visualisation or in applications with 2D visualisation would the 3D rendering system components interfere, block memory in virtual memory space and delay the application start.

3D rendering in realtime

It is good to take a think why to be interested in 3D graphics in industrial automation(if we went without it for so long :-)). There is perhaps only one argument against it - the building of visualisation is a little harder. This is true to some extent, but the easiness of 3D visualisation creation was the main design of 3D graphics environment in Control Web system. In many cases we can create 3D scenes even without a deeper understanding of the topic and without the need of difficult external 3D model creation. On the other side there are many arguments for the benefit of 3D visualisation:

  • Appearance — now it is the best available visualisation technology. 3D rendering is used for film making, in computer games, for model visualisation in science and research, in CAD programs, for data presentation, etc. Therefore it is more than time to introduce it to industrial visualisation.

  • Performance — 3D accelerator is a common part of every today's computer and it would be a waste not using this potential.

  • Architecture — client-server rendering system, maximum of the rendering is handled outside the operating system kernel. That brings better optimisation opportunities and smoother realtime run.

  • Price — we use the same computer and create the applications the same way as before with 2D visualisations. So we get higher quality without the need to pay too much money.

Fig.10: Control Web system logo rendered in realtime directly by Control Web system

Not using a 3D graphics system for visualisation would be, in the case it is present on the computer in the form of a graphics card and installed drivers (and it mostly is there), like driving a car only with first gear

The domain of industrial automation is traditionally a very conservative field, which however is not one of the technological pioneers in the IT field. But in Control Web system in 3D graphics we can use not only the great power of modern accelerators, but also thanks to the implementation of the latest software technologies and algorithms for three-dimensional visualisation in realtime we can create fast and visually impressive graphics presentations. We do not have to mimic the three-dimensional visualisation with only the aid of bitmaps prepared in advance any more. We can have real three-dimensional visualisation in realtime!

Roman Cagaš, rc@mii.cz

 
 | About company | Products | Technical support | Software download | Documents download | 
Moravian Instruments, Masarykova 1148, Zlin 4, CZ-76302, Czech Republic