Development stage lighting simulation system is of great significance for the work of stage lighting design, stage model is various, for different stage, the need to the corresponding lighting design. So, in the process of stage lighting design work will have a lot of uncertainty. In this article, through the simulation stage lighting effect, can reduce energy and time.
Through the use of the OGRE engine architecture, can more easily simulate lifelike three-dimensional lighting environment, immersive and interactive ability of the virtual technology itself has not only the static design and creation can be transformed to a dynamic form of reproduction, but also in a timely manner to capture and show the designer's ideas, creativity and inspiration, a mature and perfect platform for the virtual design system for lighting designers, performance director, lighting control operator, or for lighting lighting art teaching and do a presentation, etc is a very professional and practical design tools and right-hand man. And convenient real-time interactive function, make the system more real-time and operability. This system provides a real-time interactive operating environment, meet the needs of the user.
A, the system architecture
1. The logical architecture
Both games and virtual reality, in order to show its lifelike, most virtual scene is more complex, so most of the virtual scene creating generated by 3 d modeling tool, and then to the scene real-time rendering output. Stage lighting design provided by the 3 on3dmax basic scene file, through the DOM (Document Object Model) interface for parsing, and carry on the import and the scene of the resources. Eventually into the OGRE
System for rendering.
Illumination model is a variety of, need to achieve their effects respectively in the scene. At the same time the user to be able to take with the UI interface for all kinds of operation. System requirements operation complexity is high, large amount of calculation and strong extensibility. Need to design and build a data processing and high calculation efficiency and strong extensibility, and functional module loose to oa cohesive overall implementation architecture (see figure 1), the system can be divided into resource layer, interface layer, rendering layer.
Resource layer: from 3 + Ofusion on3dmax plug-in export, generate scene organization, material, entity, texture, etc required by the system resource files.
The interface layer: is responsible for the resource file import scenario.
Scene rendering layer: the implementation stage and the rendering of lamplight, the management of system resources, the real-time response of user interaction, etc.
Second, the key techniques of system implementation
1. The scene of the organization and formation
Required by the system resource file by Ofusion on3dmax plug-in export from 3. Scene organization export file is in XML format, some of the basic parameters of the records on the stage, and the position of the entity, each stage towards all aspects such as information. Scene node tissue in the form of a tree each node has the appropriate parent node, so we can pass to the operation of the parent node, convenient make more child nodes move and rotate at the same time.
2. 3 d coordinate transformation
Of the 3 d rendering results show to the 2 d screen, need to be from the 3 d coordinates to the plane coordinate conversion. First, you need to create a 3 d coordinate system, we create a 3 d biaxial lateral oblique coordinate system, the x axis direction is horizontal to the left, the z axis is in the vertical upward, y axis direction for 45 ° Angle and horizontal direction. In the coordinate system is shown in the graph, the length of the x axis and z axis graphics actual length, and the length of the y direction is to take half of the actual length.
Formula, eta x, y and eta eta is x, y, z axis z axis deformation coefficient. Axonometric projection transformation, can get the following formula:
The f and d is axis transformation matrix coefficient measurement, solving the equation, available:
In order to make the stereo sense is stronger, makes the d = f = 0.354, you can find out shaft measuring technology transformation matrix:
Next, you need to convert graphics three-dimensional coordinates to device coordinates on the screen, in the perspective window, origin of coordinates is located in the top left corner of the screen, to the right direction to x axis direction, the downward direction to y direction.
Assumptions in the three-dimensional space point (x, y, z), the device coordinates are the coordinates of (xx, yy), using just axonometric projection transformation matrix, can get the following conversion formula:
Formula of xX, yY, is the origin of the 3 d coordinate relative coordinates in the device coordinate system.
The formula (4) into (5), can transform equation:
3. The effect of particle system simulation
The particle is represented with quadrilateral. It has a width, direction, color, life, quantity, material, weight, and rate of attributes. Particle properties by the Particle Emitter (Particle Emitter) and Particle effects influence (Particle Affector) common decision. Particle emitter is in charge of the particle emission of particles in the launch of some of the properties, including movement rate, color and life span, etc.; Particle effects affect the unit in charge of the particle from after launch to change the attributes of this phase particles before they die, decay can be used to simulate gravity, tension, color and other special effects. When the particle emitter constantly spewed massive particles, can be formed such as smoke, fire and explosion effect.
OGRE provides a particle system scripting language that can set various properties of the particles in the script.
In this article, through the particle system describes the stage fireworks, the effect of rain and fog. Combined with the OGRE animation effects, can realize more lifelike scene particle effects.
4. The lighting effects simulation
Lighting is a key factor in stage effect, but also the design system of the core technology. Rendering engine provides several commonly used lights, such as a point source, direction and spot lighting. But for the real effect of stage lighting simulation, these are not enough. For some special lighting effects, such as volume light, etc., need to pass programmable rendering pipeline technology (shader). Shader has two kinds, one kind is a top level, known as the vertex shader (OpenGL called ve vomit white program), instead of fixed transformation and lighting part of the rendering pipeline, programmers can control vertex transformation, lighting, etc. Hardware processing in the vertex shader unit is called vertex shader processors (vertex processing units). Is a kind of pixel level, known as the pixel shader (OpenGL called a fragment program), replace the rasterizer part of fixed rendering pipeline, programmers can control pixel color and texture, sampling, etc. Hardware in the processing of the pixel shader unit called pixel shader processors (pixel processing unit).
In order to make the simulation more realistic lighting, still need to use 3 d lighting equation to simulate calculation. There is often an approximation algorithm, but it can get a good simulation effect and fast speed. There are two common illumination model: global illumination model and illumination model directly. This system adopts the global illumination model. Global illumination model is a good simulate realistic lighting model. It can at the same time considering the light onto the surface reflection, refraction, transmission, shadows and lighting effects of interaction between objects. Using a global illumination model, need to simulate the light propagation and radiation intensity of energy exchange.
For the light track, need to consider the light of direct illuminate results and reflected light illumination on that point, put the two together:
Rest next to calculate radiation, need to compute each another on the lighting conditions:
Ld is illuminant light here, T is light transmission factor, TLi is the light reflection to rest other another, L is the final requirement light &#118alues.
System interface and summarized
Third, system interface
System can realize switching stage, stage of various scenarios effect, can also with scenes and real-time interaction with different lights. As shown in figure 4 stage fireworks for rendering, figure 5 for the volume rendering of light.
Conclusion:
The stage lighting design has become one of the main lighting designers. They often have to face such a high cost, high energy consumption and high time consuming problem. With the vigorous development of the information industry, professional stage lighting field also entered the digital age. System 0 - the GRE/dye engine is used to establish the virtual stage, and to real-time rendering of stage lighting design and adjustment, at the same time to stage lighting designer provides a rich system interaction capabilities, able to solve this problem very well. Next, the system also needs to further enrich the stage lights model, to simulate all kinds of lights, such as: soft light, flashing light, follow spot, etc. The user interface also need to further optimize and improve the user friendly operation.