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

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

Info

Publication number
CN112184878A
CN112184878A CN202011103870.3A CN202011103870A CN112184878A CN 112184878 A CN112184878 A CN 112184878A CN 202011103870 A CN202011103870 A CN 202011103870A CN 112184878 A CN112184878 A CN 112184878A
Authority
CN
China
Prior art keywords
rendering
light
array
coverage area
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.)
Granted
Application number
CN202011103870.3A
Other languages
Chinese (zh)
Other versions
CN112184878B (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

Images

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 invention relates to a method, a device and equipment for automatically generating and rendering three-dimensional night scene light, which are characterized in that a projection area of a rendered scene on a preset plane is obtained, a pre-constructed array is added in the projection area, the current coverage area of a camera window with the same shape as an array block in the array is detected, light particles are distributed in the current coverage area according to a preset rule, the current rendered scene corresponding to the current coverage area is subjected to light rendering, the moving coverage area of the camera window in the array is determined along with the movement of the camera window, the light particles in the current coverage area are transferred to the position corresponding to the coordinates of the array block of the moving coverage area, and the light rendering is carried out on the moving rendered scene corresponding to the moving coverage area, so that each light particle is distributed in the camera window according to the same coordinate all the time, and regional effect overview is realized, the quantity of light particles needing to be rendered is reduced, and further the running speed and the drawing efficiency are effectively improved.

Description

Method, device and equipment for automatically generating and rendering three-dimensional night scene light
Technical Field
The invention relates to the technical field of light rendering, in particular to a method, a device and equipment for automatically generating and rendering three-dimensional night scene light.
Background
The light is helpful for expressing emotion, can guide the eyes of audiences to a specific position, can provide larger depth for a scene, shows rich layers, enables the model to be more three-dimensional and attractive, and has become a popular trend.
At present, the following lighting rendering methods are commonly used: first, advanced global illumination renderers and global illumination renderers, primarily rely on "ray tracing" to trace rays between model surfaces, which rays are continually reflected by some object surfaces to other object surfaces until they disappear from the scene. Secondly, the radiance rendering method calculates through integrated cache irradiance, and the reflected energy continuously rebounds in the scene and gradually weakens. The light effect is studied according to geometry, energy, geographical location, date or material, or a particle system as light source. Third, Lumaobject, which makes a self-luminous object as a light source and can control light attenuation, realizes an effect of radiance to some extent, provides a light effect in the form of an incandescent lamp, a stereoscopic light source, and a special material property. Fourthly, the polygon colored spotlight uv master uses the panorama as a background sticking model by the BPR rendering function, and illuminates and colors the environment during rendering.
However, in the light rendering method in the prior art, one-key insertion of large-area light cannot be realized, the light rendering method can only be placed one by one, a regional effect overview cannot be formed, and the operation speed is slow when the light is excessive, so that the drawing efficiency is influenced.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, and a device for automatically generating and rendering a three-dimensional night scene light, so as to overcome the problems that the existing light rendering method cannot realize one-key insertion of large-area light, can only be placed one by one, cannot form a regional effect overview, and is slow in operation speed when too much light is emitted, which affects the drawing efficiency.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for automatically generating and rendering three-dimensional night scene light comprises the following steps:
acquiring a preset surface of a rendered scene as a projection area;
adding a pre-constructed array in the projection region; wherein each array block of the array is provided with the same coordinate system;
detecting a current coverage area of a camera window in the array, wherein the shape and the size of the camera window are the same as those of any array block;
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 moving coverage area of the camera view in the array as the camera view 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 light particle is distributed in the camera window according to the same coordinate all the time.
Further, according to the above method for automatically generating and rendering three-dimensional night scene light, each array block includes the same sub-array, and the number of sub-array blocks in the sub-array is the same as the number of the light particles;
distributing the light particles in the current coverage area according to a preset rule, comprising:
determining a target sub-array block covered by the current coverage area in the sub-array blocks;
and placing one light particle at any position of each target subarray block.
Further, in the above method for automatically generating and rendering three-dimensional night scene light, the array blocks and the sub-array blocks 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 lamp light particle between 0 and N1; wherein N1 is the side length of the subarray block.
Further, the above method for automatically generating and rendering three-dimensional night scene light, wherein the transferring the light particles in the current coverage area to the position corresponding to the array block coordinates of the moving coverage area comprises:
determining the offset value of the light particles according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein, vdffset is the offset value, vCell is the coordinate (i, j) of any one of the light particles in the current coverage area, ucamera position mod (CameraPosition, N2), N2 is the side length of the array block, and CameraPosition is the camera position;
and transferring the light particles according to the deviation value.
Further, the above method for automatically generating and rendering three-dimensional night scene light, where performing light rendering on the current rendering scene corresponding to the current coverage area includes:
determining the height attribute, the color temperature attribute and the halo attribute of the light particles in the current rendering scene;
and superposing the height attribute, the color temperature attribute and the halo attribute to the light particles so as to perform light rendering on the current rendered scene.
Further, the method for automatically generating and rendering three-dimensional night scene light, where performing light rendering on the mobile rendering scene corresponding to the mobile coverage area, includes:
and superposing the height attribute, the color temperature attribute and the halo attribute to the light particles so as to perform light rendering on the mobile rendering scene.
Further, the above method for automatically generating and rendering three-dimensional night scene light, where the preset surface of the rendered scene is obtained as a projection area, includes:
and acquiring the rendering scene top-view surface as the projection area.
The invention 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 a rendered scene as a projection area;
an adding module, configured to add 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 a camera window with the same shape and size as any one array block in the array;
the rendering module is used for 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;
a determining module for determining a moving coverage area of the camera view window in the array as the camera view window moves;
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 light particle is distributed in the camera window according to the same coordinate all the time.
Further, in the above apparatus for automatically generating and rendering three-dimensional night scene light, each array block includes the same sub-array, and the number of sub-array blocks in the sub-array is the same as the number of the light particles;
the rendering module is specifically configured to determine a target sub-array tile covered by the current coverage area in the sub-array tiles; and placing one light particle at any position of each target subarray block.
The invention also provides equipment for automatically generating and rendering the three-dimensional night scene light, 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 light.
The invention relates to a method, a device and equipment for automatically generating and rendering three-dimensional night scene light, which are characterized in that a projection area of a rendered scene on a preset plane is obtained, a pre-constructed 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 a preset rule, the light rendering is carried out on the current rendered scene corresponding to the current coverage area, the moving coverage area of the camera window in the array is determined along with the movement of the camera window, the light particles in the current coverage area are transferred to the position corresponding to the coordinates of the array block of the moving coverage area, the light rendering is carried out on the moving rendered scene corresponding to the moving coverage area, and the moving coverage area is used as the current coverage area when the camera window moves next time, each light particle is distributed in the camera window according to the same coordinate all the time, regional effect overview is achieved, the number of the light particles to be rendered is reduced, and therefore the running speed and the drawing efficiency are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
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 invention;
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 invention;
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 invention;
FIG. 4 is a schematic diagram of an array block provided in an embodiment of a method for automatically generating and rendering three-dimensional night scene lighting according to the present invention;
FIG. 5 is a schematic diagram of the light rendering effect of the area S in FIG. 2;
FIG. 6 is a schematic structural diagram of an apparatus for automatically generating and rendering three-dimensional night scene lighting according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram provided by an embodiment of the device for automatically generating and rendering three-dimensional night scene light according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
Fig. 1 is a flowchart provided by an embodiment of a method for automatically generating and rendering three-dimensional night scene lighting according to the present invention. Referring to fig. 1, the present embodiment may include the following steps:
s101, acquiring a preset surface of a rendered scene as a projection area.
In this embodiment, a projection area of the rendered scene on the preset plane may be obtained. In a specific embodiment, the preset surface is a top-view surface of the rendered scene. That is, the top view of the rendered scene is acquired as the projection area.
Fig. 2 is a schematic view of a rendered scene provided by an embodiment of the method for automatically generating and rendering three-dimensional night scene light of the present invention. In a specific embodiment, the rendered scene includes several houses of different heights, as shown in fig. 2. In this embodiment, a top view of the rendered scene in fig. 2 is obtained as a projection area.
And S102, adding a pre-constructed array in the projection area.
In this embodiment, an array for rendering light is pre-constructed, the array includes a plurality of array blocks, and each array block is provided with the same coordinate system. Fig. 3 is a schematic array diagram provided by an embodiment of the method for automatically generating and rendering three-dimensional night scene light according to the present invention. As shown in FIG. 3, if there is a coordinate (i, j) in an array, i ≧ 0, j > 0. In all other remaining arrays, the same coordinate (i, j) can be found at the same position.
S103, detecting the current coverage area of the camera window with the same shape and size as any array block in the array.
The rendering 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, a user can control the camera window to move by moving a mouse or other control devices, and then move a rendered scene corresponding to an area covered by the camera window to browse different parts of the rendered scene.
The size and shape of the camera window are the same as those of any array block. In this way, no matter where the camera window is located in the array, the area covered by the camera window in the array includes all the coordinates included in a complete array block coordinate system.
Specifically, as shown in fig. 3, if the camera window is at position a, aligned with one of the array blocks, the coverage area of the camera window contains all the coordinates of the array block coordinate system. If the camera view window is located at the position B, the coordinates of the area B11 covered by the camera view window and the coordinates of the area B12 uncovered by the camera view window are the same, and the coordinates of the area B21 covered by the camera view window and the coordinates of the area B22 uncovered by the camera view window are the same. Thus, b12, b22, and b3 constitute all the coordinates included in a complete array block coordinate system. Therefore, no matter how the camera window moves, the area covered by the camera window in the array will include all the coordinates contained in the complete array block coordinate system, i.e. will include the (i, j) coordinate.
In this embodiment, after the pre-constructed array is added to the projection area, the initial position of the camera window and the current coverage area corresponding to the initial position need to be detected.
And S104, distributing the light particles in the current coverage area according to a preset rule, and performing light rendering on the current rendering scene corresponding to the current coverage area.
In this embodiment, each array block includes the same sub-array, and the number of sub-array blocks in the sub-array is the same as the number of light particles. After the current coverage area of the camera window is determined, the light particles can be distributed in the current coverage area according to the following steps.
The method comprises the following steps: and determining a target sub-array block covered by the current coverage area in the sub-array blocks.
Step two: and placing a light particle at any position of each target subarray block.
Fig. 4 is a schematic diagram of an array block provided by an embodiment of the method for automatically generating and rendering three-dimensional night scene light according to the present invention. In one specific embodiment, the target sub-array tile covered by the current coverage area is shown as the shaded area C in fig. 4, and in order to improve the scene illumination complexity and the visual impact, one light particle L is placed in each target sub-array tile covered by the current coverage area shown in fig. 4.
Since the complexity of the illumination rendering is directly related to the amount of light received by each pixel, in order to limit the complexity of the illumination calculation of the whole scene in the present embodiment, the array tiles and the sub-array tiles are both set as square tiles connected to each other, as shown in fig. 3 and 4. Before the second step, the method may further include the steps of:
randomly setting the radius of the illumination range of each lamplight particle between 0 and N1; where N1 is the side length of the subarray block. Specifically, the radius of the illumination range of each light particle is within the side length of the subarray block, and then the influence range of each light particle is the subarray block where the light particle is located and the 8 adjacent subarray blocks. Therefore, each subarray block is influenced by 9 light particles at most and in 8 adjacent subarray blocks, and complexity of illumination calculation is effectively reduced.
As shown in fig. 4, the light particle L1 in the dashed box represents a limit case, that is, the position of the light particle in the dashed box is random to the corner of the sub-array block, and the influence radius is random to N1. At the moment, the influence range of the light particles does not exceed the subarray block where the light particles are located and the peripheral subarray blocks, so that the light particles can be randomly selected under the strategy without the phenomenon of border crossing, and meanwhile, the light complexity can be greatly improved.
In this step, the height attribute, the color temperature attribute, and the halo attribute of the light particles in the current rendered scene may also be determined. And superposing the height attribute, the color temperature attribute and the halo attribute to the light particles so as to perform light rendering on the current rendered scene. The height attribute can be determined according to height information in a current rendered scene, and the halo attribute and the color temperature attribute can be determined according to the position of light particles.
Fig. 5 is a schematic diagram of the light rendering effect of the area S in fig. 2. In a specific embodiment, a 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 distribution of the light particles shown in fig. 4 and the preset height attribute, halo attribute, and color temperature attribute, so as to obtain a rendering map shown in fig. 5, that is, a rendering map corresponding to a camera window viewed by a user through a display screen.
And 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 check the lighting effect of other areas, the user needs to move the mouse or other control equipment to switch the coverage range of the camera window. In this embodiment, as the camera window is continuously moved, the moving coverage area of the camera window in the array is determined.
And S106, transferring the light particles in the current coverage area to the 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, the following conclusions can be clearly drawn:
regardless of the position of the camera window in the array, the area covered by the camera window in the array includes all the coordinates contained in a complete array block coordinate system.
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 mobile coverage area according to the corresponding relation of the coordinates, so that a user cannot feel the 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 light particles is determined according to the following formula, and the light particles are transferred according to the offset value.
The formula is as follows: vaffset ═ (vCell + floor (ucamera positionnmod + 0.5-vCell) -uca positionnmod) × N2;
wherein, vdffset is an offset value, vCell is a coordinate (i, j) of any light particle in the currently covered area, ucamera position mod is mod (CameraPosition, N2), N2 is a side length of the array block, and CameraPosition is a camera position corresponding to the camera window.
If each array block comprises a sub-array blocks with the number of a × a, then:
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 distributed in the camera window according to the same coordinate all the time, and a user cannot feel the movement of the light particle all the time, and the use experience effect of the user is not affected.
In addition, in a specific real-time manner, if the camera window is not moved, the embodiment also re-determines the coverage area of the camera window in the array, so as to repeat the calculation of the light particles and the light rendering on the coverage area. Compared with repeated saving and reading of data, repeated calculation can further improve the rendering speed of the light.
The method for automatically generating and rendering three-dimensional night scene lamplight comprises the steps of obtaining a projection area of a rendered scene on a preset plane, adding a pre-constructed array in the projection area, wherein each array block of the array is provided with a same coordinate system, detecting a current coverage area of a camera window with the same shape as the array block in the array, distributing lamplight particles in the current coverage area according to a preset rule, rendering the current rendered scene corresponding to the current coverage area by lamplight, determining a moving coverage area of the camera window in the array along with the movement of the camera window, transferring the lamplight particles in the current coverage area to a position corresponding to the coordinates of the array block of the moving coverage area, rendering the moving rendered scene corresponding to the moving coverage area by lamplight, and taking the moving coverage area as the current coverage area when the camera window moves next time, each light particle is distributed in the camera window according to the same coordinate all the time, regional effect overview is achieved, the number of the light particles to be rendered is reduced, and therefore the running speed and the drawing efficiency are effectively improved.
The invention also provides a device for automatically generating and rendering the three-dimensional night scene light, which is used for realizing the embodiment of the method. Fig. 6 is a schematic structural diagram provided by an embodiment of the device for automatically generating and rendering three-dimensional night scene light according to the present invention. As shown in fig. 6, the apparatus of the present embodiment includes:
the acquisition module 11 is configured to acquire 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 configured to detect a current coverage area of a camera window in the array, where the shape and the size of the camera window are the same as those of any array block;
the rendering module 14 is configured to distribute 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 view window in the array as the camera view window moves;
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 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 light particle is distributed in the camera window according to the same coordinate all the time.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, each array block includes the same sub-array, and the number of sub-array blocks in the sub-array is the same as the number of light particles;
the rendering module 14 is specifically configured to determine a target sub-array block covered by the current coverage area in the sub-array blocks, and place a light particle at any position of each target sub-array block.
Further, in the device for automatically generating and rendering three-dimensional night scene light of the embodiment, the array blocks and the sub-array blocks 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 subarray block.
Further, in the apparatus for automatically generating and rendering three-dimensional night scene light of the embodiment, the rendering module 14 is specifically configured to determine the deviation value of the light particles according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein, vdffset is an offset value, vCell is a coordinate (i, j) of any light particle in the current coverage area, ucamera position mod is mod (CameraPosition, N2), N2 is a side length of the array block, and CameraPosition is a camera position;
the light particles are displaced according to the offset value.
Further, the device for automatically generating and rendering three-dimensional night scene light of the embodiment, the rendering module 14, is specifically configured to determine a height attribute, a color temperature attribute, and a halo attribute of light particles in a current rendered scene, and superimpose the height attribute, the color temperature attribute, and the halo attribute on the light particles to perform light rendering on the current rendered scene.
Further, 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 onto light particles to perform light rendering on a mobile rendered scene.
Further, in the apparatus for automatically generating and rendering three-dimensional night-scene light according to the embodiment, the obtaining module 11 is specifically configured to obtain a top-view surface of a rendered scene as a projection area.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The invention also provides equipment for automatically generating and rendering the three-dimensional night scene light, which is used for realizing the embodiment of the method. Fig. 7 is a schematic structural diagram provided by an embodiment of the device for automatically generating and rendering three-dimensional night scene light according to the present invention. As shown in fig. 7, the device for automatically generating and rendering three-dimensional night scene light 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 light in the above embodiment.
In one specific embodiment, the processor 21 includes a video card and the memory 22 includes a video memory.
The specific implementation of the device for automatically generating and rendering three-dimensional night-scene light provided in the embodiment of the present application may refer to the implementation of the method for automatically generating and rendering three-dimensional night-scene light in any of the above embodiments, and details are not repeated here.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
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 alternate implementations are included within the scope of the preferred embodiment of the present invention 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 invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean 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 invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for automatically generating and rendering three-dimensional night scene light is characterized by comprising the following steps:
acquiring a preset surface of a rendered scene as a projection area;
adding a pre-constructed array in the projection region; wherein each array block of the array is provided with the same coordinate system;
detecting a current coverage area of a camera window in the array, wherein the shape and the size of the camera window are the same as those of any array block;
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 moving coverage area of the camera view in the array as the camera view 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 light particle is distributed in the camera window according to the same coordinate all the time.
2. The method for automatic generation and rendering of three-dimensional night scene light according to claim 1, wherein each array tile comprises the same sub-array, and the number of sub-array tiles in the sub-array is the same as the number of light particles;
distributing the light particles in the current coverage area according to a preset rule, comprising:
determining a target sub-array block covered by the current coverage area in the sub-array blocks;
and placing one light particle at any position of each target subarray block.
3. The method for automatically generating and rendering three-dimensional night scene light according to claim 2, wherein the array tiles and the sub-array tiles are square tiles 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 lamp light particle between 0 and N1; wherein N1 is the side length of the subarray block.
4. The method of claim 3, wherein the transferring the light particles in the current coverage area to a position corresponding to the array block coordinates of the moving coverage area comprises:
determining the offset value of the light particles according to the following formula:
vOffset=(vCell+floor(uCameraPositionMod+0.5-vCell)-uCameraPositionMod)×N2;
wherein, vdffset is the offset value, vCell is the coordinate (i, j) of any one of the light particles in the current coverage area, ucamera position mod (CameraPosition, N2), N2 is the side length of the array block, and CameraPosition is the camera position;
and transferring the light particles according to the deviation value.
5. The method for automatically generating and rendering three-dimensional night scene light according to claim 1, wherein the step of performing light rendering on the current rendering scene corresponding to the current coverage area comprises the steps of:
determining the height attribute, the color temperature attribute and the halo attribute of the light particles in the current rendering scene;
and superposing the height attribute, the color temperature attribute and the halo attribute to the light particles so as to perform light rendering on the current rendered scene.
6. The method for automatically generating and rendering the three-dimensional night scene light according to claim 5, wherein the step of performing light rendering on the mobile rendering scene corresponding to the mobile coverage area comprises the following steps:
and superposing the height attribute, the color temperature attribute and the halo attribute to the light particles so as to perform light rendering on the mobile rendering scene.
7. The method for automatically generating and rendering three-dimensional night scene light according to claim 1, wherein the step of acquiring a preset surface of a rendered scene as a projection area comprises the steps of:
and acquiring the rendering scene top-view surface as the projection area.
8. An apparatus for automatically generating and rendering three-dimensional night scene light, comprising:
the acquisition module is used for acquiring a preset surface of a rendered scene as a projection area;
an adding module, configured to add 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 a camera window with the same shape and size as any one array block in the array;
the rendering module is used for 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;
a determining module for determining a moving coverage area of the camera view window in the array as the camera view window moves;
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 light particle is distributed in the camera window according to the same coordinate all the time.
9. The apparatus for automatic generation and rendering of three-dimensional night-scene light according to claim 8, wherein each of the array tiles comprises the same sub-array, and the number of sub-array tiles in the sub-array is the same as the number of light particles;
the rendering module is specifically configured to determine a target sub-array tile covered by the current coverage area in the sub-array tiles; and placing one light particle at any position of each target subarray block.
10. An apparatus for automatically generating and rendering three-dimensional night scene light, 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 light according to any one of claims 1-7.
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 true CN112184878A (en) 2021-01-05
CN112184878B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802170A (en) * 2021-02-07 2021-05-14 北京字节跳动网络技术有限公司 Illumination image generation method, apparatus, device, 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的三维落叶场景仿真", 计算机技术与发展, no. 06, pages 165 - 169 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802170A (en) * 2021-02-07 2021-05-14 北京字节跳动网络技术有限公司 Illumination image generation method, apparatus, device, and medium
WO2022166656A1 (en) * 2021-02-07 2022-08-11 北京字节跳动网络技术有限公司 Method and apparatus for generating lighting image, device, and medium
CN112802170B (en) * 2021-02-07 2023-05-16 抖音视界有限公司 Illumination image generation method, device, equipment and medium

Also Published As

Publication number Publication date
CN112184878B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN111968215B (en) Volume light rendering method and device, electronic equipment and storage medium
CN108765542B (en) Image rendering method, electronic device, and computer-readable storage medium
EP2869266A1 (en) Method and apparatus for generating depth map of a scene
CN107025683A (en) A kind of information processing method and electronic equipment
CN110827391B (en) Image rendering method, device and equipment and storage medium
CN103108452B (en) Scene illumination reappearing method driven by dynamic light field data
CN108257204B (en) Vertex color drawing baking method and system applied to Unity engine
CN104038699B (en) The reminding method of focusing state and filming apparatus
CN111968216A (en) Volume cloud shadow rendering method and device, electronic equipment and storage medium
CN104103092A (en) Real-time dynamic shadowing realization method based on projector lamp
CN112233214B (en) Snow scene rendering method, device and equipment for large scene and storage medium
CN103198513B (en) Film later stage synthesis antialiasing method
KR20210126934A (en) Method and apparatus of outputting light source information
CN112184878A (en) Method, device and equipment for automatically generating and rendering three-dimensional night scene light
CN114139250A (en) Automatic light distribution method, device, equipment and storage medium based on illusion engine
CN112734892A (en) Real-time global illumination rendering method for virtual cable tunnel scene model
CN105976423B (en) A kind of generation method and device of Lens Flare
CN114489347A (en) Dynamic sand table and demonstration method and system thereof
CN115115747A (en) Illumination rendering method and device, electronic equipment and storage medium
CN108460824B (en) Method, device and system for determining stereoscopic multimedia information
JP2012105019A (en) Image processing device, method, and program thereof
CN108280887B (en) Shadow map determination method and device
CN114139249A (en) Automatic light distribution method and device based on illusion engine and electronic equipment
WO2020051747A1 (en) Method of acquiring contour of object, image processing method and computer storage medium
CN102147931A (en) Method for locating single-point light source of single image based on rendering

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