Rendering method and device based on ray tracing and rasterization, equipment and medium

By segmenting the initial three-dimensional scene into multiple subscenes and selecting the most suitable rendering method for each subscene, the contradiction between rendering effect and speed in offline image rendering is solved, and efficient and high-quality rendering effects are achieved.

CN119648881APending Publication Date: 2025-03-18SHENZHEN RENDERBUS TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411553108.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art is difficult to take into account both the rendering effect and the rendering speed in offline image rendering, and rasterized rendering is difficult to achieve realistic lighting effects, while the ray tracing rendering speed is slow, which is not suitable for tasks of fast iteration.

Method used

By segmenting the initial three-dimensional scene into multiple subscenes and determining the preferred rendering method (such as ray tracing or rasterization) for each subscene, the rendering efficiency is improved and a higher quality rendering sub-image is generated.

Benefits of technology

It achieves the realism and efficiency of offline rendering of images, quickly generate high-quality rendered images, and improves the user's visual effect experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648881A_ABST
    Figure CN119648881A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a rendering method and device based on ray tracing and rasterization, equipment and a medium, and the method comprises the steps: segmenting an initial three-dimensional scene based on a scene segmentation model and local rendering parameters of the initial three-dimensional scene, generating three-dimensional sub-scenes and determining an optimal rendering mode corresponding to each three-dimensional sub-scene; performing image rendering on each three-dimensional sub-scene through a preferred rendering mode to generate a rendered sub-image; and performing image synthesis processing on each rendering sub-image to generate a target rendering image. According to the method, the initial three-dimensional scene is divided into the plurality of sub-scenes, and the optimal rendering mode is determined for each sub-scene, so that the rendering efficiency is improved. By adopting the rendering mode most suitable for the characteristics of each sub-scene, the rendering sub-image with higher quality can be generated, the rendering image with high quality can be quickly generated, and the visual effect experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a rendering method, device, equipment and medium based on ray tracing and rasterization. Background Art

[0002] In the field of computer graphics, offline rendering technology is a key technology for generating realistic and high-quality images. Offline rendering usually refers to the generation of images in a non-real-time environment by pre-calculation, which allows the use of complex algorithms and computing resources to achieve high-quality visual effects. However, traditional offline rendering methods often face the contradiction between rendering effect and rendering speed. Rasterization rendering algorithm, as a mainstream technology in offline rendering, is known for its ability to quickly process geometric and texture information. This technology converts three-dimensional geometric models into two-dimensional pixel images and uses graphics pipeline stages such as vertex shaders and fragment shaders to achieve fast rendering of models. However, rasterization rendering has limitations in global illumination and shadow calculation because it mainly relies on pre-calculated light maps and simple shadow algorithms, which limits the realism and accuracy of the rendering results.

[0003] The ray tracing algorithm is a physically based rendering technology that can provide high-quality global illumination effects by simulating the propagation path of light in the scene to calculate the interaction between light and objects. This method can generate realistic shadows, reflections, and refractions, thereby improving the realism of the rendering results. However, ray tracing has a high computational complexity and requires a lot of calculations for each ray, resulting in slow rendering speed, especially when dealing with complex scenes.

[0004] Although rasterization rendering and ray tracing each have their own advantages, they both have certain limitations in practical applications. Although rasterization rendering is fast, it is difficult to achieve realistic lighting effects; while ray tracing can provide high-quality lighting effects, it is slow and not suitable for offline rendering tasks that require rapid iteration. Therefore, how to improve the authenticity and efficiency of offline image rendering and thus improve the user's visual experience has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a rendering method, apparatus, device and medium based on ray tracing and rasterization, which improves the realism and efficiency of offline image rendering, thereby improving the user's visual experience.

[0006] In a first aspect, the present application provides a rendering method based on ray tracing and rasterization, the method comprising:

[0007] Based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, the initial three-dimensional scene is segmented to generate at least one three-dimensional sub-scene and a preferred rendering mode corresponding to each of the three-dimensional sub-scenes is determined;

[0008] Performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendered sub-image;

[0009] Perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

[0010] In a second aspect, the present application further provides a rendering device based on ray tracing and rasterization, the device comprising:

[0011] A preferred rendering mode determination module is used to segment the initial three-dimensional scene based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, generate at least one three-dimensional sub-scene and determine a preferred rendering mode corresponding to each of the three-dimensional sub-scenes;

[0012] A rendering sub-image generation module, used for performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendering sub-image;

[0013] The target rendered image generation module is used to perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

[0014] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned rendering method based on ray tracing and rasterization when executing the computer program.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the rendering method based on ray tracing and rasterization as described above.

[0016] The present application discloses a rendering method, device, equipment and medium based on ray tracing and rasterization. The rendering method based on ray tracing and rasterization includes segmenting the initial three-dimensional scene based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, generating at least one three-dimensional sub-scene and determining the preferred rendering method corresponding to each of the three-dimensional sub-scenes; performing image rendering on each of the three-dimensional sub-scenes by the preferred rendering method to generate at least one rendered sub-image; performing image synthesis processing on each of the rendered sub-images to generate a target rendered image. In the above manner, the present application improves the rendering efficiency by segmenting the initial three-dimensional scene into multiple sub-scenes and determining the preferred rendering method for each sub-scene. By adopting the rendering method that best suits the characteristics of each sub-scene, a higher quality rendered sub-image can be generated, and a high-quality rendered image can be quickly generated, thereby improving the user's visual experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 is a schematic flow chart of a rendering method based on ray tracing and rasterization provided in the first embodiment of the present application;

[0019] Figure 2 is a schematic flow chart of a rendering method based on ray tracing and rasterization provided in the second embodiment of the present application;

[0020] Figure 3 A schematic block diagram of a rendering device based on ray tracing and rasterization provided in an embodiment of the present application;

[0021] Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] 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 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 ordinary technicians in this field without creative work are within the scope of protection of this application.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0026] The embodiments of the present application provide a rendering method, apparatus, device and medium based on ray tracing and rasterization. Among them, the rendering method based on ray tracing and rasterization can be applied to a server, by dividing the initial three-dimensional scene into multiple sub-scenes and determining the preferred rendering method for each sub-scene, thereby improving the rendering efficiency. By adopting the rendering method that best suits the characteristics of each sub-scene, a higher quality rendering sub-image can be generated, and a high-quality rendering image can be quickly generated, thereby improving the user's visual experience. Among them, the server can be an independent server or a server cluster.

[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0028] See also Figure 1 , Figure 1 This is a schematic flow chart of a rendering method based on ray tracing and rasterization provided by the first embodiment of the present application. The rendering method based on ray tracing and rasterization can be applied to a server, and is used to improve rendering efficiency by dividing an initial three-dimensional scene into multiple sub-scenes and determining a preferred rendering method for each sub-scene. By adopting a rendering method that best suits the characteristics of each sub-scene, a higher quality rendering sub-image can be generated, and a high-quality rendering image can be quickly generated, thereby improving the user's visual experience.

[0029] like Figure 1 As shown, the rendering method based on ray tracing and rasterization specifically includes steps S10 to S30.

[0030] Step S10: based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, segment the initial three-dimensional scene to generate at least one three-dimensional sub-scene and determine a preferred rendering method corresponding to each of the three-dimensional sub-scenes;

[0031] Specifically, the initial 3D scene is divided into multiple regions, and the most appropriate rendering technology is selected according to the characteristics of each region. For example, ray tracing technology is used for regions containing a large number of complex geometries and highly reflective materials, while rasterization technology is used for regions with simple lighting conditions and fewer geometries. Machine learning algorithms can be used to evaluate the lighting, material, and geometric complexity of the scene in real time, and automatically decide which parts should be processed by ray tracing and which parts by rasterization.

[0032] Step S20, performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendered sub-image;

[0033] In a specific embodiment, a ray tracing algorithm is used for global illumination rendering, including calculations of direct illumination, indirect illumination, and shadows. A rasterization rendering algorithm is used for local geometry and texture rendering, processing surface details, normal maps, projected textures, etc.

[0034] Ray tracing rendering is as follows:

[0035] Use ray tracing acceleration structures (such as bounding box hierarchies) to optimize the rendering process and reduce the intersection calculations between light and scene objects. Optimize ray tracing sampling and reflection calculations, and use technologies such as importance sampling and irradiance transfer to improve sampling efficiency and reduce noise.

[0036] The rasterization rendering method is as follows:

[0037] Use multi-threaded rendering and parallel computing technology to improve the efficiency and real-time performance of rasterization rendering. Use hierarchical subdivision and frustum clipping technology to reduce the number of processed polygons and fragments and improve rendering efficiency. Optimize the shading and texture sampling process, and use hardware acceleration technology and parallel computing to speed up the rendering process.

[0038] Step S30: Perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

[0039] Specifically, we combine the anti-aliasing technology of ray tracing with the post-processing noise reduction technology of rasterization, adjust the parameters of ray tracing and rasterization rendering, determine the best balance between quality and efficiency, reduce aliasing and noise, and improve the quality of the final image. We then synthesize the optimized ray tracing and rasterization rendering results to generate a high-quality offline rendered image.

[0040] In one embodiment, a preset scene segmentation model is created or selected, which can automatically segment the scene according to the characteristics of the three-dimensional scene and set local rendering parameters for each possible sub-scene. The local rendering parameters include material, lighting, camera settings, etc.

[0041] Load the 3D scene data to be rendered, use the preset scene segmentation model to analyze and segment the initial 3D scene, generate at least one 3D sub-scene, and for each generated 3D sub-scene, determine the most suitable rendering method (such as rasterization, ray tracing, etc.) according to its characteristics and preset local rendering parameters.

[0042] Configure the corresponding rendering environment for each sub-scene, including camera position, light source settings, etc., perform image rendering according to the preferred rendering method of each sub-scene, and generate at least one rendered sub-image. For rasterization rendering, it includes vertex processing, fragment shading and other steps; for ray tracing rendering, it includes intersection testing between light and objects, lighting calculation and other steps.

[0043] Collect the rendering results of all sub-scenes, synthesize the rendered sub-images according to their positions and hierarchical relationships in the initial 3D scene, ensure that the synthesized image is visually coherent without obvious seams or inconsistencies, and output the synthesized target rendered image to the screen or save it as an image file.

[0044] The present embodiment discloses a rendering method, apparatus, device and medium based on ray tracing and rasterization. The rendering method based on ray tracing and rasterization includes segmenting the initial three-dimensional scene based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, generating at least one three-dimensional sub-scene and determining the preferred rendering method corresponding to each of the three-dimensional sub-scenes; performing image rendering on each of the three-dimensional sub-scenes by the preferred rendering method to generate at least one rendered sub-image; performing image synthesis processing on each of the rendered sub-images to generate a target rendered image. In the above manner, the present application improves the rendering efficiency by segmenting the initial three-dimensional scene into multiple sub-scenes and determining the preferred rendering method for each sub-scene. By adopting the rendering method that best suits the characteristics of each sub-scene, it is possible to generate higher quality rendered sub-images, quickly generate high-quality rendered images, and enhance the user's visual experience.

[0045] See also Figure 2 , Figure 2This is a schematic flow chart of a rendering method based on ray tracing and rasterization provided in the second embodiment of the present application. The rendering method based on ray tracing and rasterization can be applied to a server, and is used to improve rendering efficiency by dividing an initial three-dimensional scene into multiple sub-scenes and determining a preferred rendering method for each sub-scene. By adopting a rendering method that best suits the characteristics of each sub-scene, a higher quality rendering sub-image can be generated, and a high-quality rendering image can be quickly generated, thereby improving the user's visual experience.

[0046] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S10 includes step S101 to step S102.

[0047] Step S101, obtaining geometric parameters and material reflection parameters in the local rendering parameters;

[0048] Step S102: based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, the initial three-dimensional scene is divided into a first type of sub-scene and a second type of sub-scene, wherein the first type of sub-scene and the second type of sub-scene belong to the three-dimensional sub-scene.

[0049] In one embodiment, geometric body related parameters are extracted from the local rendering parameters, such as vertex positions, normals, tangents, etc. The reflection characteristics of the material are extracted from the local rendering parameters, including diffuse reflection, specular reflection, glossiness, etc.

[0050] The preset machine learning algorithm is trained and adjusted to ensure that it can accurately segment the scene according to the geometric parameters and material reflection parameters. The initial 3D scene data to be segmented is loaded through the preset machine learning algorithm, and the initial 3D scene is analyzed and segmented in combination with the geometric parameters and material reflection parameters. According to the output of the algorithm, the initial 3D scene is segmented into the first type of sub-scene and the second type of sub-scene. According to the characteristics of the sub-scene and the preset local rendering parameters, the most suitable rendering method is determined for each sub-scene, such as rasterization or ray tracing.

[0051] The present embodiment discloses a rendering method, apparatus, device and medium based on ray tracing and rasterization, wherein the rendering method based on ray tracing and rasterization includes obtaining the geometric parameters and material reflection parameters in the local rendering parameters; dividing the initial three-dimensional scene into a first type of sub-scene and a second type of sub-scene based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, wherein the first type of sub-scene and the second type of sub-scene belong to the three-dimensional sub-scene; performing image rendering on each of the three-dimensional sub-scenes through the preferred rendering method to generate at least one rendered sub-image; performing image synthesis processing on each of the rendered sub-images to generate a target rendered image. In the above manner, the present application improves the rendering efficiency by dividing the initial three-dimensional scene into multiple sub-scenes and determining the preferred rendering method for each sub-scene. By adopting the rendering method that best suits the characteristics of each sub-scene, a higher quality rendered sub-image can be generated, and a high-quality rendered image can be quickly generated, thereby improving the user's visual experience.

[0052] In a more preferred embodiment, step S102 includes:

[0053] Extracting features of the geometric body parameters and the material reflection parameters respectively to generate geometric body features and material reflection features;

[0054] Determining preset rendering weights of the geometric features and the material reflection features by using the preset machine learning algorithm, the geometric parameters and the material reflection parameters;

[0055] The initial three-dimensional scene is classified according to the geometric features, material reflection features and the preset rendering weights to generate the first type of sub-scene and the second type of sub-scene.

[0056] Specifically, the material reflection parameters are analyzed, and the material reflection characteristics (such as glossiness, specular reflectivity, etc.) are converted into numerical features using feature extraction technology. Using a preset machine learning algorithm, the geometric features and material reflection features are input, and the machine learning model is trained and adjusted to ensure that it can accurately determine the preset rendering weights based on the input features. The preset rendering weights of the geometric features and material reflection features are determined by combining the geometric parameters and material reflection parameters.

[0057] The extracted geometric features, material reflection features, and preset rendering weights are used as inputs and applied to the machine learning model. The machine learning model is used to classify the initial 3D scene, generate the first type of sub-scene and the second type of sub-scene, and according to the output of the model, the initial 3D scene is divided into different sub-scenes, each of which belongs to a specific type.

[0058] based on Figure 1In the embodiment shown, in this embodiment, step S20 includes:

[0059] Performing global rendering on each of the three-dimensional sub-scenes by means of the ray tracing method to generate at least one of the globally rendered sub-images;

[0060] Each of the three-dimensional sub-scenes is locally rendered by the rasterization method to generate at least one locally rendered sub-image.

[0061] Specifically, for global illumination calculations, ray tracing is used to calculate indirect lighting, while direct lighting is processed by rasterization. In this way, the rendering speed can be improved while ensuring the authenticity of lighting.

[0062] Use ray tracing acceleration structures (such as bounding box hierarchies) to optimize the rendering process and reduce the intersection calculations between light and scene objects. Optimize ray tracing sampling and reflection calculations, and use technologies such as importance sampling and irradiance transfer to improve sampling efficiency and reduce noise.

[0063] Use multi-threaded rendering and parallel computing technology to improve the efficiency and real-time performance of rasterization rendering. Use hierarchical subdivision and frustum clipping technology to reduce the number of processed polygons and fragments and improve rendering efficiency. Optimize the shading and texture sampling process, and use hardware acceleration technology and parallel computing to speed up the rendering process.

[0064] Use ray tracing algorithms to perform global illumination rendering, including calculations of direct illumination, indirect illumination, and shadows. Use rasterization rendering algorithms to perform local geometry and texture rendering, processing surface details, normal maps, projected textures, etc.

[0065] In a more preferred embodiment, globally rendering each of the three-dimensional sub-scenes is performed by the ray tracing method to generate at least one globally rendered sub-image, including:

[0066] Based on the ray tracing method, construct a bounding box hierarchy structure, wherein the bounding box hierarchy structure includes at least one bounding box;

[0067] Defining geometric objects in each of the three-dimensional sub-scenes, and determining at least one intersection point between a ray and each of the geometric objects through each of the bounding boxes;

[0068] Determine the color information of each light at each intersection by using a preset illumination model, and determine the color information of each pixel according to the color information of each light;

[0069] The color information of each pixel is synthesized to generate the global rendering sub-image.

[0070] Specifically, a bounding box hierarchy is a data structure commonly used in computer graphics, especially in ray tracing rendering technology, to accelerate the intersection calculation between light and objects in the scene. In ray tracing, the bounding box hierarchy is used to quickly determine which objects may be hit by light, thereby reducing the necessary intersection tests.

[0071] In a more preferred embodiment, locally rendering each of the three-dimensional sub-scenes by means of the rasterization method to generate at least one locally rendered sub-image includes:

[0072] Defining a local area to be rendered in the three-dimensional sub-scene, and using the projection of the geometric body in the local area to be rendered as a fragment;

[0073] Performing a depth test on each of the fragments to determine a depth value of each of the fragments;

[0074] The fragments whose depth values ​​are greater than a preset depth threshold are rendered to generate the local rendered sub-image.

[0075] Specifically, for a local rendering area, only the geometry within the area is processed, which can be achieved by setting a local view port, which corresponds to the local area in the screen space. Each vertex of each primitive in the local area is operated, including transformation and lighting calculation, and the primitives in the local area are projected onto the screen to generate corresponding fragments.

[0076] Based on any of the above embodiments, in this embodiment, step S30 includes:

[0077] Blending the sub-image pixels of each of the rendered sub-images at a pixel level to generate an initial fused image;

[0078] An image processing operation is performed on the initial fused image to generate the target rendered image, wherein the image processing operation includes a tone mapping operation and an anti-aliasing operation.

[0079] See also Figure 3 , Figure 3 The embodiment of the present application provides a schematic block diagram of a rendering device based on ray tracing and rasterization, and the rendering device based on ray tracing and rasterization is used to execute the aforementioned rendering method based on ray tracing and rasterization. The rendering device based on ray tracing and rasterization can be configured on a server.

[0080] like Figure 3 As shown, the rendering device 400 based on ray tracing and rasterization includes:

[0081] The preferred rendering mode determination module 410 is used to segment the initial 3D scene based on a preset scene segmentation model and local rendering parameters of the initial 3D scene, generate at least one 3D sub-scene and determine the preferred rendering mode corresponding to each 3D sub-scene;

[0082] A rendering sub-image generating module 420, configured to perform image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendering sub-image;

[0083] The target rendered image generating module 430 is used to perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

[0084] Furthermore, the preferred rendering mode determination module 410 includes:

[0085] A local rendering parameter acquisition unit, used to acquire geometric parameters and material reflection parameters in the local rendering parameters;

[0086] A three-dimensional sub-scene generation unit is used to divide the initial three-dimensional scene into a first type of sub-scene and a second type of sub-scene based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, wherein the first type of sub-scene and the second type of sub-scene belong to the three-dimensional sub-scene.

[0087] Furthermore, the three-dimensional sub-scene generation unit includes:

[0088] A feature extraction subunit, used for extracting features of the geometric body parameters and the material reflection parameters respectively, to generate geometric body features and material reflection features;

[0089] A rendering weight determination subunit, used to determine the preset rendering weights of the geometric features and the material reflection features through the preset machine learning algorithm, the geometric parameters and the material reflection parameters;

[0090] The three-dimensional sub-scene generation sub-unit is used to classify the initial three-dimensional scene according to the geometric features, material reflection features and the preset rendering weights, and generate the first type of sub-scene and the second type of sub-scene.

[0091] Furthermore, the rendering sub-image generation module 420 includes:

[0092] A global rendering sub-image generating unit, configured to perform global rendering on each of the three-dimensional sub-scenes by means of the ray tracing method, and generate at least one of the global rendering sub-images;

[0093] The local rendering sub-image generating unit is used to perform local rendering on each of the three-dimensional sub-scenes in the rasterization manner to generate at least one of the local rendering sub-images.

[0094] Furthermore, the global rendering sub-image generating unit includes:

[0095] A bounding box hierarchy construction subunit, configured to construct a bounding box hierarchy based on the ray tracing method, wherein the bounding box hierarchy includes at least one bounding box;

[0096] An intersection point determination subunit, used to define geometric objects in each of the three-dimensional sub-scenes, and determine at least one intersection point between the light and each of the geometric objects through each of the bounding boxes;

[0097] A pixel color information determination subunit, used to determine the color information of each light at each intersection by using a preset illumination model, and determine the color information of each pixel according to the color information of each light;

[0098] The global rendering sub-image generating sub-unit is used to perform image synthesis on the color information of each pixel to generate the global rendering sub-image.

[0099] Furthermore, the local rendering sub-image generating unit includes:

[0100] A fragment determination subunit, used to define a local area to be rendered in the three-dimensional sub-scene, and use the projection of the geometric body in the local area to be rendered as a fragment;

[0101] A fragment depth value determination subunit, used to perform a depth test on each of the fragments to determine a depth value of each of the fragments;

[0102] The local rendering sub-image generating sub-unit is used to render the fragments whose depth values ​​are greater than a preset depth threshold to generate the local rendering sub-image.

[0103] Furthermore, the target rendered image generation module 430 includes:

[0104] An initial fused image generating unit, used for performing pixel-level mixing of sub-image pixels of each of the rendered sub-images to generate an initial fused image;

[0105] The target rendered image generating unit is used to perform an image processing operation on the initial fused image to generate the target rendered image, wherein the image processing operation includes a tone mapping operation and an anti-aliasing operation.

[0106] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0107] The above-mentioned device can be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.

[0108] See also Figure 4 , Figure 4 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0109] See also Figure 4 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0110] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any rendering method based on ray tracing and rasterization.

[0111] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0112] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any rendering method based on ray tracing and rasterization.

[0113] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0114] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0115] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0116] Based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, the initial three-dimensional scene is segmented to generate at least one three-dimensional sub-scene and a preferred rendering mode corresponding to each of the three-dimensional sub-scenes is determined;

[0117] Performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendered sub-image;

[0118] Perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

[0119] In one embodiment, based on a preset scene segmentation model and local rendering parameters of an initial three-dimensional scene, the initial three-dimensional scene is segmented to generate at least one three-dimensional sub-scene, so as to achieve:

[0120] Obtaining geometry parameters and material reflection parameters in the local rendering parameters;

[0121] Based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, the initial three-dimensional scene is segmented into a first type of sub-scene and a second type of sub-scene, wherein the first type of sub-scene and the second type of sub-scene belong to the three-dimensional sub-scene.

[0122] In one embodiment, based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, the initial three-dimensional scene is segmented into a first type of sub-scene and a second type of sub-scene, so as to achieve:

[0123] Extracting features of the geometric body parameters and the material reflection parameters respectively to generate geometric body features and material reflection features;

[0124] Determining preset rendering weights of the geometric features and the material reflection features by using the preset machine learning algorithm, the geometric parameters and the material reflection parameters;

[0125] The initial three-dimensional scene is classified according to the geometric features, material reflection features and the preset rendering weights to generate the first type of sub-scene and the second type of sub-scene.

[0126] In one embodiment, each of the three-dimensional sub-scenes is rendered using the preferred rendering method to generate at least one rendered sub-image, which is used to achieve:

[0127] Performing global rendering on each of the three-dimensional sub-scenes by means of the ray tracing method to generate at least one of the globally rendered sub-images;

[0128] Each of the three-dimensional sub-scenes is locally rendered by the rasterization method to generate at least one locally rendered sub-image.

[0129] In one embodiment, each of the three-dimensional sub-scenes is globally rendered by the ray tracing method to generate at least one globally rendered sub-image, so as to achieve:

[0130] Based on the ray tracing method, construct a bounding box hierarchy structure, wherein the bounding box hierarchy structure includes at least one bounding box;

[0131] Defining geometric objects in each of the three-dimensional sub-scenes, and determining at least one intersection point between a ray and each of the geometric objects through each of the bounding boxes;

[0132] Determine the color information of each light at each intersection by using a preset illumination model, and determine the color information of each pixel according to the color information of each light;

[0133] The color information of each pixel is synthesized to generate the global rendering sub-image.

[0134] In one embodiment, each of the three-dimensional sub-scenes is locally rendered by the rasterization method to generate at least one locally rendered sub-image, so as to achieve:

[0135] Defining a local area to be rendered in the three-dimensional sub-scene, and using the projection of the geometric body in the local area to be rendered as a fragment;

[0136] Performing a depth test on each of the fragments to determine a depth value of each of the fragments;

[0137] The fragments whose depth values ​​are greater than a preset depth threshold are rendered to generate the local rendered sub-image.

[0138] In one embodiment, each of the rendered sub-images is subjected to image synthesis processing to generate a target rendered image, which is used to achieve:

[0139] Blending the sub-image pixels of each of the rendered sub-images at a pixel level to generate an initial fused image;

[0140] An image processing operation is performed on the initial fused image to generate the target rendered image, wherein the image processing operation includes a tone mapping operation and an anti-aliasing operation.

[0141] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the rendering methods based on ray tracing and rasterization provided in the embodiments of the present application.

[0142] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.

[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A rendering method based on ray tracing and rasterization, characterized in that: include: Based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, the initial three-dimensional scene is segmented to generate at least one three-dimensional sub-scene and a preferred rendering mode corresponding to each of the three-dimensional sub-scenes is determined; Performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendered sub-image; Perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

2. The rendering method based on ray tracing and rasterization according to claim 1, characterized in that: The method of segmenting the initial three-dimensional scene based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene to generate at least one three-dimensional sub-scene includes: Obtaining geometry parameters and material reflection parameters in the local rendering parameters; Based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters, the initial three-dimensional scene is segmented into a first type of sub-scene and a second type of sub-scene, wherein the first type of sub-scene and the second type of sub-scene belong to the three-dimensional sub-scene.

3. The rendering method based on ray tracing and rasterization according to claim 2, characterized in that: The method of segmenting the initial three-dimensional scene into a first type of sub-scene and a second type of sub-scene based on a preset machine learning algorithm, the geometric parameters and the material reflection parameters comprises: Extracting features of the geometric body parameters and the material reflection parameters respectively to generate geometric body features and material reflection features; Determining preset rendering weights of the geometric features and the material reflection features by using the preset machine learning algorithm, the geometric parameters and the material reflection parameters; The initial three-dimensional scene is classified according to the geometric features, material reflection features and the preset rendering weights to generate the first type of sub-scene and the second type of sub-scene.

4. The rendering method based on ray tracing and rasterization according to claim 1, characterized in that: The preferred rendering method includes a ray tracing method and a rasterization method, the rendered sub-image includes a global rendered sub-image and a local rendered sub-image, and the image rendering is performed on each of the three-dimensional sub-scenes by the preferred rendering method to generate at least one rendered sub-image, including: Performing global rendering on each of the three-dimensional sub-scenes by means of the ray tracing method to generate at least one of the globally rendered sub-images; Each of the three-dimensional sub-scenes is locally rendered by the rasterization method to generate at least one locally rendered sub-image.

5. The rendering method based on ray tracing and rasterization according to claim 4, characterized in that: The globally rendering each of the three-dimensional sub-scenes by the ray tracing method to generate at least one globally rendered sub-image includes: Based on the ray tracing method, construct a bounding box hierarchy structure, wherein the bounding box hierarchy structure includes at least one bounding box; Defining geometric objects in each of the three-dimensional sub-scenes, and determining at least one intersection point between a ray and each of the geometric objects through each of the bounding boxes; Determine the color information of each light at each intersection by using a preset illumination model, and determine the color information of each pixel according to the color information of each light; The color information of each pixel is synthesized to generate the global rendering sub-image.

6. The rendering method based on ray tracing and rasterization according to claim 5, characterized in that: The locally rendering each of the three-dimensional sub-scenes by the rasterization method to generate at least one locally rendered sub-image includes: Defining a local area to be rendered in the three-dimensional sub-scene, and using the projection of the geometric body in the local area to be rendered as a fragment; Performing a depth test on each of the fragments to determine a depth value of each of the fragments; The fragments whose depth values ​​are greater than a preset depth threshold are rendered to generate the local rendered sub-image.

7. The rendering method based on ray tracing and rasterization according to any one of claims 1 to 6, characterized in that: The step of performing image synthesis processing on each of the rendered sub-images to generate a target rendered image includes: Blending the sub-image pixels of each of the rendered sub-images at a pixel level to generate an initial fused image; An image processing operation is performed on the initial fused image to generate the target rendered image, wherein the image processing operation includes a tone mapping operation and an anti-aliasing operation.

8. A rendering device based on ray tracing and rasterization, characterized in that: include: A preferred rendering mode determination module is used to segment the initial three-dimensional scene based on a preset scene segmentation model and local rendering parameters of the initial three-dimensional scene, generate at least one three-dimensional sub-scene and determine a preferred rendering mode corresponding to each of the three-dimensional sub-scenes; A rendering sub-image generation module, used for performing image rendering on each of the three-dimensional sub-scenes by using the preferred rendering method to generate at least one rendering sub-image; The target rendered image generation module is used to perform image synthesis processing on each of the rendered sub-images to generate a target rendered image.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the rendering method based on ray tracing and rasterization as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the rendering method based on ray tracing and rasterization according to any one of claims 1 to 7.

Citation Information

Cited By

  • Three-dimensional scene loading and rendering method for deep sea three-dimensional environment deduction

    CN119991921A

  • Animation image three-dimensional rendering analysis method based on artificial intelligence

    CN120451344A