Information processing method, device and computer readable storage medium
By allocating lighting information to a preset number of lighting groups, and performing unified template and color drawing processing on each lighting group, the problem of excessive state switching in the existing technology is solved, and the information of computer animation production is significantly improved. processing efficiency.
Patent Information
- Application Number
- CN202110180502.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-02-09
AI Technical Summary
In the existing technology, environment-based lighting rendering in computer animation production will lead to a large number of state switches, causing the CPU and GPU to be busy and the information processing efficiency to be low.
By obtaining the light information in the virtual scene, assigning it to a preset number of light groups, performing template drawing processing and color drawing processing on the light information in each lighting group, and marking the template as the object pixel with the first preset value. Lighting rendering to reduce state switching.
It greatly improves the efficiency of information processing, reduces the number of drawcalls, reduces the load on the CPU and GPU, and improves the efficiency of screen rendering.
Smart Images

Figure CN112819938B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information processing method, device and computer-readable storage medium. Background Art
[0002] In computer animation production, environment-based lighting rendering is an important part of achieving realism. Lighting rendering mainly obtains the lighting information around objects from the environment and renders and illuminates the objects through the lighting information.
[0003] In the prior art, all the lighting information in the environment can be obtained, and objects in the environment are drawn through the drawcall method according to the lighting volume (LightVolume) of the lighting information. Each lighting information in the environment is drawn in a loop until all the lighting information is drawn, so as to realize the lighting rendering of the environment.
[0004] In the process of research and practice of the prior art, the inventors of the present application found that in the prior art, drawing each light information in sequence would generate a large number of state switches, causing the central processing unit (CPU) and graphics processing unit (GPU) of the device to be busy and the information processing efficiency to be low. Summary of the invention
[0005] The embodiments of the present application provide an information processing method, device, and computer-readable storage medium, which can improve the efficiency of information processing.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] An information processing method, comprising:
[0008] Acquire lighting information in a virtual scene, wherein the lighting information carries lighting volume information;
[0009] Distributing the lighting information among a preset number of lighting groups;
[0010] Performing template drawing processing on the light information in each light group, so as to perform template marking on the object pixels covered by the illumination volume information of each light information;
[0011] Color rendering is performed on the light information in each light group after the template rendering process, and lighting rendering is performed on the object pixels marked by the template as the first preset value.
[0012] An information processing device, comprising:
[0013] An acquisition unit, used to acquire light information in a virtual scene, wherein the light information carries illumination volume information;
[0014] an allocating unit, configured to allocate the lighting information to a preset number of lighting groups;
[0015] A first processing unit is used to perform template drawing processing on the light information in each light group, so as to perform template marking on the object pixels covered by the illumination volume information of each light information;
[0016] The second processing unit is used to perform color drawing processing on the light information in each light group after the template drawing processing, and perform lighting drawing on the object pixels marked by the template as the first preset value.
[0017] In some embodiments, the first processing unit is configured to:
[0018] Performing template marking processing on the light information in each light group in turn, so as to mark the illumination pixels covered by the illumination volume information of each light information as a first preset value;
[0019] Obtain object pixels corresponding to multi-dimensional object information in a virtual scene;
[0020] The illumination pixels that do not intersect with the object pixels are marked as second preset values, so as to perform template drawing processing on the lighting information in each lighting group in a unified manner.
[0021] In some embodiments, the second processing unit is configured to:
[0022] Sequentially traverse the marks of the light information in each light group after the template drawing process, and determine the object pixels in each light group marked as the first preset value;
[0023] Perform lighting rendering on the object pixels marked as the first preset value in each light group.
[0024] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in the above-mentioned information processing method.
[0025] The embodiment of the present application obtains the lighting information in the virtual scene, and the lighting information carries the illumination volume information; distributes the lighting information to a preset number of lighting groups; performs template drawing processing on the lighting information in each lighting group, so as to mark the object pixels covered by the illumination volume information of each lighting information with a template; performs color drawing processing on the lighting information in each lighting group after the template drawing processing, and performs illumination drawing on the object pixels marked with the template as the first preset value. In this way, the lighting information is distributed to the preset number of lighting groups, and the lighting information in each lighting group is uniformly subjected to template drawing processing and color drawing processing in a unified manner with the lighting group as a unit, and the object pixels marked with the template as the first preset value are subjected to illumination drawing, which reduces state switching and greatly improves the efficiency of information processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 is a schematic diagram of a scenario of an information processing system provided by an embodiment of the present application;
[0028] Figure 2 It is a flowchart of the information processing method provided in the embodiment of the present application;
[0029] Figure 3 is another flowchart of the information processing method provided by an embodiment of the present application;
[0030] Figure 4 A schematic diagram of a scenario of an information processing method provided in an embodiment of the present application;
[0031] Figure 5 is a schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
[0032] Figure 6 It is a schematic diagram of the structure of the terminal provided in the embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0034] Embodiments of the present application provide an information processing method, device, and computer-readable storage medium.
[0035] See also Figure 1 , Figure 1 The scenario diagram of the information processing system provided for the embodiment of the present application includes: terminal A, and a server (the information processing system may also include other terminals in addition to terminal A, and the specific number of terminals is not limited here), terminal A and the server may be connected through a communication network, and the communication network may include a wireless network and a wired network, wherein the wireless network includes a combination of one or more of a wireless wide area network, a wireless local area network, a wireless metropolitan area network, and a wireless personal network. The network includes network entities such as routers and gateways, which are not shown in the figure. Terminal A can exchange information with the server through the communication network, for example, terminal A sends the current image frame to the server online through a game application.
[0036] The information processing system may include an information processing device, which may be integrated in a server. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Figure 1 As shown, the server can push the video stream information that needs to be rendered to terminal A.
[0037] Terminal A in the information processing system can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. Terminal A can install various applications required by users, such as game applications, etc. Terminal A can receive video stream information pushed by the server for rendering, obtain lighting information in the virtual scene, and the lighting information carries lighting volume information; distribute the lighting information to a preset number of lighting groups; perform template drawing processing on the lighting information in each lighting group to perform template marking on the object pixels covered by the lighting volume information of each lighting information; perform color drawing processing on the lighting information in each lighting group after the template drawing processing, and perform lighting drawing on the object pixels marked by the template as the first preset value.
[0038] It should be noted that Figure 1The scenario diagram of the information processing system shown is merely an example. The information processing system and scenario described in the embodiments of the present application are intended to more clearly illustrate the technical solution of the embodiments of the present application, and do not constitute a limitation on the technical solution provided in the embodiments of the present application. A person of ordinary skill in the art will appreciate that with the evolution of information processing systems and the emergence of new business scenarios, the technical solution provided in the embodiments of the present application is equally applicable to similar technical problems.
[0039] The following are detailed descriptions of each.
[0040] In this embodiment, the description will be made from the perspective of an information processing device, which may be specifically integrated in a terminal having a storage unit and a microprocessor installed therein and having computing capabilities.
[0041] See also Figure 2 , Figure 2 : is a flow chart of an information processing method provided in an embodiment of the present application. The information processing method includes:
[0042] In step 101, light information in a virtual scene is obtained.
[0043] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further process images so that the computer processes them into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0044] The solution provided in the embodiments of the present application involves artificial intelligence computer vision technology and other technologies, which are specifically described by the following embodiments:
[0045] Among them, the lighting rendering of the environment is an important part of realizing the realism of animation. In related technologies, although all the lighting information in the environment can be obtained, the objects in the environment are drawn through drawcall according to the lighting volume of each lighting information, and all the lighting information is drawn to realize the lighting rendering of the environment. In the rendering process, there are twice as many drawcalls as the number of lighting information. The drawcall can be understood as a drawing process, that is, each time the CPU prepares data and notifies the GPU is called a drawcall. The specific process can be set color-->drawing mode-->vertex coordinates-->drawing-->end.
[0046] The embodiments of the present application can avoid excessive number of drawcalls. First, lighting information in a virtual scene is obtained. The virtual scene may be a 3D (D) virtual scene, such as a 3D game scene corresponding to a game video, etc. The lighting information is rendering data corresponding to the light formed in the virtual scene by light emitted by a light source in the virtual scene. The light information carries lighting volume information, which may be a geometric body representing the range of light formation.
[0047] In step 102, the lighting information is distributed into a preset number of lighting groups.
[0048] In the lighting rendering process of an actual virtual scene, a display pixel in the virtual scene will have multiple cache information, which may include multiple related information on whether lighting rendering is required. Stencil cache information is one of them, which is used to mark the display pixel that needs lighting rendering. The stencil cache information can be information in 1 bit units. A bit is the smallest unit of information, which is the information contained in one bit of a binary number or the required information amount of one of the two options, that is, 0 and 1. In the process of lighting rendering, the pixels of the object to be rendered can be processed by stencil drawing (Stencilpass). This process does not perform color rendering, but only marks the stencil cache information. The pixels marked as 1 represent the pixels that need to be rendered, and the pixels marked as 0 represent the pixels that need to be eliminated, and do not need lighting rendering. Then, color rendering is performed through the color drawing process (Colorpass). The pixels of the object marked as 1 are rendered in color, and the pixels marked as 0 are eliminated to achieve lighting rendering. That is, in the relevant technology, each light information needs to be processed through the stencil drawing process and the color drawing process, and then each light information needs 2 drawcalls for rendering. The drawcall is the operation of the CPU calling the graphics programming interface to command the GPU to render. Therefore, there are twice as many drawcalls as the number of light information, which will generate a large number of drawcalls.
[0049] However, too many drawcalls will cause the CPU and GPU to perform a large number of calculations, which will lead to overload and affect the efficiency of image rendering. Therefore, the embodiment of the present application can distribute the lighting information among a preset number of lighting groups, which can be 8 groups, 10 groups, 16 groups, etc., so that when drawing subsequently, the lighting information in each lighting group can be uniformly drawn based on the lighting group as the basic unit, that is, one lighting group only needs 2 drawcalls to render multiple lighting information, which greatly reduces the number of drawcalls, thereby reducing the number of state switching and improving information processing efficiency.
[0050] In one embodiment, when the depth buffer (DepthBuffer) format is selected as D24S8, the depth buffer corresponds to the frame buffer and is used to record the depth value of each pixel thereon, and can be used to record template cache information. D24S8 is an 8-bit recording format. In this way, the recording template can have 8 bits, that is, it can represent 8 groups of light groups, each group can be template-marked with x, and the x can be 0 or 1, so that each light information can be allocated to the eight groups of light groups; each group of light groups is set to use a bit unit to template-mark the light information in the group.
[0051] In some embodiments, the step of distributing the lighting information into a preset number of lighting groups may include:
[0052] (1) Obtaining coverage data corresponding to illumination volume information of each light information;
[0053] (2) Setting the preset coverage data for each lighting group;
[0054] (3) Based on the rule that the sum of the coverage data of the lighting information allocated to each lighting group does not exceed the preset coverage data, each lighting information is allocated to multiple lighting groups.
[0055] Among them, the illumination volume information can be a geometric body of the illumination range formed by the light represented by the light information on the virtual scene, and all pixels covered by the illumination volume information of each light information in the virtual space dimension are obtained, and coverage range data is formed by all the covered pixels. When there is an overlapping area between the coverage data corresponding to the illumination volume information between the light information of the same light group, the template cache information of the pixels in the overlapping area may change repeatedly during rendering. For example, culling can be performed in one light information, and the template cache information is marked as 0, while the template cache information is marked as 1 in another light information, then the cache information will change repeatedly, causing unnecessary calculations and bringing load to the CPU, so the smaller the overlapping area between the coverage data corresponding to the illumination volume information between the light information of the same light group, the better.
[0056] In a virtual scene, due to the influence of factors such as the light source distance or scene obstacles, the lighting information will result in different coverage data corresponding to the illumination volume information of different lighting information. The lighting information with larger coverage data has a greater probability of overlapping with the coverage data of other lighting information, and the lighting information with smaller coverage data has a smaller probability of overlapping with the coverage data of other lighting information. Therefore, when allocating lighting information to lighting groups, more lighting information with small coverage data or fewer lighting information with large coverage data can be allocated in a lighting group to minimize the overlapping area between lighting information in the same group.
[0057] In this way, preset coverage data can be set for each lighting group, and the preset coverage data is the maximum coverage data that can be reached by the sum of the coverage data of all lighting information allocated in a lighting group. The preset coverage data can be set according to the number of lighting groups and the sum of the coverage data of all lighting information. Based on the rule that the sum of the coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data, each lighting information is allocated to multiple lighting groups, and the number of the multiple groups is at least 2, for example 8, so that more lighting information with small coverage data or fewer lighting information with large coverage data can be allocated in one lighting group, thereby reducing the overlapping area between the lighting information in the same group.
[0058] In some embodiments, the step of distributing the lighting information into a preset number of lighting groups may include:
[0059] (1.1) Obtaining coverage data corresponding to illumination volume information of each light information;
[0060] (1.2) Light information with overlapping areas between coverage data is allocated to different light groups to obtain multiple light groups.
[0061] Among them, the coverage data corresponding to the illumination volume information of each light information can be obtained. In order to avoid overlapping areas between light information in the same group, the light information with overlapping areas between the coverage data can be limited to be distributed in different light groups to obtain multiple light groups, and the number of the multiple light groups is at least 2, for example, 8. The coverage data between each light information in the multiple light groups are independent, which can avoid unnecessary calculations and further improve the efficiency of information processing.
[0062] In some embodiments, the step of allocating the lighting information with overlapping areas between coverage data to different lighting groups to obtain multiple lighting groups may include: allocating each lighting information to multiple lighting groups based on the rule that there is no overlapping area between the coverage data of the lighting information allocated in each lighting group.
[0063] Among them, based on the rule that there is no overlapping area between the coverage data of the lighting information allocated in each lighting group, each lighting information is allocated to multiple lighting groups, which can ensure that the coverage data between the lighting information in each lighting group are independent, avoiding unnecessary calculations.
[0064] In step 103, template drawing processing is performed on the light information in each light group.
[0065] Among them, the light information in each light group can be uniformly templated first, and then all the light information in each light group can be uniformly templated, so as to avoid performing template drawing process on each light information separately, resulting in a large number of state switching, repeated calls of CPU and GPU, causing CPU and GPU jams, and reducing the efficiency of information processing.
[0066] In some embodiments, the step of uniformly performing template drawing processing on the light information in each light group in sequence to perform template marking on the object pixels covered by the illumination volume information of each light information includes:
[0067] (1) performing template marking processing on the light information in each light group in turn, so as to mark the illumination pixels covered by the illumination volume information of each light information as a first preset value;
[0068] (2) obtaining object pixels corresponding to multi-dimensional object information in a virtual scene;
[0069] (3) The illumination pixels that do not intersect with the object pixels are marked as second preset values, so as to achieve unified template drawing processing for the lighting information in each lighting group in turn.
[0070] The illumination pixels covered by the illumination volume information of each light information in the virtual scene are marked as a first preset value, and the first preset value may be 1. The light information in each light group may be subjected to a uniform template marking process using an Instancing technology in turn. The Instancing technology is a technology used to improve the efficiency of rendering a large number of objects, and may render multiple copies of the same mesh at one time, reduce drawcall calls, and improve the efficiency of template marking process.
[0071] Furthermore, the object pixels corresponding to the multi-dimensional object information in the virtual scene can be obtained. The multi-dimensional object information is the object object in the virtual scene, such as virtual characters, virtual walls, and other virtual entity objects that can display lights. Since lights require actual objects as carriers for display, the illumination pixels that intersect with the object pixels can be marked as a first preset value, and the illumination pixels that do not intersect with the object pixels can be marked as a second preset value. In order to avoid the illumination display not conforming to the display rules, the pixels marked with the second preset value need to be removed later to achieve unified template drawing processing for the lighting information in each lighting group in turn.
[0072] In step 104, color rendering is performed on the light information in each light group after the template rendering process, and light rendering is performed on the object pixels marked as the first preset value in the template.
[0073] Among them, after completing the template drawing, the light information in each light group after the template drawing processing is uniformly color-drawn in turn, and the object pixels marked by the template as the first preset value, that is, the object pixels covered by the lighting volume, are color rendered to realize the lighting drawing of the virtual scene.
[0074] In some embodiments, the step of uniformly performing color drawing processing on the light information in each light group after the template drawing processing, and performing illumination drawing on the object pixels marked as the first preset value in the template includes:
[0075] (1) sequentially traversing the marks of the light information in each light group after the template drawing process, and determining the object pixels in each light group marked as the first preset value;
[0076] (2) Perform illumination rendering on the object pixels marked as the first preset value in each light group.
[0077] The labels of the pixels in the illumination volume information of the light information in each light group after the template drawing process are traversed in turn to determine the object pixels marked as the first preset value, that is, marked as 1, in each light group.
[0078] Furthermore, in combination with the Instancing technology, the object pixels marked as the first preset value in each light group are uniformly rendered with light colors, that is, the colors generated by the light illumination are rendered to the corresponding object pixels, so as to realize the lighting drawing of the virtual scene. Compared with the related technology, the embodiment of the present application can call the Instancing technology for fast processing in both template drawing processing and color drawing processing by taking groups as units, thereby further accelerating the rendering speed and the number of drawcall calls, and better improving the efficiency of information processing.
[0079] As can be seen from the above, the embodiment of the present application obtains the lighting information in the virtual scene, and the lighting information carries the illumination volume information; distributes the lighting information to a preset number of lighting groups; performs template drawing processing on the lighting information in each lighting group to mark the object pixels covered by the illumination volume information of each lighting information with a template; performs color drawing processing on the lighting information in each lighting group after the template drawing processing, and performs illumination drawing on the object pixels marked with the template as the first preset value. In this way, the lighting information is distributed to a preset number of lighting groups, and the lighting information in each lighting group is uniformly subjected to template drawing processing and color drawing processing in a unified manner with the lighting group as a unit, and the object pixels marked with the template as the first preset value are subjected to illumination drawing, which reduces state switching and greatly improves the efficiency of information processing.
[0080] In combination with the method described in the above embodiment, the method will be further described in detail with examples below.
[0081] In this embodiment, the information processing device is specifically integrated in a terminal as an example for description, and specific reference is made to the following description.
[0082] See also Figure 3 , Figure 3 Another flowchart of the information processing method provided in the embodiment of the present application. The method flow may include:
[0083] In step 201, the terminal obtains lighting information in a virtual scene.
[0084] Please also refer to Figure 4 As shown, Figure 4A scene schematic diagram of the information processing method provided in an embodiment of the present application, the terminal can obtain lighting information in a virtual scene 10, the virtual scene can be a three-dimensional virtual scene, the lighting information is rendering data corresponding to the light formed in the virtual scene by the light emitted by the light source in the virtual scene, the light information carries lighting volume information, the lighting volume information can be a geometric body representing the range of light formation, the lighting information carries lighting volume information 11, the lighting volume information 11 is a multi-dimensional geometric body representing the range of light formation.
[0085] In step 202, the terminal obtains coverage data corresponding to the illumination volume information of each light information, calculates the sum of the coverage data of each light information, and adds the sum to the expanded coverage data to obtain target coverage data.
[0086] It should be noted that the embodiment of the present application adopts the depth buffer format D24S8, that is, the recording template can have 8 bits, which means that the embodiment of the present application includes 8 lighting groups.
[0087] Please continue to read Figure 4 The terminal can obtain all pixels covered by each light information illumination volume information 11 in the spatial dimension of the virtual scene 10 to form coverage data, which is the area information formed by all pixels covered by the light information in the virtual scene. Since the light information with larger coverage data has a greater probability of overlapping with the coverage data of other light information, and the light information with smaller coverage data has a smaller probability of overlapping with the coverage data of other light information, in order to make the overlapping area in the same light group as small as possible, more light information with small coverage data or fewer light information with large coverage data can be allocated to each light group, and the total coverage data of each light information can be counted.
[0088] Assuming that the preset coverage data of each light group is divided by the sum of the coverage data, the preset coverage data is the maximum coverage data that can be reached by the sum of the coverage data of all light information allocated to a light group, which will result in that some light information cannot be stored. Therefore, extended coverage data can be introduced, and the extended coverage data can be one fifth of the sum of the coverage data of each light information. The sum of the coverage data of each light information is added to the extended coverage data to obtain the target coverage data.
[0089] In step 203, the terminal calculates according to the target coverage data and the number of eight groups to obtain the preset coverage data, and allocates each lighting information to one of the eight lighting groups based on the rule that the sum of the coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data.
[0090] Among them, the terminal can calculate the ratio of the target coverage data and the number of eight groups, which can be represented by the number 8, to obtain the preset coverage data, and based on the rule that the sum of the coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data, each lighting information is allocated to the eight lighting groups, so as to achieve more lighting information with small coverage data or less lighting information with large coverage data in each lighting group, reasonably separate the lighting information according to the coverage data, minimize the overlapping area between the lighting information in the same group, and allocate each lighting information to the eight lighting groups.
[0091] In one embodiment, the terminal can set each light group to use a binary marking rule to template mark the light information in the group, and the template mark for marking each light group is a binary marking method of 0 and 1.
[0092] In step 204, the terminal performs template marking processing on the light information in each light group in turn, so as to mark the illuminated pixels covered by the illuminated volume information of each light information as a first preset value.
[0093] Please continue to read Figure 4 As shown, the light information in each light group is uniformly template-marked in combination with the Instancing technology, and the light pixels covered by the light volume information 11 of the light information in the virtual scene 10 are marked as a first preset value. The light pixels are the pixels covered by the light volume information in the virtual scene. The first preset value can be 1, that is, the template cache information of the light pixels covered by the light volume information 11 in the virtual scene is quickly marked as 1 through the Instancing technology.
[0094] In step 205, the terminal obtains object pixels corresponding to the multidimensional object information in the virtual scene, and marks the illumination pixels that do not intersect with the object pixels as a second preset threshold, so as to uniformly perform template drawing process processing on the lighting information in each lighting group in turn.
[0095] Please continue to read Figure 4As shown, the object pixels corresponding to the virtual scene 10 of the multi-dimensional object information in the virtual scene can be obtained, for example, the object pixels of the house corresponding to the virtual scene 10 are obtained. Since the light requires an actual object as a carrier for display, the lighting pixels that intersect with the object pixels of the house can be marked as a first preset value, and the lighting pixels that do not intersect with the object pixels of the house can be marked as a second preset value. The second preset value can be 0 and needs to be eliminated, that is, the lighting pixels that have no entity displayed in the virtual scene are eliminated to avoid redundant rendering, so as to realize unified template drawing processing of the lighting information in each lighting group in turn.
[0096] In step 206, the terminal sequentially traverses the marks of the light information in each light group after the template drawing process, determines the object pixels marked as the first preset value in each light group, and performs lighting drawing on the object pixels marked as the first preset value in each light group.
[0097] Please also refer to Figure 4 As shown, the labels of the pixels in the illumination volume information of the light information in each light group after the template drawing process are traversed in turn to determine the object pixels marked as the first preset value, that is, marked as 1, in each light group.
[0098] Furthermore, in combination with the Instancing technology, the object pixels marked as the first preset value in each light group are uniformly rendered in color to achieve lighting rendering of the virtual scene.
[0099] As can be seen from the above, the embodiment of the present application obtains the lighting information in the virtual scene, and the lighting information carries the illumination volume information; distributes the lighting information to a preset number of lighting groups; performs template drawing processing on the lighting information in each lighting group to mark the object pixels covered by the illumination volume information of each lighting information with a template; performs color drawing processing on the lighting information in each lighting group after the template drawing processing, and performs illumination drawing on the object pixels marked with the template as the first preset value. In this way, the lighting information is distributed to a preset number of lighting groups, and the lighting information in each lighting group is uniformly subjected to template drawing processing and color drawing processing in a unified manner with the lighting group as a unit, and the object pixels marked with the template as the first preset value are subjected to illumination drawing, which reduces state switching and greatly improves the efficiency of information processing.
[0100] Furthermore, the embodiment of the present application uses groups as units to call the Instancing technology for fast processing in both template drawing processing and color drawing processing, thereby further accelerating the rendering speed and the number of drawcall calls, thereby better improving the efficiency of information processing.
[0101] In order to better implement the information processing method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above information processing method. The meanings of the terms are the same as those in the above information processing method, and the specific implementation details can refer to the description in the method embodiment.
[0102] See also Figure 5 , Figure 5 A schematic diagram of the structure of an information processing device provided in an embodiment of the present application, wherein the information processing device may include an acquisition unit 301, an allocation unit 302, a first processing unit 303, and a second processing unit 304, etc.
[0103] The acquisition unit 301 is used to acquire the lighting information in the virtual scene, where the lighting information carries the lighting volume information.
[0104] The allocating unit 302 is used to allocate the lighting information to a preset number of lighting groups.
[0105] In some implementations, the allocating unit 302 is configured to:
[0106] Obtain coverage data corresponding to the illumination volume information of each light information;
[0107] Calculate the sum of the coverage data of each light information, and add the sum to the expanded coverage data to obtain the target coverage data;
[0108] Calculation is performed based on the target coverage data and the eight groups of quantities to obtain preset coverage data;
[0109] Based on the rule that the sum of the coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data, each lighting information is allocated to the eight lighting groups.
[0110] In some implementations, the allocating unit 302 is configured to:
[0111] Obtain coverage data corresponding to the illumination volume information of each light information;
[0112] Set the preset coverage data for each lighting group;
[0113] Based on the rule that the sum of the coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data, each lighting information is allocated to multiple lighting groups.
[0114] In some implementations, the allocating unit 302 is configured to:
[0115] Obtain coverage data corresponding to the illumination volume information of each light information;
[0116] Light information with overlapping areas between coverage data is allocated to different light groups to obtain multiple light groups.
[0117] In some implementations, the allocating unit 302 is further configured to:
[0118] Obtain coverage data corresponding to the illumination volume information of each light information;
[0119] Each piece of lighting information is allocated to a plurality of lighting groups based on a rule that coverage data of the lighting information allocated to each lighting group do not have overlapping areas.
[0120] The first processing unit 303 is used to perform template drawing processing on the light information in each light group, so as to perform template marking on the object pixels covered by the illumination volume information of each light information.
[0121] In some embodiments, the first processing unit 303 is configured to:
[0122] Performing template marking processing on the light information in each light group in turn, so as to mark the illumination pixels covered by the illumination volume information of each light information as a first preset value;
[0123] Obtain object pixels corresponding to multi-dimensional object information in a virtual scene;
[0124] The illumination pixels that do not intersect with the object pixels are marked as the second preset value, so as to achieve unified template drawing processing for the light information in each light group in turn.
[0125] The second processing unit 304 is used to perform color rendering processing on the light information in each light group after the template rendering processing, and perform lighting rendering on the object pixels marked as the first preset value in the template.
[0126] In some embodiments, the second processing unit 304 is configured to:
[0127] Sequentially traverse the marks of the light information in each light group after the template drawing process, and determine the object pixels in each light group marked as the first preset value;
[0128] Perform lighting rendering on the object pixels marked as the first preset value in each light group.
[0129] The specific implementation of each of the above units can be found in the previous embodiments, which will not be described in detail here.
[0130] As can be seen from the above, the embodiment of the present application obtains the lighting information in the virtual scene through the acquisition unit 301, and the lighting information carries the illumination volume information; the allocation unit 302 allocates the lighting information to a preset number of lighting groups; the first processing unit 303 performs template drawing processing on the lighting information in each lighting group to mark the object pixels covered by the illumination volume information of each lighting information with a template; the second processing unit 304 performs color drawing processing on the lighting information in each lighting group after the template drawing processing, and performs illumination drawing on the object pixels marked with the template as the first preset value. In this way, the lighting information is allocated to the preset number of lighting groups, and the lighting information in each lighting group is uniformly subjected to template drawing processing and color drawing processing in units of light groups, and the object pixels marked with the template as the first preset value are subjected to illumination drawing, which reduces state switching and greatly improves the efficiency of information processing.
[0131] The present application also provides a computer device, which may be a terminal. Figure 6 As shown, it shows a schematic diagram of the structure of the terminal involved in the embodiment of the present application, specifically:
[0132] The terminal may include components such as a radio frequency (RF) circuit 601, a memory 602 including one or more computer-readable storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a wireless fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that Figure 6 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0133] The RF circuit 601 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 608 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 601 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 601 can also communicate with the network and other devices through wireless communication. Wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0134] The memory 602 can be used to store software programs and modules. The processor 608 executes various functional applications and information processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal (such as audio data, a phone book, etc.), etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 with access to the memory 602.
[0135] The input unit 603 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, in a specific embodiment, the input unit 603 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touch pad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 608, and can receive and execute the command sent by the processor 608. In addition, the touch-sensitive surface can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 603 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0136] The display unit 604 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 604 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 608 to determine the type of touch event. The processor 608 then provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 6 In the embodiment, the touch-sensitive surface and the display panel are used as two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize input and output functions.
[0137] The terminal may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and / or backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the terminal, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0138] The audio circuit 606, the speaker, and the microphone can provide an audio interface between the user and the terminal. The audio circuit 606 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 606 and converted into audio data, and then the audio data is processed by the output processor 608 and sent to, for example, another terminal through the RF circuit 601, or the audio data is output to the memory 602 for further processing. The audio circuit 606 may also include an earplug jack to provide communication between an external headset and the terminal.
[0139] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 607. It provides users with wireless broadband Internet access. Figure 6 A WiFi module 607 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as required without changing the essence of the invention.
[0140] The processor 608 is the control center of the terminal. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, it executes various functions of the terminal and processes data, thereby performing overall detection of the mobile phone. Optionally, the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 608.
[0141] The terminal also includes a power supply 609 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 608 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 609 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0142] Although not shown, the terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the processor 608 in the terminal will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 608 will run the applications stored in the memory 602 to implement various functions:
[0143] Acquire lighting information in a virtual scene, the lighting information carrying illumination volume information; distribute the lighting information among a preset number of lighting groups; perform template drawing processing on the lighting information in each lighting group to perform template marking on object pixels covered by the illumination volume information of each lighting information; perform color drawing processing on the lighting information in each lighting group after the template drawing processing, and perform illumination drawing on object pixels marked by the template as a first preset value.
[0144] It should be noted that the terminal provided in the embodiment of the present application and the information processing method applicable to the terminal in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above method embodiment, which will not be repeated here.
[0145] As can be seen from the above, the computer device of the embodiment of the present application can obtain the lighting information in the virtual scene, and the lighting information carries the illumination volume information; distribute the lighting information in a preset number of lighting groups; perform template drawing processing on the lighting information in each lighting group, so as to mark the object pixels covered by the illumination volume information of each lighting information with a template; perform color drawing processing on the lighting information in each lighting group after the template drawing processing, and perform illumination drawing on the object pixels marked with the template as the first preset value. In this way, the lighting information is distributed in a preset number of lighting groups, and the lighting information in each lighting group is uniformly subjected to template drawing processing and color drawing processing in a unified manner with the lighting group as a unit, and the object pixels marked with the template as the first preset value are subjected to illumination drawing, which reduces state switching and greatly improves the efficiency of information processing.
[0146] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0147] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the information processing methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:
[0148] Acquire lighting information in a virtual scene, the lighting information carrying illumination volume information; distribute the lighting information among a preset number of lighting groups; perform template drawing processing on the lighting information in each lighting group to perform template marking on object pixels covered by the illumination volume information of each lighting information; perform color drawing processing on the lighting information in each lighting group after the template drawing processing, and perform illumination drawing on object pixels marked by the template as a first preset value.
[0149] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations provided in the above embodiments.
[0150] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0151] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0152] Since the instructions stored in the computer-readable storage medium can execute the steps in any information processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any information processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0153] The above is a detailed introduction to an information processing method, device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An information processing method, It is characterized in that include: Acquire lighting information in a virtual scene, where the lighting information carries lighting volume information; Distributing the lighting information into a preset number of lighting groups includes: Obtain coverage data corresponding to the illumination volume information of each light information; Allocate the light information with overlapping areas between the coverage data into different light groups to obtain multiple light groups; Or obtain the coverage data corresponding to the illumination volume information of each light information; Calculate the sum of the coverage data of each light information, and add the sum to the expanded coverage data to obtain the target coverage data; Calculate according to the target coverage data and the eight groups of quantities to obtain preset coverage data; Allocate each lighting information to eight lighting groups based on the rule that the sum of coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data; Or obtain the coverage data corresponding to the illumination volume information of each light information; Set the preset coverage data for each lighting group; Allocate each lighting information to a plurality of lighting groups based on a rule that the sum of coverage data of the lighting information allocated to each lighting group does not exceed preset coverage data; Performing unified template drawing processing on the light information in each light group, so as to perform template marking on the object pixels covered by the illumination volume information of each light information; The lighting information in each lighting group after the template drawing process is subjected to unified color drawing process, and the object pixels marked by the template as the first preset value are subjected to lighting drawing.
2. The information processing method according to claim 1, It is characterized in that The step of allocating the light information having overlapping areas between the coverage range data into different light groups to obtain multiple light groups comprises: Each piece of lighting information is allocated to a plurality of lighting groups based on a rule that coverage data of the lighting information allocated to each lighting group do not have overlapping areas.
3. The information processing method according to any one of claims 1 to 2, It is characterized in that The step of performing unified template drawing processing on the light information in each light group to perform template marking on the object pixels covered by the illumination volume information of each light information includes: Performing template marking processing on the light information in each light group in turn, so as to mark the illumination pixels covered by the illumination volume information of each light information as a first preset value; Obtain object pixels corresponding to multi-dimensional object information in a virtual scene; The illumination pixels that do not intersect with the object pixels are marked as second preset values, so as to perform template drawing processing on the lighting information in each lighting group in a unified manner.
4. The information processing method according to any one of claims 1 to 2, It is characterized in that The step of performing uniform color drawing processing on the light information in each light group after the template drawing processing, and performing illumination drawing on the object pixels marked by the template as the first preset value, comprises: Sequentially traverse the marks of the light information in each light group after the template drawing process, and determine the object pixels in each light group marked as the first preset value; Perform lighting rendering on the object pixels marked as the first preset value in each light group.
5. An information processing device, It is characterized in that include: An acquisition unit, used to acquire light information in a virtual scene, wherein the light information carries illumination volume information; A distribution unit, used to distribute the lighting information into a preset number of lighting groups, comprising: Obtain coverage data corresponding to the illumination volume information of each light information; Allocate the light information with overlapping areas between the coverage data into different light groups to obtain multiple light groups; Or obtain the coverage data corresponding to the illumination volume information of each light information; Calculate the sum of the coverage data of each light information, and add the sum to the expanded coverage data to obtain the target coverage data; Calculate according to the target coverage data and the eight groups of quantities to obtain preset coverage data; Allocate each lighting information to eight lighting groups based on the rule that the sum of coverage data of the lighting information allocated in each lighting group does not exceed the preset coverage data; Or obtain the coverage data corresponding to the illumination volume information of each light information; Set the preset coverage data for each lighting group; Allocate each lighting information to a plurality of lighting groups based on a rule that the sum of coverage data of the lighting information allocated to each lighting group does not exceed preset coverage data; A first processing unit is used to perform a unified template drawing process on the light information in each light group, so as to perform template marking on the object pixels covered by the illumination volume information of each light information; The second processing unit is used to perform unified color drawing processing on the light information in each light group after the template drawing processing, and perform lighting drawing on the object pixels marked by the template as the first preset value.
6. The information processing device according to claim 5, It is characterized in that The allocation unit is further used for: Obtain coverage data corresponding to the illumination volume information of each light information; Each piece of lighting information is allocated to a plurality of lighting groups based on a rule that coverage data of the lighting information allocated to each lighting group do not have overlapping areas.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the information processing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration
CN102254340A
Image processing method, image processing device and computer equipment
CN104134230A
Method of carrying out illumination coloring on pixel by using light index number
CN104392479A
Virtual light source processing method and device, medium and electronic equipment
CN111260766A
Illumination rendering method and device, computer readable medium and electronic equipment
CN111915712A
