CN112184878B - Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight - Google Patents

Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight Download PDF

Info

Publication number
CN112184878B
CN112184878B CN202011103870.3A CN202011103870A CN112184878B CN 112184878 B CN112184878 B CN 112184878B CN 202011103870 A CN202011103870 A CN 202011103870A CN 112184878 B CN112184878 B CN 112184878B
Authority
CN
China
Prior art keywords
rendering
coverage area
lamplight
array
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011103870.3A
Other languages
Chinese (zh)
Other versions
CN112184878A (en
Inventor
丁伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongzhi Software Co.,Ltd.
Original Assignee
Luoyang Zhongzhi Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luoyang Zhongzhi Software Technology Co ltd filed Critical Luoyang Zhongzhi Software Technology Co ltd
Priority to CN202011103870.3A priority Critical patent/CN112184878B/en
Publication of CN112184878A publication Critical patent/CN112184878A/en
Application granted granted Critical
Publication of CN112184878B publication Critical patent/CN112184878B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application relates to a method, a device and equipment for automatically generating and rendering three-dimensional night scene lamplight, which are characterized in that a projection area of a rendering scene on a preset plane is obtained, a pre-built array is added in the projection area, a current coverage area of a camera window with the same shape as an array block in the array is detected, lamplight particles are distributed in the current coverage area according to a preset rule, lamplight rendering is carried out on the current rendering scene corresponding to the current coverage area, along with the movement of the camera window, the movement coverage area of the camera window in the array is determined, the lamplight particles in the current coverage area are transferred to a position corresponding to the coordinates of the array block of the movement coverage area, and lamplight rendering is carried out on the movement rendering scene corresponding to the movement coverage area, so that each lamplight particle is always distributed in the camera window according to the same coordinates, the regional effect overview is realized, the quantity of lamplight particles required to be rendered is reduced, and the running speed and the drawing efficiency are further effectively improved.

Description

Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight
Technical Field
The application relates to the technical field of lamplight rendering, in particular to a method, a device and equipment for automatically generating and rendering three-dimensional night scene lamplight.
Background
The lamplight is helpful for expressing emotion, eyes of audiences can be guided to specific positions, larger depth can be provided for scenes, rich layers are displayed, the model is more stereoscopic and attractive, and the application of the lamplight has become a pandemic trend.
At present, the common lamplight rendering modes include the following: first, advanced global illumination renderers and global illumination renderers track rays between model surfaces, primarily in terms of "ray tracing", which are continually reflected by certain object surfaces to other object surfaces until they disappear from the scene. Secondly, according to the radiance rendering method, reflection energy continuously bounces in a scene and the energy is weakened step by step through integrating cache irradiance calculation. Light effects are studied on the basis of geometry, energy source, geographical location, date or material, or particle systems as light sources. Third, the lumobjected effect, lumobjected, allows self-luminous objects to act as light sources, and controls the attenuation of light to achieve a radiant effect to some extent, providing lighting effects in the form of incandescent lamps, solid light sources, and special material properties. Fourth, a polygonal coloring spotlight uv master uses a panorama as a background fitting model by a BPR rendering function, and performs illumination and coloring of the environment at the time of rendering.
However, in the light rendering method in the prior art, one-key insertion of large-area light cannot be realized, the large-area light can be placed one by one, regional effect overview cannot be formed, and the operation speed is low when the light is too much, so that the drawing efficiency is affected.
Disclosure of Invention
In view of the above, the application aims to provide a method, a device and equipment for automatically generating and rendering three-dimensional night scene lamplight, which are used for solving the problems that the existing lamplight rendering method cannot realize one-key insertion of large-area lamplight, can only be placed one by one, cannot form regional effect overview, and has low running speed and influence on drawing efficiency when the lamplight is too much.
In order to achieve the above purpose, the application adopts the following technical scheme:
a method for automatically generating and rendering three-dimensional night scene lights, comprising:
acquiring a preset surface of a rendering scene as a projection area;
adding a pre-constructed array in the projection area; wherein each array block of the array is provided with the same coordinate system;
detecting the current coverage area of a camera window with the same shape and size as any array block in the array;
distributing light particles in the current coverage area according to a preset rule, and performing light rendering on a current rendering scene corresponding to the current coverage area;
determining a movement coverage area of the camera window in the array as the camera window moves;
transferring the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area, and performing light rendering on a mobile rendering scene corresponding to the mobile coverage area;
and taking the moving coverage area as the current coverage area when the camera window moves next time, so that each lamplight particle is always distributed in the camera window according to the same coordinate.
Further, in the method for automatically generating and rendering the three-dimensional night scene light, each array block comprises the same subarray, and the number of subarray blocks in the subarray is the same as the number of light particles;
the distributing the lamplight particles in the current coverage area according to a preset rule comprises the following steps:
determining a target subarray block covered by the current coverage area in the subarray blocks;
and placing one lamplight particle at any position of each target subarray block.
Further, in the method for automatically generating and rendering the three-dimensional night scene light, the array block and the subarray block are square blocks connected with each other;
before one of the light particles is placed at any position of each target subarray block, the method further comprises:
randomly setting the radius of the illumination range of each lamplight particle between 0 and N1; wherein N1 is the side length of the subarray block.
Further, the method for automatically generating and rendering three-dimensional night scene light described above, wherein the transferring the light particles in the current coverage area to the position corresponding to the array block coordinates of the mobile coverage area includes:
the offset value of the lamplight particles is determined according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein vOffset is the offset value, vCell is the coordinate (i, j) of any light particle in the current coverage area, uCameraPositionMOD is mod (N2), N2 is the side length of the array block, and CameraPosition is the camera position;
and transferring the lamplight particles according to the offset value.
Further, the method for automatically generating and rendering the three-dimensional night scene light, wherein the light rendering of the current rendering scene corresponding to the current coverage area comprises the following steps:
determining the height attribute, the color temperature attribute and the halation attribute of the lamplight particles in the current rendering scene;
and superposing the height attribute, the color temperature attribute and the halation attribute into the lamplight particles so as to perform lamplight rendering on the current rendering scene.
Further, the method for automatically generating and rendering the three-dimensional night scene light, which is described above, performs light rendering on the mobile rendering scene corresponding to the mobile coverage area, and includes:
and superposing the height attribute, the color temperature attribute and the halation attribute into the lamplight particles so as to perform lamplight rendering on the mobile rendering scene.
Further, the method for automatically generating and rendering the three-dimensional night scene light, wherein the step of obtaining the preset surface of the rendered scene as the projection area comprises the following steps:
and acquiring the top plane of the rendering scene as the projection area.
The application also provides a device for automatically generating and rendering the three-dimensional night scene lamplight, which comprises:
the acquisition module is used for acquiring a preset surface of the rendering scene as a projection area;
an adding module for adding a pre-constructed array in the projection area; wherein each array block of the array is provided with the same coordinate system;
the detection module is used for detecting the current coverage area of the camera window with the same shape and size as any array block in the array;
the rendering module is used for distributing the lamplight particles in the current coverage area according to a preset rule and performing lamplight rendering on the current rendering scene corresponding to the current coverage area;
a determining module, configured to determine a moving coverage area of the camera window in the array along with movement of the camera window;
the rendering module is further configured to transfer the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area, and perform light rendering on a mobile rendering scene corresponding to the mobile coverage area; and taking the moving coverage area as the current coverage area when the camera window moves next time, so that each lamplight particle is always distributed in the camera window according to the same coordinate.
Further, in the device for automatically generating and rendering three-dimensional night scene light, each array block comprises the same subarray, and the number of subarray blocks in the subarray is the same as the number of light particles;
the rendering module is specifically configured to determine a target sub-array block covered by the current coverage area in the sub-array blocks; and placing one lamplight particle at any position of each target subarray block.
The application also provides equipment for automatically generating and rendering the three-dimensional night scene lamplight, which comprises a processor and a memory, wherein the processor is connected with the memory:
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing the program, and the program is at least used for executing the method for automatically generating and rendering the three-dimensional night scene lamplight.
According to the method, the device and the equipment for automatically generating and rendering the three-dimensional night scene light, the projection area of the rendering scene on the preset plane is obtained, the pre-built array is added in the projection area, wherein each array block of the array is provided with the same coordinate system, the current coverage area of a camera window with the same shape as the array block in the array is detected, light particles are distributed in the current coverage area according to the preset rule, the current rendering scene corresponding to the current coverage area is subjected to light rendering, along with the movement of the camera window, the movement coverage area of the camera window in the array is determined, light particles in the current coverage area are transferred to the position corresponding to the coordinates of the array block of the movement coverage area, light rendering is carried out on the movement rendering scene corresponding to the movement coverage area, and the movement coverage area is used as the current coverage area when the camera window moves next time, so that each light particle is always distributed in the camera window according to the same coordinates, regional effect overview is realized, the number of light particles needing to be rendered is reduced, and further the operation speed and the mapping efficiency are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart provided by one embodiment of a method for automatically generating and rendering three-dimensional night scene lighting of the present application;
FIG. 2 is a schematic view of a rendered scene provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lighting according to the present application;
FIG. 3 is a schematic diagram of an array provided by one embodiment of a method for automatically generating and rendering three-dimensional night scene lights of the present application;
FIG. 4 is a schematic diagram of an array block provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lights according to the present application;
FIG. 5 is a schematic diagram of a light rendering effect of the region S in FIG. 2;
FIG. 6 is a schematic diagram of a structure provided by an embodiment of an apparatus for automatically generating and rendering three-dimensional night scene lighting according to the present application;
FIG. 7 is a schematic diagram of a structure provided by an embodiment of the apparatus for automatically generating and rendering three-dimensional night scene lighting of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, based on the examples herein, which are within the scope of the application as defined by the claims, will be within the scope of the application as defined by the claims.
FIG. 1 is a flow chart provided by one embodiment of a method for automatically generating and rendering three-dimensional night scene lighting of the present application. Referring to fig. 1, the present embodiment may include the following steps:
s101, acquiring a preset surface of a rendering scene as a projection area.
In this embodiment, a projection area of a rendering scene on a preset plane may be acquired. In a specific embodiment, the preset surface is a top surface of the rendered scene. That is, a top view of the rendered scene is acquired as a projection area.
Fig. 2 is a schematic view of a rendered scene provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lights according to the present application. In a specific embodiment, the rendered scene includes a number of houses of different heights, as shown in FIG. 2. In this embodiment, a top view of the rendered scene in fig. 2 is acquired as a projection area.
S102, adding a pre-constructed array in a projection area.
In this embodiment, an array for rendering light is pre-constructed, where the array includes a plurality of array blocks, and each array is provided with the same coordinate system. FIG. 3 is a schematic diagram of an array provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lighting according to the present application. As shown in FIG. 3, if there is a coordinate (i, j) in a certain array, i.gtoreq.0, j > 0. The same coordinates (i, j) can be found at the same location in all the other arrays remaining.
S103, detecting the current coverage area of the camera window with the same shape and size as any array block in the array.
The rendered scene corresponding to the area covered by the camera window is the area which can be seen by the user through the display screen. In a specific embodiment, the user can control the movement of the camera window by moving a mouse or other control device, so as to move the rendering scene corresponding to the area covered by the camera window, so as to browse different parts of the rendering scene.
Wherein the size and shape of the camera window is the same as any of the array blocks. In this way, the area covered by the camera window in the array includes all the coordinates contained in a complete array block coordinate system, no matter where the camera window is located in the array.
Specifically, as shown in fig. 3, if the camera window is at position a and aligned with one of the array blocks, the coverage area of the camera window includes all the coordinates of the array block coordinate system. If the camera window is at the position B, the coordinates of the area B11 covered by the camera window and the coordinates of the area B12 uncovered by the camera window are the same, and the coordinates of the area B21 covered by the camera window and the coordinates of the area B22 uncovered by the camera window are the same. Thus, b12, b22 and b3 constitute all coordinates contained in a complete array block coordinate system. Thus, the area covered by the camera view in the array will include all the coordinates contained in a complete array block coordinate system, i.e., will include the coordinate of (i, j), no matter how the camera view is moved.
In this embodiment, after adding a pre-constructed array to the projection area, it is necessary to detect the initial position of the camera window and the current coverage area corresponding to the initial position.
And S104, distributing the lamplight particles in the current coverage area according to a preset rule, and performing lamplight rendering on the current rendering scene corresponding to the current coverage area.
In this embodiment, each array block includes the same subarray, and the number of subarray blocks in the subarray is the same as the number of lamplight particles. After determining the current coverage area of the camera window, the light particles can be distributed in the current coverage area according to a preset rule as follows.
Step one: and determining a target subarray block covered by the current coverage area in the subarray blocks.
Step two: and a lamplight particle is placed at any position of each target subarray block.
Fig. 4 is a schematic diagram of an array block provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lights according to the present application. In a specific embodiment, the target subarray area covered by the current coverage area is shown as a shaded area C in fig. 4, and in order to improve the complexity of scene illumination and visual impact, one light particle L is placed in each target subarray area covered by the current coverage area shown in fig. 4.
Since the complexity of illumination rendering and the number of lights received by each pixel are directly related, in order to limit the complexity of illumination calculation of the whole scene in this embodiment, the array block and the subarray block are both set as square blocks connected to each other, as shown in fig. 3 and 4. And, before the second step, the method may further include the following steps:
randomly setting the radius of the illumination range of each lamplight particle between 0 and N1; where N1 is the side length of the sub-array block. Specifically, the radius of the illumination range of each lamplight particle is within the side length of the subarray block, so that each lamplight particle has an influence range of the subarray block where each lamplight particle is located and 8 subarray blocks adjacent to each subarray block. Therefore, each subarray block is influenced by 9 light particles in the subarray block and the adjacent 8 subarray blocks at most, and the complexity of illumination calculation is effectively reduced.
As shown in fig. 4, the light particles L1 in the dashed box represent a limit condition, that is, the positions of the light particles in the dashed box are exactly random to the corner points of the subarray block where the light particles are located, and the influence radius is exactly random to N1. At this time, the influence range of the lamplight particles does not exceed the subarray blocks where the lamplight particles are located and the peripheral subarray blocks, so that the lamplight particles can be randomly arranged without out-of-range phenomenon under the strategy, and meanwhile, the lamplight complexity can be greatly improved.
In this step, the height attribute, color temperature attribute and halo attribute of the light particles in the current rendering scene can also be determined. And superposing the height attribute, the color temperature attribute and the halo attribute into the lamplight particles to perform lamplight rendering on the current rendering scene. The height attribute can be determined according to the height information in the current rendering scene, and the halation attribute and the color temperature attribute can be determined according to the positions of the lamplight particles.
Fig. 5 is a schematic diagram of a light rendering effect of the region S in fig. 2. In a specific embodiment, the top view of the area S in fig. 1 corresponds to the current coverage area in fig. 4, and the area S is rendered according to the light particle distribution situation shown in fig. 4 and preset height attribute, halo attribute and color temperature attribute, so that a rendering diagram shown in fig. 5, that is, a rendering diagram corresponding to a camera window seen by a user through a display screen, can be obtained.
S105, along with the movement of the camera window, determining the movement coverage area of the camera window in the array.
If the user needs to view the light effect of other areas, the user needs to move a mouse or other control devices to switch the coverage range of the camera window. In this embodiment, the moving coverage area of the camera window in the array is determined as the camera window moves continuously.
S106, transferring the light particles in the current coverage area to a position corresponding to the coordinates of the array block of the mobile coverage area, and performing light rendering on the mobile rendering scene corresponding to the mobile coverage area.
From the above analysis, it can be clearly concluded that:
the area covered by the camera view in the array will include all the coordinates contained in a complete array block coordinate system, no matter where in the array the camera view is located.
Then, the light particles in the current coverage area can be transferred to the position corresponding to the coordinates of the array block of the moving coverage area according to the corresponding relation of the coordinates, so that a user cannot feel movement of the light particles in the process of moving the camera window, and meanwhile, the rendering efficiency is effectively improved.
Specifically, the offset value of the lamplight particles is determined according to the following formula, and the lamplight particles are transferred according to the offset value.
The formula is: voffset= (vcell+floor (ucamera position mod+0.5-vCell) -ucamera position mod) ×n2;
wherein, vOffset is an offset value, vCell is the coordinate (i, j) of any light particle in the current coverage area, uCamera position is mod (N2), N2 is the side length of the array block, and camera position is the camera position corresponding to the camera window.
If each array block contains a number a×a of sub-array blocks, then there are:
N2=N1×a
it should be noted that, the moving coverage area is used as the current coverage area when the camera window moves next time, so that each light particle is always distributed in the camera window according to the same coordinate, and the user can not feel the movement of the light particle all the time, and the use experience effect of the user can not be affected.
In addition, in a specific real-time manner, if the camera window does not move, the embodiment also redetermines the coverage area of the camera window in the array, so as to repeatedly perform calculation of light particles and light rendering on the coverage area. Compared with repeated storage and reading of data, repeated calculation can further improve the rendering speed of the lamplight.
According to the method for automatically generating and rendering the three-dimensional night scene light, the projection area of the rendering scene on the preset plane is obtained, the pre-built array is added in the projection area, wherein each array block of the array is provided with the same coordinate system, the current coverage area of a camera window with the same shape as the array block in the array is detected, light particles are distributed in the current coverage area according to the preset rule, light rendering is carried out on the current rendering scene corresponding to the current coverage area, along with movement of the camera window, the movement coverage area of the camera window in the array is determined, light particles in the current coverage area are transferred to the position corresponding to the coordinates of the array block of the movement coverage area, light rendering is carried out on the movement rendering scene corresponding to the movement coverage area, and the movement coverage area is used as the current coverage area of the camera window when the camera window moves next time, so that each light particle is always distributed in the camera window according to the same coordinates, regional effect overview is achieved, the number of light particles needing to be rendered is reduced, and the running speed and the drawing efficiency are effectively improved.
The application also provides a device for automatically generating and rendering the three-dimensional night scene lamplight, which is used for realizing the method embodiment. Fig. 6 is a schematic structural diagram provided by an embodiment of the apparatus for automatically generating and rendering three-dimensional night scene lights according to the present application. As shown in fig. 6, the apparatus of this embodiment includes:
an obtaining module 11, configured to obtain a preset surface of a rendered scene as a projection area;
an adding module 12 for adding a pre-constructed array in the projection area; wherein each array block of the array is provided with the same coordinate system;
the detection module 13 is used for detecting the current coverage area of the camera window in the array, wherein the shape and the size of the current coverage area are the same as those of any array block;
the rendering module 14 is configured to distribute the light particles in the current coverage area according to a preset rule, and perform light rendering on a current rendering scene corresponding to the current coverage area;
a determining module 15, configured to determine a moving coverage area of the camera window in the array along with the movement of the camera window;
the rendering module 14 is further configured to transfer the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area, and perform light rendering on the mobile rendering scene corresponding to the mobile coverage area; and taking the moving coverage area as the current coverage area when the camera window moves next time, so that each lamplight particle is always distributed in the camera window according to the same coordinate.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, each array block comprises the same subarray, and the number of subarray blocks in the subarray is the same as the number of light particles;
the rendering module 14 is specifically configured to determine a target subarray block covered by the current coverage area in the subarray blocks, and place a light particle at any position of each target subarray block.
Further, the device for automatically generating and rendering the three-dimensional night scene light in the embodiment is characterized in that the array block and the subarray block are square blocks connected with each other;
the rendering module 14 is specifically configured to randomly set an illumination range radius of each light particle between 0 and N1; where N1 is the side length of the sub-array block.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, the rendering module 14 is specifically configured to determine the offset value of the light particles according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein, vOffset is an offset value, vCell is the coordinate (i, j) of any lamplight particle in the current coverage area, uCameraPositionMOD is mod (CameraPosition, N2), N2 is the side length of the array block, and CameraPosition is the camera position;
and transferring the lamplight particles according to the offset value.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the present embodiment, the rendering module 14 is specifically configured to determine the height attribute, the color temperature attribute, and the halo attribute of the light particles in the current rendering scene, and superimpose the height attribute, the color temperature attribute, and the halo attribute on the light particles to render the light of the current rendering scene.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, the rendering module 14 is specifically configured to superimpose the height attribute, the color temperature attribute and the halo attribute on the light particles so as to perform light rendering on the mobile rendering scene.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, the obtaining module 11 is specifically configured to obtain a top view plane of a rendered scene as a projection area.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The application also provides equipment for automatically generating and rendering the three-dimensional night scene lamplight, which is used for realizing the method embodiment. FIG. 7 is a schematic diagram of a structure provided by an embodiment of the apparatus for automatically generating and rendering three-dimensional night scene lighting of the present application. As shown in fig. 7, the apparatus for automatically generating and rendering three-dimensional night scene lighting of the present embodiment includes a processor 21 and a memory 22, and the processor 21 is connected to the memory 22. Wherein the processor 21 is used for calling and executing the program stored in the memory 22; the memory 22 is used for storing a program for executing at least the method of automatically generating and rendering three-dimensional night scene lighting in the above embodiments.
In one particular embodiment, the processor 21 includes a graphics card and the memory 22 includes a video memory.
The specific implementation manner of the device for automatically generating and rendering the three-dimensional night scene light provided by the embodiment of the application can refer to the implementation manner of the method for automatically generating and rendering the three-dimensional night scene light in any embodiment, and is not repeated herein.
It is to be understood that the same or similar parts in the above embodiments may be referred to each other, and that in some embodiments, the same or similar parts in other embodiments may be referred to.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "plurality" means at least two.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (6)

1. The method for automatically generating and rendering the three-dimensional night scene light is characterized by comprising the following steps of:
acquiring a preset surface of a rendering scene as a projection area;
adding a pre-constructed array in the projection area; wherein each array block of the array is provided with the same coordinate system; each array block comprises the same subarray, and the number of subarray blocks in the subarray is the same as the number of lamplight particles;
detecting the current coverage area of a camera window with the same shape and size as any array block in the array;
distributing light particles in the current coverage area according to a preset rule, and performing light rendering on a current rendering scene corresponding to the current coverage area; wherein, the distributing the light particles in the current coverage area according to a preset rule includes: determining a target subarray block covered by the current coverage area in the subarray blocks; randomly setting the radius of the illumination range of each lamplight particle between 0 and N1; wherein N1 is the side length of the subarray block; placing one lamplight particle at any position of each target subarray block; the array block and the subarray block are square blocks connected with each other;
determining a movement coverage area of the camera window in the array as the camera window moves;
transferring the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area, and performing light rendering on a mobile rendering scene corresponding to the mobile coverage area; the transferring the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area includes: the offset value of the lamplight particles is determined according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein vOffset is the offset value, vCell is the coordinate (i, j) of any light particle in the current coverage area, uCameraPositionMOD is mod (N2), N2 is the side length of the array block, and CameraPosition is the camera position; transferring the lamplight particles according to the offset value;
and taking the moving coverage area as the current coverage area when the camera window moves next time, so that each lamplight particle is always distributed in the camera window according to the same coordinate.
2. The method for automatically generating and rendering three-dimensional night scene lighting according to claim 1, wherein the performing lighting rendering on the current rendering scene corresponding to the current coverage area comprises:
determining the height attribute, the color temperature attribute and the halation attribute of the lamplight particles in the current rendering scene;
and superposing the height attribute, the color temperature attribute and the halation attribute into the lamplight particles so as to perform lamplight rendering on the current rendering scene.
3. The method for automatically generating and rendering three-dimensional night scene lighting according to claim 2, wherein the performing lighting rendering on the mobile rendering scene corresponding to the mobile coverage area comprises:
and superposing the height attribute, the color temperature attribute and the halation attribute into the lamplight particles so as to perform lamplight rendering on the mobile rendering scene.
4. The method for automatically generating and rendering three-dimensional night scene lighting according to claim 1, wherein the step of acquiring the preset surface of the rendered scene as the projection area comprises the steps of:
and acquiring the top plane of the rendering scene as the projection area.
5. A device for automatically generating and rendering three-dimensional night scene lights, comprising:
the acquisition module is used for acquiring a preset surface of the rendering scene as a projection area;
an adding module for adding a pre-constructed array in the projection area; wherein each array block of the array is provided with the same coordinate system; each array block comprises the same subarray, and the number of subarray blocks in the subarray is the same as the number of lamplight particles;
the detection module is used for detecting the current coverage area of the camera window with the same shape and size as any array block in the array;
the rendering module is used for distributing the lamplight particles in the current coverage area according to a preset rule and performing lamplight rendering on the current rendering scene corresponding to the current coverage area; wherein, the lamplight particles are distributed in the current coverage area according to a preset rule; the method is particularly used for determining a target subarray block covered by the current coverage area in the subarray blocks; randomly setting the radius of the illumination range of each lamplight particle between 0 and N1; wherein N1 is the side length of the subarray block; placing one lamplight particle at any position of each target subarray block; the array block and the subarray block are square blocks connected with each other;
a determining module, configured to determine a moving coverage area of the camera window in the array along with movement of the camera window;
the rendering module is further configured to transfer the light particles in the current coverage area to a position corresponding to the array block coordinates of the mobile coverage area, and perform light rendering on a mobile rendering scene corresponding to the mobile coverage area; taking the moving coverage area as the current coverage area when the camera window moves next time, so that each lamplight particle is always distributed in the camera window according to the same coordinate; the lamplight particles in the current coverage area are transferred to a position corresponding to the array block coordinates of the mobile coverage area; the rendering module is specifically configured to determine an offset value of the light particle according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein vOffset is the offset value, vCell is the coordinate (i, j) of any light particle in the current coverage area, uCameraPositionMOD is mod (N2), N2 is the side length of the array block, and CameraPosition is the camera position; and transferring the lamplight particles according to the offset value.
6. The device for automatically generating and rendering the three-dimensional night scene lamplight is characterized by comprising a processor and a memory, wherein the processor is connected with the memory:
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing the program, and the program is at least used for executing the method for automatically generating and rendering the three-dimensional night scene lamplight according to any one of claims 1-4.
CN202011103870.3A 2020-10-15 2020-10-15 Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight Active CN112184878B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011103870.3A CN112184878B (en) 2020-10-15 2020-10-15 Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011103870.3A CN112184878B (en) 2020-10-15 2020-10-15 Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight

Publications (2)

Publication Number Publication Date
CN112184878A CN112184878A (en) 2021-01-05
CN112184878B true CN112184878B (en) 2023-08-25

Family

ID=73949788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011103870.3A Active CN112184878B (en) 2020-10-15 2020-10-15 Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight

Country Status (1)

Country Link
CN (1) CN112184878B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802170B (en) * 2021-02-07 2023-05-16 抖音视界有限公司 Illumination image generation method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104103092A (en) * 2014-07-24 2014-10-15 无锡梵天信息技术股份有限公司 Real-time dynamic shadowing realization method based on projector lamp
CN104751464A (en) * 2015-03-30 2015-07-01 山东大学 Real sense material measurement device and method based on camera light source array modes
CN106878698A (en) * 2016-12-23 2017-06-20 中国科学院自动化研究所 The method and system of the mobile naked eye three-dimensional virtual reality based on light path collection
CN108597010A (en) * 2018-04-19 2018-09-28 北京知道创宇信息技术有限公司 Cut-fill rendering intent and device
CN110083965A (en) * 2019-05-07 2019-08-02 洛阳众智软件科技股份有限公司 Analysis of Thermal Environment method, apparatus, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104103092A (en) * 2014-07-24 2014-10-15 无锡梵天信息技术股份有限公司 Real-time dynamic shadowing realization method based on projector lamp
CN104751464A (en) * 2015-03-30 2015-07-01 山东大学 Real sense material measurement device and method based on camera light source array modes
CN106878698A (en) * 2016-12-23 2017-06-20 中国科学院自动化研究所 The method and system of the mobile naked eye three-dimensional virtual reality based on light path collection
CN108597010A (en) * 2018-04-19 2018-09-28 北京知道创宇信息技术有限公司 Cut-fill rendering intent and device
CN110083965A (en) * 2019-05-07 2019-08-02 洛阳众智软件科技股份有限公司 Analysis of Thermal Environment method, apparatus, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于WebGL的三维落叶场景仿真;张文娟 等;计算机技术与发展(第06期);第165-169页 *

Also Published As

Publication number Publication date
CN112184878A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
US10928189B2 (en) Intensity-modulated light pattern for active stereo
US10325399B2 (en) Optimal texture memory allocation
CN112150575B (en) Scene data acquisition method, model training method and device and computer equipment
US20180122129A1 (en) Generation, transmission and rendering of virtual reality multimedia
CN111968215B (en) Volume light rendering method and device, electronic equipment and storage medium
CN105701853A (en) 3D rendering method and apparatus
CA2866849C (en) Method for estimating the opacity level in a scene and corresponding device
GB2587895A (en) Photorealistic three dimensional texturing using canonical views and a two stage approach
CN104103092A (en) Real-time dynamic shadowing realization method based on projector lamp
CN103108452B (en) Scene illumination reappearing method driven by dynamic light field data
CN115830208B (en) Global illumination rendering method, device, computer equipment and storage medium
CN108038911A (en) A kind of holographic imaging control method based on AR technologies
CN112529022B (en) Training sample generation method and device
WO2024074015A1 (en) Soft shadow generation method and apparatus, device and storage medium
CN105389848A (en) Drawing system and method of 3D scene, and terminal
CN112184878B (en) Method, device and equipment for automatically generating and rendering three-dimensional night scene lamplight
CN111199573A (en) Virtual-real mutual reflection method, device, medium and equipment based on augmented reality
WO2014170757A2 (en) 3d rendering for training computer vision recognition
CN105245805A (en) Projection method and electronic equipment
CN109544671B (en) Projection mapping method of video in three-dimensional scene based on screen space
US20210407174A1 (en) Rendering images for non-standard display devices
JP2012105019A (en) Image processing device, method, and program thereof
CN115115747A (en) Illumination rendering method and device, electronic equipment and storage medium
US20160071308A1 (en) Distribution Caching for Direct Lights
CN112925351B (en) Method and device for controlling light source of vision machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Floor 13, 14 and 15, building 3, lianfei building, No.1, Fenghua Road, high tech Development Zone, Luoyang City, Henan Province, 471000

Patentee after: Zhongzhi Software Co.,Ltd.

Country or region after: China

Address before: Floor 13, 14 and 15, building 3, lianfei building, No.1, Fenghua Road, high tech Development Zone, Luoyang City, Henan Province, 471000

Patentee before: Luoyang Zhongzhi Software Technology Co.,Ltd.

Country or region before: China