Method, apparatus, device and storage medium for global light rendering

CN116228935BActive Publication Date: 2026-09-29SHENZHEN SECURITIES TIMES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310140821.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2026-09-29
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种全局光渲染的方法、装置、设备及存储介质,旨在解决现有技术中在对3D区域进行全局光渲染的时,需要涉及到大量的计算,导致对应用区域进行渲染时的耗能高的技术问题

Benefits of technology

[0041]本申请提供一种全局光渲染的方法、装置、设备及存储介质,与现有技术中在对3D区域进行全局光渲染的时,需要涉及到大量的计算,导致对应用区域进行渲染时的耗能高相比,在本申请中,实时获取应用区域中投屏画面的RGB平均值;基于所述RGB平均值,得到光照贴图;将所述光照贴图与预设的场景灰度图贴合,得到全局光贴图;将所述全局光贴图映射到所述应用区域中,以渲染所述应用区域的全局光。在本申请中,在对应用区域进行渲染时,先获取投屏画面的RGB平均值,根据RGB平均值,确定带有色彩与色温的光照贴图,再将光照贴图与预设的场景灰度图贴合为全局光贴图,以确定应用区域中每个位置的色彩、色温与亮度,最后将带有色彩、色温与亮度的全局光贴图映射到应用区域中的各个物体上,以渲染应用区域,即在本申请中,将根据现场投屏画面获取的光照贴图,与预设的场景灰度图贴合,并将贴合后的全局光贴图映射到,以减少对应用区域中每个位置光照色彩的计算,以减少计算量,还减少了对灯具的使用,进而降低对应用区域进行渲染时的耗能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228935B_ABST
    Figure CN116228935B_ABST
Patent Text Reader

Abstract

The application discloses a global light rendering method, device, equipment and storage medium, the method comprises the following steps: acquiring the RGB average value of the screen projection picture in the application area in real time; obtaining the light map based on the RGB average value; the global light map is obtained by fitting the light map with the preset scene gray map; the global light map is mapped to the application area to render the global light of the application area. In the application, the light map obtained according to the live screen projection picture is fitted with the preset scene gray map, and the fitted global light map is mapped to, so that the calculation of the illumination color of each position in the application area is reduced, the calculation amount is reduced, the use of lamps and lanterns is also reduced, and the energy consumption when the application area is rendered is further reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of animation rendering technology, and in particular to a method, apparatus, device and storage medium for global illumination rendering. Background Technology

[0002] With the rapid development of the Web, the Web 3D graphics standard, namely WebGL (Web Graphics Library), has solved the problem of existing interactive 3D animation on the Web. It allows users to view smooth 3D area models in a browser and use the lighting rendering data in the model to control the lights in the application area and render the application area corresponding to the 3D area.

[0003] However, when using WebGL technology to perform global illumination rendering on 3D areas, it is necessary to consider the rendering effect of different lights superimposed on the 3D area. That is, it is necessary to calculate the light and shadow of each object in the 3D area, which involves a lot of calculations and results in high energy consumption when rendering the application area. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, device, and storage medium for global illumination rendering, aiming to solve the technical problem in the prior art that global illumination rendering of 3D areas requires a large amount of computation, resulting in high energy consumption when rendering the application area.

[0005] To achieve the above objectives, this application provides a method for global illumination rendering, the method comprising:

[0006] Real-time acquisition of the average RGB value of the projected image in the application area;

[0007] Based on the RGB average value, a light map is obtained;

[0008] The light map is then laminated with a preset scene grayscale image to obtain a global light map;

[0009] The global light map is mapped onto the application region to render the global light of the application region.

[0010] Optionally, the step of obtaining the average RGB value of the projected image in the application area in real time includes:

[0011] Acquire the image of each frame in the projected screen, and obtain the RGB value of each pixel in the image;

[0012] Based on each of the RGB values, the average RGB value of the image is calculated.

[0013] Optionally, the step of mapping the global illumination map onto the application region to render the global illumination of the application region includes:

[0014] The global light map is mapped onto the application region, and the brightness weight of the global light map is determined.

[0015] Based on each of the RGB average values, the RGB changes of the projected image are determined;

[0016] Based on the RGB changes and the brightness weights, the color of the global light map is changed to render the global light of the application area.

[0017] Optionally, the step of bonding the light map with a preset scene grayscale image to obtain a global light map further includes:

[0018] If there are living objects in the application area, the lighting and texture of the living objects are calculated separately.

[0019] The light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image;

[0020] The light map is then overlaid with the updated scene grayscale image to obtain a global light map.

[0021] Optionally, the step of calculating the lighting and shadow texture of the moving object separately if there is a moving object in the application area includes:

[0022] If there are moving objects in the application area, the preset motion trajectory will be cut into motion frames;

[0023] Calculate the light and shadow data of the moving object within each motion frame individually;

[0024] Based on the motion trajectory, the light and shadow data are organized into the light and shadow texture of the moving object.

[0025] Optionally, before the step of attaching the light and shadow texture to the corresponding position in a preset scene grayscale image to update the scene grayscale image, the method includes:

[0026] Mark the number of frames that each piece of light and shadow data in the light and shadow texture is fitted;

[0027] Associate the number of frames that are being fitted with the corresponding frames in the projected image;

[0028] The step of applying the light and shadow texture to the corresponding position in a preset scene grayscale image to update the scene grayscale image includes:

[0029] Based on the changes in each frame of the projected image, the corresponding light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image.

[0030] Optionally, before the step of bonding the light map with a preset scene grayscale image to obtain a global light map, the method further includes:

[0031] Obtain a 3D model of the application area and determine the material of the 3D model;

[0032] Based on the light distribution in the 3D model, the darkness of the 3D model is determined;

[0033] Based on the darkness and the material, the 3D model is mapped to a scene grayscale image.

[0034] This application also provides a global illumination rendering apparatus, which includes:

[0035] The first acquisition module is used to acquire the average RGB value of the screen projection in the application area in real time;

[0036] The second acquisition module is used to obtain a light map based on the average RGB value;

[0037] The bonding module is used to bond the light map with a preset scene grayscale image to obtain a global light map;

[0038] The mapping module is used to map the global light map onto the application area to render the global light of the application area.

[0039] This application also provides a global illumination rendering device, which is a physical node device. The global illumination rendering device includes: a memory, a processor, and a program for a global illumination rendering method stored in the memory and executable on the processor. When the program for the global illumination rendering method is executed by the processor, it can implement the steps of the global illumination rendering method as described above.

[0040] This application also provides a storage medium storing a program that implements the above-described global illumination rendering method. When the program is executed by a processor, it implements the steps of the global illumination rendering method as described above.

[0041] This application provides a method, apparatus, device, and storage medium for global illumination rendering. Compared with the prior art, which involves a large amount of computation and results in high energy consumption when rendering application areas, this application obtains the average RGB value of the projected image in the application area in real time; obtains a light map based on the average RGB value; combines the light map with a preset scene grayscale image to obtain a global illumination map; and maps the global illumination map onto the application area to render the global illumination of the application area. In this application, when rendering the application area, the average RGB value of the projected image is first obtained. Based on the average RGB value, a light map with color and color temperature is determined. Then, the light map is combined with a preset scene grayscale image to form a global light map, which determines the color, color temperature, and brightness of each location in the application area. Finally, the global light map with color, color temperature, and brightness is mapped onto each object in the application area to render the application area. That is, in this application, the light map obtained from the projected image is combined with a preset scene grayscale image, and the combined global light map is mapped to the application area. This reduces the calculation of the lighting color of each location in the application area, thereby reducing the amount of computation and the use of lighting fixtures, and thus reducing the energy consumption when rendering the application area. Attached Figure Description

[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating the first embodiment of the global illumination rendering method of this application;

[0045] Figure 2 This is a flowchart illustrating the second embodiment of the global illumination rendering method of this application;

[0046] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.

[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0048] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0049] This application provides a method for global illumination rendering. In the first embodiment of the global illumination rendering method of this application, refer to... Figure 1 Global illumination rendering methods include:

[0050] Step S10: Obtain the average RGB value of the projected screen in the application area in real time;

[0051] Step S20: Obtain a light map based on the RGB average value;

[0052] Step S30: The light map is laminated with a preset scene grayscale image to obtain a global light map;

[0053] Step S40: Map the global light map onto the application region to render the global light of the application region.

[0054] This embodiment aims to reduce the energy consumption of rendering the application area by reducing the amount of computation and by using appropriate lighting fixtures.

[0055] In this embodiment, it should be noted that the global illumination rendering method can be applied to a global illumination rendering apparatus, which is subordinate to a global illumination rendering device, which is subordinate to a global illumination rendering system.

[0056] RGB is a color standard, where R stands for red, G for green, and B for blue. Red, green, and blue can be combined to form various colors. Therefore, by obtaining the average RGB value of the projected image, the current average color of the projected image can be determined.

[0057] Among them, the light map can store the color and brightness of the static baked light source.

[0058] Baking can be either rendering baking, which means rendering the shadows, materials, and lighting of a 3D model into textures.

[0059] In this embodiment, a grayscale image of the application area is obtained in advance using a 3D model of the application area. This reduces the calculation of shadows, materials, and lights when performing global illumination rendering on the application area, thereby reducing the energy consumption required for computation.

[0060] It should be noted that a global light map can be a map of light and shadow and brightness at various locations within an application area. By mapping the global light map onto objects or the ground in the application area, the use of on-site lighting fixtures in the application area can be reduced or eliminated, thereby reducing the energy consumption of lighting fixtures.

[0061] In this embodiment, the average RGB value of the projected image in the application area is obtained in real time. This average RGB value can be obtained directly from the projecting device to avoid unnecessary calculations. After obtaining the average RGB value of the projected image, a light map with the same color as the current projected image is baked based on the average RGB value. The light map is then laminated with a pre-baked scene grayscale image to obtain a global light map. This reduces the amount of computation when performing global light rendering on the application area, thereby reducing the energy consumption for computation. Finally, by mapping the global light map onto objects in the application area, instead of performing global light rendering by arranging lights in the application area, the energy consumption of the lights and the devices used with the lights is reduced.

[0062] In this embodiment, the pre-set scene grayscale image can display the bright and shadowed locations in the application scene. That is, the brightness value of each location in the application area can be determined based on the scene grayscale image. After the illumination image is overlaid with the scene grayscale image, the color and color temperature of the application area are mapped, so that the average color and color temperature of the application area and the projection screen are the same.

[0063] It should be noted that the pre-set scene grayscale image can be reused when the application area is used again and the positions of the lights are the same. Alternatively, it can be used as a basis to calculate scene grayscale images for different light fixture arrangements in the application area. In other words, the scene grayscale image can be used to calculate scene grayscale images similar to the application area, avoiding the need to start the calculation from scratch and increasing the computational load. This, in turn, reduces the energy consumption used for calculation.

[0064] The specific steps are as follows:

[0065] Step S10: Obtain the average RGB value of the projected screen in the application area in real time;

[0066] The projected image can be a picture on a large screen, or a picture projected onto a wall or screen by a projector, etc. There are no specific limitations.

[0067] In this embodiment, after obtaining the RGB average value in the projected image, the RGB value of a certain pixel in the image can be changed to the RGB average value so that the required RGB average value can be directly obtained from the projected image.

[0068] It should be noted that if you need to render objects of different materials in the application area with different colors, you can set multiple pixel grids from the projection screen to meet different needs and improve the diversity of global illumination rendering.

[0069] Specifically, the steps for obtaining the average RGB value of the projected image in the application area in real time include:

[0070] Step S11: Obtain the image of each frame in the projected screen, and obtain the RGB value of each pixel in the image.

[0071] Step S12: Calculate the average RGB value of the image based on each RGB value.

[0072] In this embodiment, since the RGB value of each pixel in the projected screen may change at any time, the image of each frame in the projected screen is obtained, and the average RGB value of each frame in the projected screen is calculated through the image. This allows the light map to be updated according to the frame rate of the projected screen when performing global illumination rendering on the application area, making the color changes of global illumination rendering in the application area smoother.

[0073] Step S20: Obtain a light map based on the RGB average value;

[0074] In this embodiment, the RGB average value can be the average RGB value of each pixel in the projected image; it can also be the average RGB value between every two adjacent columns or rows, and this average RGB value is used as a transition value to make the rendering effect of the application area more realistic.

[0075] It should be noted that when the projected screen is black, the RGB value corresponding to black is used as the RGB average value, and the time to render the application scene as black is determined based on the duration of the black screen. If the RGB average value remains constant, the lightmap does not need to be changed. Furthermore, if the RGB average value is the same at two different times, it is not necessary to repeatedly determine the corresponding lightmap based on the RGB average value to avoid the energy consumption of recalculating the texture.

[0076] For example, if there are 10 frames per second of screen projection, and the RGB average values ​​of the 3rd, 7th, and 10th frames in the 3rd second are the same, then it is only necessary to calculate the lightmap corresponding to the RGB average value in the 3rd frame of the 3rd second. When the lightmap is needed in the 7th frame of the 3rd second and the 10th frame of the 5th second, the lightmap of the 3rd frame in the 3rd second can be directly called without recalculation, thus reducing the number of calculations and lowering energy consumption.

[0077] Step S30: The light map is laminated with a preset scene grayscale image to obtain a global light map;

[0078] In this embodiment, the UV coordinate system in the texture is used to align the light map with the scene grayscale map, and then the light map is laminated with the scene grayscale map so that the pixel grids of the two textures correspond, avoiding the situation where some areas in the scene grayscale map are not covered, resulting in color gaps when rendering global illumination for the application scene.

[0079] It should be noted that the scene grayscale image is obtained from the 3D model of the application area before rendering. After obtaining the 3D model, the scene grayscale image is obtained by baking based on fixed lighting to reduce the amount of calculation on the rendering site.

[0080] In this embodiment, when the light map is overlaid with the scene grayscale map, if there are moving objects in the application area, i.e., moving objects, the grayscale map of the moving objects is calculated separately and added to the corresponding position of the scene grayscale map to reduce the calculation of the grayscale map of the application area. That is, only moving objects in the application area are calculated to reduce the energy consumption required for calculation.

[0081] The moving objects can be the host, a rolling apple, or a camera, etc., with no specific restrictions.

[0082] Specifically, the step of bonding the light map with a preset scene grayscale image to obtain a global light map further includes:

[0083] Step S31: If there are moving objects in the application area, calculate the light and shadow texture of the moving objects separately;

[0084] Step S32: Apply the light and shadow texture to the corresponding position in the preset scene grayscale image to update the scene grayscale image;

[0085] Step S33: The light map is laminated with the updated scene grayscale image to obtain a global light map.

[0086] In this embodiment, since the moving object is in motion and its position is different at each moment, by obtaining the position of the moving object in each frame, the light and shadow texture that needs to be rendered on the moving object can be accurately calculated, and the area affected by the moving object in the application area can be changed.

[0087] In this embodiment, after calculating the light and shadow texture of the moving object, the light and shadow texture is updated to the scene grayscale image, so that the grayscale of the moving object is added to the scene grayscale image, and the grayscale of the area affected by the moving object is changed, so as to make the rendered global illumination more realistic.

[0088] Specifically, the step of calculating the lighting and shadow texture of the moving object separately if there is a moving object in the application area includes:

[0089] Step A10: If there are moving objects in the application area, the preset motion trajectory is cut into motion frames;

[0090] Step A20: Calculate the light and shadow data of the moving object in each motion frame individually;

[0091] Step A30: Based on the motion trajectory, organize the light and shadow data into the light and shadow texture of the moving object.

[0092] It should be noted that since the moving objects are in motion and their positions are different at each moment, obtaining the position of the moving object in each frame allows us to obtain the lighting and shadow data of the moving object in the corresponding frame. By integrating the lighting and shadow data of the moving object in the order of its motion trajectory, we can obtain the lighting and shadow texture of the moving object and make the transition of global illumination on the moving object more realistic.

[0093] The movement trajectory can be a planned movement trajectory during rehearsal, or a movement trajectory inferred from the position of the moving object obtained in real time, etc., and there is no specific limitation.

[0094] In this embodiment, since an object may not be absolutely still when it pauses during movement, if the object temporarily stops during a certain period of time, the light and shadow data for that period of time can be calculated by selecting the middle frame from the image corresponding to that period of time.

[0095] In this embodiment, the motion trajectory of the moving object is cut into motion frames, and the light and shadow data of the moving object in each frame is calculated based on each motion frame. If the moving object is identified as briefly stopped by the motion trajectory, the intermediate frame of that time period is obtained, and the light and shadow data of the moving object is calculated based on the intermediate frame. Finally, the light and shadow data of the moving object during the motion period are integrated into a light and shadow texture, so that the global light rendering of the moving object in the application area is smoother when the projection screen changes, and the amount of calculation for stationary objects is reduced, thus reducing the energy consumption when rendering the application area.

[0096] Step S40: Map the global light map onto the application region to render the global light of the application region.

[0097] In this embodiment, before mapping the global light map onto the application area, it is necessary to perform texture pairing between the global map and the 3D model of the application area, and then map the global light map onto the application area according to the ratio between the 3D model and the actual application area.

[0098] In this embodiment, the rendering of the application area can change the brightness and color temperature values ​​of the application area according to the change of the RGB average value of each frame of the projected image. Alternatively, it can use only one set of RGB average values ​​to fix the brightness and color temperature values ​​of the application area, thereby increasing the diversity of global illumination rendering of the application area.

[0099] In this embodiment, by mapping the global light map to the application area, the calculation of the lighting position and intensity of the lights in the application area can be reduced, thereby reducing energy consumption. Moreover, no lights or additional resources are required during the rendering process, achieving the effect of low-energy global illumination.

[0100] Specifically, the step of mapping the global illumination map onto the application region to render the global illumination of the application region includes:

[0101] Step S41: Map the global light map to the application area and determine the brightness weight of the global light map;

[0102] Step S42: Determine the RGB changes of the projected image based on each of the RGB average values;

[0103] Step S43: Based on the RGB changes and the brightness weights, change the color of the global light map to render the global light of the application area.

[0104] In this embodiment, when light shines on an object, there will be a bright side and a dark side. The brightness of the bright side and the shadow of the dark side are not entirely affected by the direct light, but are also affected by the reflected light from other reflective objects in the scene. Therefore, when rendering the global illumination of the application area, it is necessary to obtain the brightness weight of the global illumination map and determine the change of the average RGB value between each two adjacent frames. That is, the RGB change of the projected screen is finally changed according to the RGB change and the brightness weight to change the color of the global illumination map.

[0105] In this embodiment, the color value change of the brighter area is greater than the change value of the shadow area, so as to ensure that the preset mapping position, that is, the preset lighting direction is correct and the effect is realistic.

[0106] This application provides a method, apparatus, device, and storage medium for global illumination rendering. Compared with the prior art, which involves a large amount of computation and results in high energy consumption when rendering application areas, this application obtains the average RGB value of the projected image in the application area in real time; obtains a light map based on the average RGB value; combines the light map with a preset scene grayscale image to obtain a global illumination map; and maps the global illumination map onto the application area to render the global illumination of the application area. In this application, when rendering the application area, the average RGB value of the projected image is first obtained. Based on the average RGB value, a light map with color and color temperature is determined. Then, the light map is combined with a preset scene grayscale image to form a global light map, which determines the color, color temperature, and brightness of each location in the application area. Finally, the global light map with color, color temperature, and brightness is mapped onto each object in the application area to render the application area. That is, in this application, the light map obtained from the projected image is combined with a preset scene grayscale image, and the combined global light map is mapped to the application area. This reduces the calculation of the lighting color of each location in the application area, thereby reducing the amount of computation and the use of lighting fixtures, and thus reducing the energy consumption when rendering the application area.

[0107] Furthermore, based on the above embodiments of this application, another embodiment of this application is provided, in which reference is made to... Figure 2 Before the step of bonding the light map with a preset scene grayscale image to obtain a global light map, the method further includes:

[0108] Step S01: Obtain the 3D model of the application area and determine the material of the 3D model;

[0109] Step S02: Determine the darkness of the 3D model based on the light distribution in the 3D model;

[0110] Step S03: Based on the darkness and the material, map the 3D model into a scene grayscale image.

[0111] In this embodiment, before rendering the application area, a grayscale image of the scene is obtained through the 3D model of the application area to reduce the amount of computation.

[0112] In this embodiment, since the material of the application area and the position between the application area and the lamps both affect the brightness of the application area, before obtaining the scene grayscale image of the 3D model, it is necessary to obtain the material of each object in the application area and the distribution position of each object, that is, the material of the 3D model. Then, through the distribution of lights in the 3D model, the darkness of the application area and each object in the application area is determined. Finally, based on the darkness and material, the 3D model is mapped to the scene grayscale image.

[0113] The scene grayscale image can be used to determine the brightness of each location within the application area, and the scene grayscale image contains a texture map of the application area. This texture map can be used to accurately map the global light map onto the application area.

[0114] In this embodiment, the scene grayscale image can be one or multiple images. When the application scenario changes, the scene grayscale image used will also be changed accordingly.

[0115] It should be noted that multiple scene grayscale images are obtained by modifying the initial 3D model. This allows subsequent scene grayscale images to be calculated based on the first image, reducing computational load, lowering computational energy consumption, and adapting to changes in application scenarios.

[0116] Furthermore, based on the above embodiments of this application, another embodiment of this application is provided. In this embodiment, before the step of attaching the light and shadow texture to the corresponding position in a preset scene grayscale image to update the scene grayscale image, the method includes:

[0117] Step B10: Mark the number of frames that are fitted for each piece of light and shadow data in the light and shadow texture;

[0118] Step B20: Associate the number of frames to be aligned with the corresponding frame in the projected image.

[0119] In this embodiment, since the starting time of the moving object and the projected image are different, it is necessary to determine the number of frames for each light and shadow data to be pasted onto the scene grayscale image in the corresponding frame so as to update the scene grayscale image.

[0120] In this embodiment, each frame of the light and shadow texture is associated with the corresponding frame of the projected screen. When the projected screen reaches the frame number of the matching frame, the light and shadow texture is automatically updated according to the image on the projected screen to make the rendering more realistic.

[0121] The step of applying the light and shadow texture to the corresponding position in a preset scene grayscale image to update the scene grayscale image includes:

[0122] Step C10: Based on the changes in each frame of the projected image, the corresponding light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image.

[0123] In this embodiment, the light and shadow texture is attached to a preset position in the grayscale image so that the brightness and color temperature values ​​in the global light map correspond to the moving object, thereby improving the realism of the rendering of the application area.

[0124] Reference Figure 3 , Figure 3This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.

[0125] like Figure 3 As shown, the global illumination rendering device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0126] Optionally, the global illumination rendering device may also include a rectangular user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The rectangular user interface may include a display screen and an input submodule such as a keyboard. Optionally, the rectangular user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0127] Those skilled in the art will understand that Figure 3 The device structure for global illumination rendering shown does not constitute a limitation on the device for global illumination rendering and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0128] like Figure 3 As shown, the memory 1005, serving as a storage medium, may include an operating system, a network communication module, and a global illumination rendering program. The operating system is a program that manages and controls the hardware and software resources of the global illumination rendering device, supporting the execution of the global illumination rendering program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the global illumination rendering system.

[0129] exist Figure 3 In the global illumination rendering device shown, the processor 1001 is used to execute the global illumination rendering program stored in the memory 1005 to implement the steps of the global illumination rendering method described above.

[0130] The specific implementation of the global illumination rendering device in this application is basically the same as the various embodiments of the global illumination rendering method described above, and will not be repeated here.

[0131] This application also provides a global illumination rendering apparatus, which includes:

[0132] The first acquisition module is used to acquire the average RGB value of the screen projection in the application area in real time;

[0133] The second acquisition module is used to obtain a light map based on the average RGB value;

[0134] The bonding module is used to bond the light map with a preset scene grayscale image to obtain a global light map;

[0135] The mapping module is used to map the global light map onto the application area to render the global light of the application area.

[0136] Optionally, the first acquisition module includes:

[0137] The first acquisition submodule is used to acquire the image of each frame in the projected screen and acquire the RGB value of each pixel in the image.

[0138] Based on each of the RGB values, the average RGB value of the image is calculated.

[0139] Optionally, the mapping module includes:

[0140] The mapping submodule is used to map the global light map to the application area and determine the brightness weight of the global light map;

[0141] The determining module is used to determine the RGB changes of the projected image based on each of the RGB average values;

[0142] The rendering module is used to change the color of the global light map based on the RGB changes and the brightness weights, so as to render the global light of the application area.

[0143] Optionally, the bonding module includes:

[0144] The calculation module is used to calculate the light and shadow texture of the living creature separately if there is a living creature in the application area;

[0145] The update module is used to attach the light and shadow texture to the corresponding position in the preset scene grayscale image to update the scene grayscale image;

[0146] The bonding submodule is used to bond the light map with the updated scene grayscale image to obtain a global light map.

[0147] Optionally, the computing module is configured to include:

[0148] The cutting module is used to cut the preset motion trajectory into motion frames if there are moving objects in the application area;

[0149] The calculation submodule is used to calculate the light and shadow data of the moving object in each motion frame individually.

[0150] The processing module is used to process the light and shadow data into the light and shadow texture of the moving object based on the motion trajectory.

[0151] Optionally, the global illumination rendering apparatus further includes:

[0152] A marking module is used to mark the number of frames that each piece of light and shadow data in the light and shadow texture is fitted to;

[0153] The association module is used to associate the number of frames being fitted with the corresponding frames in the projected screen.

[0154] The enhanced display module includes:

[0155] The more prominent submodule is used to apply the corresponding light and shadow texture to the corresponding position in the preset scene grayscale image based on the changes in each frame of the projected image, so as to update the scene grayscale image.

[0156] Optionally, the global illumination rendering apparatus further includes:

[0157] An acquisition unit is used to acquire a 3D model of the application area and determine the material of the 3D model;

[0158] A determining unit is used to determine the darkness of the 3D model based on the light distribution in the 3D model;

[0159] The mapping unit is used to map the 3D model into a scene grayscale image based on the darkness and the material.

[0160] The specific implementation of the global illumination rendering apparatus of this application is basically the same as the embodiments of the global illumination rendering method described above, and will not be repeated here.

[0161] This application provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the global light rendering method described above.

[0162] The specific implementation of the storage medium in this application is basically the same as the embodiments of the global light rendering method described above, and will not be repeated here.

[0163] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0164] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0166] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention’s specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for global illumination rendering, characterized in that, The global illumination rendering method includes: Real-time acquisition of the average RGB value of the projected image in the application area; Based on the average RGB values, a light map with the same colors as the current projected screen is baked. The light map is then laminated with a preset scene grayscale image to obtain a global light map; The global light map is mapped onto the application region to render the global light of the application region; The step of mapping the global illumination map onto the application region to render the global illumination of the application region includes: The global light map is mapped onto the application region, and the brightness weight of the global light map is determined. Based on each of the RGB average values, the RGB changes of the projected image are determined; Based on the RGB changes and the brightness weights, the color of the global light map is changed to render the global light of the application area; The step of bonding the light map with a preset scene grayscale image to obtain a global light map further includes: If there are living objects in the application area, the lighting and texture of the living objects are calculated separately. The light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image; The light map is then combined with the updated scene grayscale image to obtain a global light map. Before the step of bonding the light map with a preset scene grayscale image to obtain a global light map, the method further includes: Obtain a 3D model of the application area and determine the material of the 3D model; Based on the light distribution in the 3D model, the darkness of the 3D model is determined; Based on the darkness and the material, the 3D model is mapped to a scene grayscale image.

2. The global illumination rendering method as described in claim 1, characterized in that, The step of obtaining the average RGB value of the projected image in the application area in real time includes: Acquire the image of each frame in the projected screen, and obtain the RGB value of each pixel in the image; Based on each of the RGB values, the average RGB value of the image is calculated.

3. The global illumination rendering method as described in claim 1, characterized in that, The step of calculating the lighting and shadow texture of a moving object separately if such an object exists in the application area includes: If there are moving objects in the application area, the preset motion trajectory will be cut into motion frames; Calculate the light and shadow data of the moving object within each motion frame individually; Based on the motion trajectory, the light and shadow data are organized into the light and shadow texture of the moving object.

4. The global illumination rendering method as described in claim 3, characterized in that, Before the step of attaching the light and shadow texture to the corresponding position in the preset scene grayscale image to update the scene grayscale image, the method includes: Mark the number of frames that each piece of light and shadow data in the light and shadow texture is fitted; Associate the number of frames that are being fitted with the corresponding frames in the projected image; The step of applying the light and shadow texture to the corresponding position in a preset scene grayscale image to update the scene grayscale image includes: Based on the changes in each frame of the projected image, the corresponding light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image.

5. A global illumination rendering apparatus, characterized in that, The apparatus for global illumination rendering includes: The first acquisition module is used to acquire the average RGB value of the screen projection in the application area in real time; The second acquisition module is used to bake a light map with the same color as the current projection screen based on the average RGB value. The bonding module is used to bond the light map with a preset scene grayscale image to obtain a global light map; A mapping module is used to map the global light map onto the application region to render the global light of the application region; The global illumination rendering apparatus is also used to achieve: The global light map is mapped onto the application region, and the brightness weight of the global light map is determined. Based on each of the RGB average values, the RGB changes of the projected image are determined; Based on the RGB changes and the brightness weights, the color of the global light map is changed to render the global light of the application area; The global illumination rendering apparatus is also used to achieve: If there are living objects in the application area, the lighting and texture of the living objects are calculated separately. The light and shadow texture is applied to the corresponding position in the preset scene grayscale image to update the scene grayscale image; The light map is then combined with the updated scene grayscale image to obtain a global light map. The global illumination rendering apparatus is also used to achieve: Obtain a 3D model of the application area and determine the material of the 3D model; Based on the light distribution in the 3D model, the darkness of the 3D model is determined; Based on the darkness and the material, the 3D model is mapped to a scene grayscale image.

6. A device for global illumination rendering, characterized in that, A device for global illumination rendering includes: memory, a processor, and a program stored in memory for implementing global illumination rendering. The memory is used to store the program that implements the method of global illumination rendering; The processor is configured to execute a program that implements a method for global illumination rendering, to implement the steps of the method for global illumination rendering as described in any one of claims 1 to 4.

7. A storage medium, characterized in that, The storage medium stores a program for implementing a method of global illumination rendering, and the program for implementing the method of global illumination rendering is executed by a processor to implement the steps of the method of global illumination rendering as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Scene model rendering method, device and equipment

    CN114119818A

  • Light source sampling weight determination method for multi-light source scene rendering and related equipment

    CN114549730A