Rendering Method, Device, Computing Device and Computer Storage Medium of Virtual Model
By blurring and halo enhancement of the self-luminous area in the rendering results of the virtual model, the problems of large rendering workload and poor performance caused by traditional bloomblur technology are solved, and efficient rendering performance and good visual effect are achieved.
Patent Information
- Application Number
- CN202310769154.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2043-06-27
AI Technical Summary
Traditional bloomblur technology leads to a large rendering workload during HDR rendering, resulting in poor performance of rendering equipment, especially on mobile devices, which seriously affects the GPU performance and battery life of rendering equipment.
By obtaining the first rendering result of the virtual model, determining the self-luminous area, performing blur processing and halo enhancement, generating the second rendering result, reducing the rendering workload and improving rendering performance.
This method not only ensures the rendering effect of the virtual model, but also balances the rendering performance by reducing the rendering workload, especially on mobile devices, which significantly improves GPU performance and battery life.
Smart Images

Figure CN116778064B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technologies, and in particular, to a method, apparatus, computing device, and computer storage medium for rendering a virtual model. Background Art
[0002] Bloom (sometimes referred to as bloom or glow) is a computer graphics effect used in video games, demonstrations, and high dynamic range (HDR) rendering to reproduce the imaging artifacts of a real-world camera. The streaks (or feathers) produced by this effect extend from the edges of bright areas into the image, creating an illusion of intense light that the camera or eye cannot capture in the scene. The bloomblur technology is an extension of the Bloom technology, mainly a technology that can perform overall blurring on the high-light part during rendering and then overlay it with the original image.
[0003] However, when the traditional bloomblur technology performs HDR rendering, it is necessary to blur all the high-light parts and then overlay them with the original image. Such a process (such as high-light judgment, high-light extraction, and re-drawing) is likely to cause problems such as a large rendering workload and excessive resource consumption of the rendering device. Especially when the rendering device is a mobile device, when rendering based on physically-based rendering (PBR), it will seriously affect the rendering performance of the rendering device, and further affect the GPU performance and battery life of the rendering device. Summary of the Invention
[0004] Embodiments of the present application provide a method, apparatus, computing device, and computer storage medium for rendering a virtual model, so as to solve the problem of large rendering workload and poor performance of the rendering device in the prior art.
[0005] In a first aspect, a method for rendering a virtual model provided in an embodiment of the present application includes:
[0006] Obtaining a first rendering result of the virtual model, where the first rendering result is a result of rendering the virtual model in advance according to multiple model textures;
[0007] Determining a self-luminous area of the virtual model from the first rendering result;
[0008] Performing blurring processing on the self-luminous area to obtain a first processing result, where the first processing result is the self-luminous area after blurring processing;
[0009] Enhancing the halo intensity of the first processing result to obtain a second processing result, where the second processing result is the first processing result after enhancing the halo intensity;
[0010] Render and generate a second rendering result of the virtual model according to the second processing result.
[0011] Optionally, determining the self-luminous area of the virtual model from the first rendering result includes:
[0012] Obtain the feature information corresponding to each model area in the virtual model; wherein, each model area is rendered and generated by at least one model texture, and the feature information is the texture information of the model texture, and the texture information includes annotation information, material information or functional information;
[0013] Determine the self-luminous area from multiple model areas according to the feature information corresponding to each model area in the virtual model.
[0014] Optionally, performing blurring processing on the self-luminous area to obtain a first processing result includes:
[0015] Determine the device type of the rendering device, and different device types correspond to different filtering and blurring algorithms, and the rendering device is used to display the rendering result of the virtual model;
[0016] Determine the corresponding filtering and blurring algorithm according to the device type;
[0017] Perform blurring processing on the self-luminous area through the filtering and blurring algorithm to obtain a first processing result.
[0018] Optionally, performing blurring processing on the self-luminous area through the filtering and blurring algorithm to obtain a first processing result includes:
[0019] Render the self-luminous area to an intermediate texture with low resolution, and perform blurring processing on the intermediate texture with low resolution through the filtering and blurring algorithm to obtain a first processing result, and the first processing result is the intermediate texture with low resolution after blurring processing.
[0020] Optionally, enhancing the halo intensity of the first processing result to obtain a second processing result includes:
[0021] Enhance the halo intensity of the first processing result, and render the first processing result to a target texture with high resolution to obtain a second processing result.
[0022] Optionally, before performing blurring processing on the self-luminous area to obtain a first processing result, it further includes:
[0023] Render the self-luminous areas with an occlusion relationship to a two-dimensional texture through a three-dimensional depth detection algorithm, and the occlusion relationship means that when the virtual model changes in angle, the self-luminous areas are occluded;
[0024] Performing blurring processing on the self-luminous region to obtain a first processing result includes:
[0025] In the two-dimensional space coordinate system corresponding to the two-dimensional texture, determining the coordinate information of the self-luminous region;
[0026] According to the coordinate information, performing blurring processing on the self-luminous region to obtain a first processing result.
[0027] Optionally, the device types include: low-end devices, mid-end devices, and high-end devices; the different filtering and blurring algorithms corresponding to different device types include: the filtering and blurring algorithm corresponding to low-end devices is 5x5 filtering, the filtering and blurring algorithm corresponding to mid-end devices is 9x9 filtering, and the filtering and blurring algorithm corresponding to high-end devices is to first use 9x9 filtering and then use 5x5 filtering;
[0028] After determining the device type of the rendering device, it further includes:
[0029] Real-time detecting the rendering frame rate of the rendering device;
[0030] If the rendering frame rate is less than the set frame rate, setting the filtering and blurring algorithm corresponding to the rendering device to 5x5 filtering;
[0031] If the rendering frame rate is greater than the set frame rate, continue to execute the step of determining the corresponding filtering and blurring algorithm according to the device type.
[0032] In a second aspect, an embodiment of the present application provides a rendering device for a virtual model, including:
[0033] An acquisition module, configured to acquire a first rendering result of the virtual model, where the first rendering result is a result of rendering the virtual model in advance according to multiple model textures;
[0034] A determination module, configured to determine the self-luminous region of the virtual model from the first rendering result;
[0035] A processing module, configured to perform blurring processing on the self-luminous region to obtain a first processing result, where the first processing result is the self-luminous region after blurring processing; enhancing the halo intensity of the first processing result to obtain a second processing result, where the second processing result is the first processing result after enhancing the halo intensity;
[0036] A rendering model, configured to render and generate a second rendering result of the virtual model according to the second processing result.
[0037] In a third aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the method for rendering a virtual model as described in the first aspect above.
[0038] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, which when executed by a computer, implements the method for rendering a virtual model as described in the first aspect above
[0039] The functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0040] In an embodiment of the present application, a first rendering result of a virtual model is obtained; a self-luminous area of the virtual model is determined from the first rendering result; the self-luminous area is blurred to obtain a first processing result, where the first processing result is the blurred self-luminous area; the halo intensity of the first processing result is enhanced to obtain a second processing result, where the second processing result is the first processing result with enhanced halo intensity; and a second rendering result of the virtual model is rendered based on the second processing result. The technical solution provided by the embodiment of the present application can not only ensure the rendering effect of the virtual model by blurring the self-luminous area in the rendering result of the virtual model and enhancing the halo, but also balance the rendering performance by reducing the rendering workload.
[0041] These aspects or other aspects of the present application will be more clearly understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 The flowchart of an embodiment of a method for rendering a virtual model provided by the present application is shown;
[0044] Figure 2 The flowchart of another embodiment of a method for rendering a virtual model provided by the present application is shown;
[0045] Figure 3 The schematic diagram of the rendering effect of a virtual model provided by the present application is shown;
[0046] Figure 4 The figure shows a schematic structural diagram of an embodiment of a rendering device for a virtual model provided by the present application;
[0047] Figure 5 The figure shows a schematic structural diagram of a computing device provided by the present application. Specific embodiments
[0048] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
[0049] In some processes described in the specification, claims and the above-mentioned drawings of the present application, a plurality of operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear herein or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.
[0050] The technical solution of the embodiment of the present application is applicable to scenarios where the self-luminous area of a virtual model (such as a virtual character, etc.) is separately blurred and a halo is added.
[0051] During the research process of the present application, it is found that in the current traditional bloomblur technology, when performing HDR rendering on a virtual model, usually before generating the virtual model, the brightness values of the model textures are first judged. When it is determined that the brightness value of any model texture exceeds the set threshold, it is considered that these model textures belong to high-light textures. Further, after all the high-light textures are blurred, the virtual model is rendered and generated. However, in this way, due to the large rendering workload, it is easy to cause the problem of excessive resource consumption of the rendering device. Especially for a rendering device that is a mobile device, it will affect the rendering performance, GPU performance and battery life of the mobile device.
[0052] Therefore, to solve the above problems, the embodiment of the present application provides a rendering method for a virtual model, which is mainly used to enhance the rendering effect and visual perception of the self-luminous area of the virtual model by determining the self-luminous area of the virtual model and blurring and enhancing the halo of the self-luminous area.
[0053] The method specifically includes: obtaining a first rendering result of a virtual model, where the first rendering result is the result of rendering the virtual model in advance according to multiple model textures; determining a self-luminous area of the virtual model from the first rendering result; performing blurring processing on the self-luminous area to obtain a first processing result, where the first processing result is the self-luminous area after blurring processing; enhancing the halo intensity of the first processing result to obtain a second processing result, where the second processing result is the first processing result after enhancing the halo intensity; and rendering and generating a second rendering result of the virtual model according to the second processing result. By performing blurring processing and halo enhancement on the self-luminous area in the rendering result of the virtual model, not only can the rendering effect of the virtual model be ensured, but also the rendering workload can be reduced, thereby ensuring the balance of rendering performance.
[0054] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0055] Figure 1 It is a flowchart of an embodiment of a rendering method for a virtual model provided by an embodiment of the present application. As Figure 1 shown, this method is applied to a rendering device, where the rendering device may include but is not limited to mobile devices, and the mobile devices include but are not limited to mobile phones, tablet computers, laptop computers, smart watches, and smart glasses.
[0056] This method includes:
[0057] 101. Obtain a first rendering result of the virtual model;
[0058] In this step, the virtual model can be displayed on the rendering device, and the virtual model may include but is not limited to virtual characters, virtual animals, and virtual items. The first rendering result is the result of rendering the virtual model in advance according to multiple model textures.
[0059] In the embodiments of the present application, the user can select model textures according to needs and render and generate a virtual model according to multiple model textures to obtain a first rendering result of the virtual model. For example, taking the virtual model including a virtual character as an example, the user can select the clothing texture, accessory texture, etc. of the virtual character according to needs and generate the virtual character according to these model textures.
[0060] It should be noted that the virtual model is an initial model without self-luminous area blurring processing and halo enhancement. Compared with the existing solutions, the present application does not need to perform processes such as judging the brightness value of the model texture and preprocessing the specular texture before generating the model. Instead, after generating the virtual model, the self-luminous area is selected from the rendering result of the virtual model, and the self-luminous area is separately blurred and the halo is enhanced to form a new rendering result of the virtual model. Therefore, the present application can not only reduce the rendering workload, but also ensure the rendering effect of the virtual model and the performance of the rendering device.
[0061] 102. Determine the self-luminous area of the virtual model from the first rendering result;
[0062] In the embodiment of the present application, the generated virtual model may include multiple model areas, and each model area is rendered by at least one model texture. The self-luminous area can be determined from the multiple model areas according to the set rules, so as to separately perform blurring processing and halo enhancement on the self-luminous area subsequently.
[0063] Among them, the set rules may include but are not limited to: whether the texture information of the model texture corresponding to the model area meets the preset information, where the texture information may include annotation information, material information or function information.
[0064] For example, taking the texture information including annotation information as an example, by judging whether the annotation information of the model texture corresponding to the model area meets the annotation information of the preset self-luminous area, if so, the self-luminous area is determined from the multiple model areas. Optionally, before generating the virtual model according to multiple model textures, the user can identify each model texture, for example, make special marks for the model textures that can emit light (such as light bulb textures, star textures, etc.).
[0065] For example, taking the texture information including material information as an example, by judging whether the material information of the model texture corresponding to the model area meets the material information of the preset self-luminous area, if so, the self-luminous area is determined from the multiple model areas. Optionally, before generating the virtual model according to multiple model textures, the user can preset the material corresponding to each model texture (such as metal material, plastic material, etc.), and set the material information of the self-luminous area to be a metal material.
[0066] For example, taking the texture information including functional information as an example, by determining whether the functional information of the model texture corresponding to the model area meets the functional information of the preset self-luminous area, if so, the self-luminous area is determined from multiple model areas. Optionally, before generating a virtual model based on multiple model textures, the user can preset the function corresponding to each model texture in advance (for example, if a model texture is a light bulb on a virtual tree, set that the model texture has a lighting function; if a model texture is a skin texture of a virtual character, set that the model texture does not have a lighting function), and set the functional information of the self-luminous area to be a lighting function.
[0067] It should be noted that in addition to determining the self-luminous area in the above manner, it can also be determined according to other methods, which can be specifically set according to requirements, and the present application does not limit this.
[0068] 103. Blur the self-luminous area to obtain a first processing result.
[0069] In this step, the first processing result is the self-luminous area after blurring. Among them, the first processing result can be understood as an intermediate processing result, not the final rendering result.
[0070] In the embodiments of the present application, the blurring method may include but is not limited to using a Gaussian blur algorithm or stretching processing, etc. By blurring the self-luminous area, the details and noise of the self-luminous area can be reduced, the calculation amount can be reduced, and the rendering efficiency can be improved.
[0071] Furthermore, after the self-luminous area is blurred, a softer halo effect can be produced, making the entire scene more natural and comfortable, and enhancing the visual effect. In addition, the blurring process can be implemented on low-end devices without the support of high-performance hardware, thereby reducing the hardware requirements and improving the compatibility and versatility of the model device.
[0072] 104. Enhance the halo intensity of the first processing result to obtain a second processing result;
[0073] In this step, the second processing result is the first processing result with enhanced halo intensity. Among them, the enhanced halo intensity can be set according to requirements. For example, when the default value of the halo intensity of the first processing result is 1 and the slider range of the halo intensity is 0-5, the halo intensity of the first processing result can be adjusted to the value of 3.
[0074] 105. Render and generate a second rendering result of the virtual model according to the second processing result.
[0075] In this step, the second rendering result can be understood as the final rendering effect of the virtual model displayed on the rendering device.
[0076] In an embodiment of the present application, the original self-luminous area of the virtual model is re-rendered according to the second processing result to generate a second rendering result of the virtual model. Compared with the first rendering result, the second rendering result realizes the blurring process and halo enhancement of the self-luminous area in the virtual model, thereby ensuring the rendering effect of the virtual model.
[0077] Figure 2 It is a flowchart of another embodiment of a rendering method for a virtual model provided by an embodiment of the present application. As Figure 2 shown, the method includes:
[0078] 201. Obtain the first rendering result of the virtual model.
[0079] 202. Determine the self-luminous area of the virtual model from the first rendering result.
[0080] In an embodiment of the present application, as a possible implementation, step 202 may include:
[0081] 2021. Obtain the feature information corresponding to each model area in the virtual model;
[0082] In this step, each model area is rendered by at least one model texture, and the feature information is the texture information of the model texture, and the texture information includes annotation information, material information or function information;
[0083] 2022. Determine the self-luminous area from multiple model areas according to the feature information corresponding to each model area in the virtual model.
[0084] In an embodiment of the present application, step 2022 may include: determining the self-luminous area from multiple model areas by determining whether the annotation information of the model texture corresponding to the model area meets the annotation information of the preset self-luminous area; or determining the self-luminous area from multiple model areas by determining whether the material information of the model texture corresponding to the model area meets the material information of the preset self-luminous area; or determining the self-luminous area from multiple model areas by determining whether the function information of the model texture corresponding to the model area meets the function information of the preset self-luminous area.
[0085] For the determination process, reference may be made to step 102 of the above embodiment, and details will not be repeated in this embodiment of the present application.
[0086] 203. Determine the device type of the rendering device, and different device types correspond to different filtering and blurring algorithms.
[0087] In this step, the rendering device is used to display the rendering result of the virtual model. The device types include: low - configuration devices, medium - configuration devices, and high - configuration devices; the different filtering and blurring algorithms corresponding to different device types are as follows: the filtering and blurring algorithm corresponding to low - configuration devices is 5x5 filtering, the filtering and blurring algorithm corresponding to medium - configuration devices is 9x9 filtering, and the filtering and blurring algorithm corresponding to high - configuration devices is to first use 9x9 filtering and then use 5x5 filtering to enhance the blurring effect of the self - luminous area.
[0088] In an embodiment of the present application, optionally, the device type can be determined according to the hardware configuration and performance of the rendering device (such as factors like CPU, GPU, memory, storage, display, etc.).
[0089] For example, the CPU is the core component of a computer and has a great impact on the overall performance of the system. Generally speaking, high - configuration devices have a higher CPU main frequency, more cores, and better performance. The GPU is the graphics processing unit of a computer and has a great impact on graphics rendering and game performance. High - configuration devices have a large GPU video memory and more cores, resulting in better performance. Memory is an important part of a computer and has a great impact on multi - tasking and running large programs. High - configuration devices have a large memory capacity, fast running speed, and can better support the operation of complex application programs. Storage is an important part of computer data storage and has a very large impact on system startup and file reading and writing. High - configuration devices have a large storage capacity and fast reading and writing speed. The display has a great impact on image quality and viewing experience. High - configuration devices have a high display resolution, vivid colors, and high refresh rate, which can provide a better visual experience.
[0090] 204. Determine the corresponding filtering and blurring algorithm according to the device type;
[0091] It should be noted that in addition to determining the corresponding filtering and blurring algorithm according to the device type, the rendering frame rate of the rendering device also needs to be considered. For example, the same rendering device can select different filtering and blurring algorithms at different rendering frame rates.
[0092] Specifically, this solution includes: real - time detecting the rendering frame rate of the rendering device; if the rendering frame rate is less than the set frame rate, setting the filtering and blurring algorithm corresponding to the rendering device to 5x5 filtering; if the rendering frame rate is greater than the set frame rate, continue to execute step 204.
[0093] In the above steps, by real - time counting the rendering frame rate of the rendering device and performing filtering processing according to the device performance, better performance and effects can be ensured on different devices. This process can automatically adjust the filter size to adapt to the device performance and screen resolution.
[0094] 205. Through the filtering and blurring algorithm, blur the self-luminous area to obtain a first processing result.
[0095] In an embodiment of the present application, as a possible implementation, step 205 may specifically include: rendering the self-luminous area to an intermediate texture with a low resolution, and blurring the intermediate texture with a low resolution through the filtering and blurring algorithm to obtain a first processing result.
[0096] In this step, the first processing result at this time is the intermediate texture with a low resolution after blurring. The intermediate texture refers to the texture used to store intermediate results during the image processing process, usually used to store some image data that needs to be processed multiple times, such as blurred textures, depth textures, etc. By using intermediate textures for image processing, the calculation amount can be reduced, the rendering performance can be improved, and at the same time, the separation and debugging of multiple processing steps can be conveniently carried out. In the halo effect, the intermediate texture is usually used to store the self-luminous area with a low resolution and the Gaussian blurred texture. By shrinking the self-luminous image to a low resolution, the calculation amount can be reduced and the rendering performance can be improved.
[0097] 206. Enhance the halo intensity of the first processing result, and render the first processing result to a target texture with a high resolution to obtain a second processing result.
[0098] In an embodiment of the present application, after rendering the first processing result to an intermediate texture with a low resolution first, then render the first processing result with enhanced halo intensity to a target texture with a high resolution, so that the rendering performance can be further improved during the two scaling processes (rendering to the intermediate texture with a low resolution is one scaling, and rendering to the target texture with a high resolution is one scaling).
[0099] Further, before step 205, it further includes: rendering the self-luminous areas with an occlusion relationship to a two-dimensional texture through a three-dimensional depth detection algorithm.
[0100] In this step, the occlusion relationship refers to the situation where the self-luminous area is occluded when the virtual model changes its angle (there is an occlusion relationship in the distance between the camera and the overlapping parts of multiple triangles, such as a front-facing portrait, the front of the clothes, the back of the clothes, and there is an occlusion relationship between the two).
[0101] In the embodiments of the present application, considering that the rendered virtual model is a 3D model, the self-luminous area is a 3D area. Therefore, it is necessary to consider the occlusion relationship of the self-luminous area to avoid problems with poor rendering effects caused by enhancing the halo of the 3D area. Therefore, it is necessary to use a three-dimensional depth detection algorithm to render the self-luminous areas with occlusion relationships to a two-dimensional texture. The occlusion relationship refers to the situation where the self-luminous area is occluded when the virtual model changes its angle. Then, subsequent blur processing and halo enhancement are performed on the two-dimensional texture.
[0102] For example, as Figure 3 shown, taking the virtual model including a virtual character as an example, where the self-luminous area may include "accessory 1" worn around the neck of the virtual character, "accessory 2" on the arm, and "accessory 3" on the leg. By analyzing the occlusion relationships of each of the accessories 1 to 3, it can be determined that there are occlusion relationships for accessories 1 to 3, that is, when the virtual character rotates to certain angles, accessories 1 to 3 are occluded by other textures. For example, "accessory 3" is occluded by the leg clothing texture on the back when the virtual character rotates to the back. Therefore, it is necessary to fully consider the occlusion relationships of each self-luminous area. If the occlusion relationships are not considered, it may cause the problem of poor rendering effects of the virtual character due to light transmission when the self-luminous area is occluded.
[0103] Based on the above solution, as another possible implementation, step 205 may include: determining the coordinate information of the self-luminous area in the two-dimensional space coordinate system corresponding to the two-dimensional texture; and performing blur processing on the self-luminous area according to the coordinate information to obtain a first processing result.
[0104] Further, in the two-dimensional space coordinate system, a pow operation is taken once, and the glow strength of the first processing result is adjusted using the glowstrength parameter, where the glowstrength parameter refers to the halo strength parameter. Further, the first processing result is drawn to the target texture with high resolution using the glDrawArrays function or the glDrawElements function to enhance the halo strength of the self-luminous area.
[0105] 207. Render and generate a second rendering result of the virtual model according to the second processing result.
[0106] Figure 4 is a schematic structural diagram of an embodiment of a rendering device for a virtual model provided by an embodiment of the present application. As Figure 4 shown, the device includes:
[0107] An acquisition module 41, configured to acquire a first rendering result of a virtual model, where the first rendering result is a result of rendering and generating the virtual model in advance according to a plurality of model textures;
[0108] A determination module 42, configured to determine a self-luminous area of the virtual model from the first rendering result;
[0109] A processing module 43, configured to perform blurring processing on the self-luminous area to obtain a first processing result, where the first processing result is the self-luminous area after blurring processing; enhance a halo intensity of the first processing result to obtain a second processing result, where the second processing result is the first processing result after enhancing the halo intensity;
[0110] A rendering model 44, configured to render and generate a second rendering result of the virtual model according to the second processing result.
[0111] In an embodiment of the present application, optionally, the determination module 42 is specifically configured to obtain feature information corresponding to each model area in the virtual model; wherein, each model area is rendered and generated by at least one model texture, and the feature information is texture information of the model texture, and the texture information includes annotation information, material information or function information; determine a self-luminous area from multiple model areas according to the feature information corresponding to each model area in the virtual model.
[0112] In an embodiment of the present application, optionally, the processing module 43 is specifically configured to determine a device type of a rendering device, different device types correspond to different filtering and blurring algorithms, and the rendering device is used to display a rendering result of the virtual model; determine a corresponding filtering and blurring algorithm according to the device type; perform blurring processing on the self-luminous area through the filtering and blurring algorithm to obtain a first processing result.
[0113] In an embodiment of the present application, optionally, the processing module 43 is specifically configured to render the self-luminous area to an intermediate texture with a low resolution, and perform blurring processing on the intermediate texture with the low resolution through the filtering and blurring algorithm to obtain a first processing result, where the first processing result is the intermediate texture with the low resolution after blurring processing.
[0114] In an embodiment of the present application, optionally, the processing module 43 is specifically configured to enhance a halo intensity of the first processing result, and render the first processing result to a destination texture with a high resolution to obtain a second processing result.
[0115] In an embodiment of the present application, optionally, the processing module 43 is further configured to render a self-luminous area with an occlusion relationship to a two-dimensional texture through a three-dimensional depth detection algorithm, where the occlusion relationship means that when the virtual model changes in angle, the self-luminous area is occluded; determine coordinate information of the self-luminous area in a two-dimensional space coordinate system corresponding to the two-dimensional texture; perform blurring processing on the self-luminous area according to the coordinate information to obtain a first processing result.
[0116] In an embodiment of the present application, optionally, the device types include: low - configuration devices, medium - configuration devices, and high - configuration devices; the different filtering and blurring algorithms corresponding to different device types are as follows: the filtering and blurring algorithm corresponding to a low - configuration device is 5x5 filtering, the filtering and blurring algorithm corresponding to a medium - configuration device is 9x9 filtering, and the filtering and blurring algorithm corresponding to a high - configuration device is first 9x9 filtering and then 5x5 filtering;
[0117] The device further includes a detection module 45;
[0118] The detection module 45 is used to detect the rendering frame rate of the rendering device in real - time; if the detection module 45 detects that the rendering frame rate is less than the set frame rate, the processing module 43 is further used to set the filtering and blurring algorithm corresponding to the rendering device to 5x5 filtering; if the detection module 45 detects that the rendering frame rate is greater than the set frame rate, the processing module 43 is further used to determine the corresponding filtering and blurring algorithm according to the device type.
[0119] Figure 4 The rendering device of the virtual model can execute Figure 2 the rendering method of the virtual model described in the illustrated embodiment. Its implementation principle and technical effects will not be elaborated. For the rendering device of the virtual model in the above - mentioned embodiment, the specific ways in which each module and unit perform operations have been described in detail in the embodiment related to the method, and will not be elaborated here.
[0120] In a possible design, Figure 4 the rendering device of the virtual model in the illustrated embodiment can be implemented as a computing device, as Figure 5 shown. The computing device can include a storage component 501 and a processing component 502;
[0121] The storage component 501 stores one or more computer instructions, where the one or more computer instructions are called and executed by the processing component.
[0122] The processing component 502 is used to: obtain the first rendering result of the virtual model; determine the self - luminous area of the virtual model from the first rendering result; perform blurring processing on the self - luminous area to obtain a first processing result, where the first processing result is the blurred self - luminous area; enhance the halo intensity of the first processing result to obtain a second processing result, where the second processing result is the first processing result with enhanced halo intensity; render and generate a second rendering result of the virtual model according to the second processing result.
[0123] Among them, the processing component 502 may include one or more processors to execute computer instructions to complete all or part of the steps in the above methods. Of course, the processing component may also be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for executing the above methods.
[0124] The storage component 501 is configured to store various types of data to support the operation of the terminal. The storage component may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0125] The display component 503 may be an electroluminescent (EL) element, a liquid crystal display or a micro display with a similar structure, or a retina direct display or a similar laser scanning display.
[0126] Of course, the computing device may also necessarily include other components, such as input / output interfaces, communication components, etc.
[0127] The input / output interface provides an interface between the processing component and the peripheral interface module, and the above peripheral interface module may be an output device, an input device, etc.
[0128] The communication component is configured to facilitate communication between the computing device and other devices in a wired or wireless manner, etc.
[0129] Among them, the computing device may be a physical device or an elastic computing host provided by a cloud computing platform, etc. At this time, the computing device may refer to a cloud server, and the above processing component, storage component, etc. may be basic server resources leased or purchased from the cloud computing platform.
[0130] The embodiment of the present application also provides a computer storage medium storing a computer program, and when the computer program is executed by a computer, it can implement the above Figure 2 rendering method of the virtual model shown in the embodiment.
[0131] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0132] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0133] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present application.
Claims
1. A rendering method for a virtual model, characterized in that, Including: Obtain a first rendering result of a virtual model, where the first rendering result is a result of rendering the virtual model in advance according to multiple model textures; Determine a self-luminous area of the virtual model from the first rendering result; Blur the self-luminous area to obtain a first processing result, including: rendering the self-luminous area to an intermediate texture with low resolution, and blurring the intermediate texture with low resolution through a filtering blur algorithm to obtain a first processing result, where the first processing result is the blurred intermediate texture with low resolution; the filtering blur algorithm is a filtering blur algorithm corresponding to the device type of the rendering device; Enhance the halo intensity of the first processing result and render the first processing result to a destination texture with high resolution to obtain a second processing result, where the second processing result is the first processing result with enhanced halo intensity; Render and generate a second rendering result of the virtual model according to the second processing result.
2. The method according to claim 1, characterized in that, The determining the self-luminous area of the virtual model from the first rendering result includes: Obtain feature information corresponding to each model area in the virtual model; where each model area is rendered and generated by at least one model texture, and the feature information is the texture information of the model texture, and the texture information includes annotation information, material information or functional information; Determine the self-luminous area from multiple model areas according to the feature information corresponding to each model area in the virtual model.
3. The method according to claim 1, characterized in that, Before blurring the self-luminous area to obtain a first processing result, it further includes: Determine the device type of the rendering device, and different device types correspond to different filtering blur algorithms, where the rendering device is used to display the rendering result of the virtual model; Determine the corresponding filtering blur algorithm according to the device type.
4. The method according to claim 1, characterized in that, Before blurring the self-luminous area to obtain a first processing result, it further includes: Through a three-dimensional depth detection algorithm, render the self-luminous areas with an occlusion relationship to a two-dimensional texture, where the occlusion relationship means that when the virtual model changes its angle, the self-luminous areas are occluded; The blurring the self-luminous area to obtain a first processing result includes: In the two-dimensional space coordinate system corresponding to the two-dimensional texture, determine the coordinate information of the self-luminous area; Blur the self-luminous area according to the coordinate information to obtain a first processing result.
5. The method according to claim 3, characterized in that, The device types include: low-end devices, mid-range devices, high-end devices; the different device types corresponding to different filtering blur algorithms include: the filtering blur algorithm corresponding to low-end devices is 5x5 filtering, the filtering blur algorithm corresponding to mid-range devices is 9x9 filtering, and the filtering blur algorithm corresponding to high-end devices is to first use 9x9 filtering and then use 5x5 filtering; After determining the device type of the rendering device, it further includes: Real-time detect the rendering frame rate of the rendering device; If the rendering frame rate is less than the set frame rate, set the filtering blur algorithm corresponding to the rendering device to 5x5 filtering; If the rendering frame rate is greater than the set frame rate, continue to execute the step of determining the corresponding filtering blur algorithm according to the device type.
6. A rendering device for a virtual model, characterized in that, It includes: An acquisition module, configured to acquire a first rendering result of a virtual model, where the first rendering result is a result of rendering a virtual model in advance according to multiple model textures; A determination module, configured to determine the self-luminous area of the virtual model from the first rendering result; A processing module, configured to perform blur processing on the self-luminous area to obtain a first processing result, including: rendering the self-luminous area to an intermediate texture with a low resolution, and performing blur processing on the intermediate texture with the low resolution through a filtering blur algorithm to obtain a first processing result, where the first processing result is the intermediate texture with the low resolution after blur processing; the filtering blur algorithm is a filtering blur algorithm corresponding to the device type of the rendering device; enhancing the halo intensity of the first processing result, and rendering the first processing result to a destination texture with a high resolution to obtain a second processing result, where the second processing result is the first processing result after enhancing the halo intensity; A rendering model, configured to render and generate a second rendering result of the virtual model according to the second processing result.
7. A computing device, characterized in that, It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the rendering method of the virtual model according to any one of claims 1 to 5.
8. A computer storage medium, characterized in that, A computer program is stored, and when the computer program is executed by a computer, it implements the rendering method of the virtual model according to any one of claims 1 to 5.
Citation Information
Patent Citations
Rendering method and device for realizing local Bloom effect
CN114359466A
Floodlight processing method and device for game picture, electronic equipment and storage medium
CN116703778A