Image rendering method, device, storage medium and electronic device

By dividing the particle swarm in complex scenes into multiple particle spaces in three-dimensional spaces and rendering according to the shading rate of each particle voxel, the problem of low rendering efficiency in the prior art is solved, and efficient particle rendering is achieved.

CN115082609BActive Publication Date: 2025-02-14GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210667873.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-14
Publication Date
2025-02-14
Estimated Expiration
2042-06-14

AI Technical Summary

Technical Problem

The prior art is low in rendering particle swarms in complex scenes, and it is necessary to traverse each particle to calculate the lighting effect, resulting in a high overhead.

Method used

By dividing the particle swarm of the scene to be rendered into multiple particle spaces in three-dimensional space, each particle space corresponds to a shape of particle voxels, and rendering particles in the particle space according to the coloring rate of each particle voxel.

Benefits of technology

Reduces the number of particles to be rendered in the particle space, reduces the generated DrawCall, reduces the rendering overhead of the graphics processor, and thus improves rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082609B_ABST
    Figure CN115082609B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image rendering method, device, storage medium and electronic device, wherein the method includes: determining the three-dimensional space where the particle group of the scene to be rendered in the image is located; dividing the three-dimensional space where the particle group is located into multiple particle spaces, each particle space corresponds to a particle voxel of a shape; rendering the particles in the particle space according to the shading rate corresponding to the particle voxels of various shapes. According to the technical solution of the embodiment of the present application, it is possible to reduce the rendering commands generated when rendering particles in the particle group, reduce the rendering overhead of the graphics processor, and thus efficiently render the particles in the particle system.
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 an image rendering method, device, storage medium and electronic device. Background Art

[0002] With the development of computer vision technology, electronic devices can process more and more image scenes. How to render complex scenes such as clouds, fog, smoke, etc. has become a focus of attention.

[0003] In one technical solution, taking volumetric cloud as an example, a grid model is used to render the volumetric cloud. During the rendering process, the lighting effect after the light hits each particle needs to be considered. Therefore, this technical solution needs to traverse each particle in the particle group of the volumetric cloud to calculate the lighting effect of the particle, and the rendering efficiency is low.

[0004] Therefore, how to efficiently render particles in a particle swarm in a complex scene has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide an image rendering method, device, storage medium and electronic device, which can efficiently render particles in a particle swarm of complex scenes and reduce the rendering overhead of a graphics processor. The technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides an image rendering method, comprising:

[0007] Determine the three-dimensional space where the particle group of the scene to be rendered in the image is located;

[0008] Dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of the particle spaces corresponds to a particle voxel of a certain shape;

[0009] The particles in the particle space are rendered according to shading rates corresponding to the particle voxels of various shapes.

[0010] In a second aspect, an embodiment of the present application provides an image rendering device, the device comprising:

[0011] A space determination module is used to determine the three-dimensional space where the particle group of the scene to be rendered in the image is located;

[0012] A space division module, used for dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of which corresponds to a particle voxel of a certain shape;

[0013] The shading and rendering module is used to render the particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes.

[0014] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned method.

[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.

[0016] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:

[0017] On the one hand, the three-dimensional space where the particle group of the scene to be rendered is located is divided into multiple particle spaces, each particle space corresponds to a particle voxel of a certain shape, which can reduce the number of particles to be rendered in the particle space; on the other hand, the particles in the particle space are rendered according to the shading rate corresponding to the particle voxel, which can reduce the DrawCall (rendering command) generated when rendering the particles in the particle group, reduce the rendering overhead of the graphics processor, and thus can efficiently render the particles in the particle system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A schematic diagram showing a system architecture of an electronic device provided in an embodiment of the present application is shown;

[0020] Figure 2 A schematic diagram of a process of an image rendering method provided according to some embodiments of the present application is shown;

[0021] Figure 3 A schematic diagram showing particle voxels of various shapes provided according to an embodiment of the present application;

[0022] Figure 4 A schematic diagram showing a flow chart of an image rendering method provided according to some other embodiments of the present application;

[0023] Figure 5 A schematic diagram of particle voxel division according to some other embodiments of the present application is shown;

[0024] Figure 6A schematic diagram of determining a three-dimensional bounding box according to an embodiment of the present application is shown;

[0025] Figure 7 A schematic diagram showing particle voxels of various shapes provided according to an embodiment of the present application;

[0026] Figure 8 A schematic diagram showing the correspondence between the index identifier of the particle space and the particle voxel provided in an embodiment of the present application;

[0027] Fig. 9 A schematic diagram of rendering particles in a bounding box provided according to some embodiments of the present application is shown;

[0028] Fig.10 A schematic diagram showing pixel points and three-dimensional points corresponding to a line of sight in a camera coordinate system provided according to some embodiments of the present application is shown;

[0029] Fig.11 A schematic diagram of dividing particle voxels in a particle system through which light can penetrate is shown according to some embodiments of the present application;

[0030] Fig.12 A schematic diagram of determining the coloring of particles in a particle system through which light can penetrate is shown according to some embodiments of the present application;

[0031] Fig.13 A schematic diagram of the structure of an image rendering device provided in an embodiment of the present application is shown;

[0032] Fig.14 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] First, the terms involved in the embodiments of the present application are explained and illustrated.

[0035] Rendering scene: refers to the scene of a three-dimensional object composed of multiple particles or particle groups, such as clouds, fog, smoke, fire, etc.

[0036] Particle space: refers to the spatial region containing particles in the particle system. Each particle space can correspond to a particle voxel of a certain shape.

[0037] Particle voxel: refers to the voxel containing particles. The shape of the particle voxel can represent the shape on a regular grid in three-dimensional space. For example, the shape of the particle voxel can be 1x1x1, 1x2x2, 2x2x2, 2x2x4, 2x4x4, etc.

[0038] Shading rate: It can represent the shape and size of a particle voxel, or the number of particles contained in a particle voxel, that is, the number of particles rendered each time. The shading rate corresponding to each shape of particle voxel is different.

[0039] Drawcall: refers to the rendering command issued by the application. Drawcall contains the data of the object to be rendered, such as the mesh data of the object to be rendered and the information of the rendering method.

[0040] Bounding box: A bounding box refers to a geometric body (called a bounding box) that is slightly larger in size and has simpler characteristics to approximate a complex geometric object. The bounding box contains the components of the geometric object.

[0041] Particle voxel bounding box: refers to the bounding box that contains the particle voxels that make up the geometric object.

[0042] Currently, VRS (Variable Rates Shading) allows the shading of a single pixel to be applied to multiple pixels, allowing applications to apply different shading rates to different areas of the image. In other words, the fineness of the image in different areas can be determined based on the importance of different areas in the image, reducing the rendering load of the graphics card.

[0043] However, the current VRS technology improves the rendering effect of the plane space through different shading rates in the plane space, and there is no rendering solution for particles in 3D (Three Dimension) space.

[0044] Based on the above content, an embodiment of the present application provides an image rendering method and an image rendering device, which divides the particle group of the scene to be rendered into particle spaces of different sizes, namely volumes, in the 3D space. Different particle spaces correspond to respective rendering methods or shading rates. On the one hand, since the particle group is divided in the 3D space, the number of particles to be rendered in the particle space volume can be reduced by downsampling, thereby reducing rendering commands (DrawCall); on the other hand, the particle space can be upsampled by super-resolution reconstruction, thereby increasing the number of particles to be rendered in the particle space volume and improving the rendering quality.

[0045] Furthermore, the image rendering method in the embodiment of the present application can be implemented by a computer program and can be run on an image rendering device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application. Among them, the image rendering device in the embodiment of the present application can be a terminal device, including but not limited to: a personal computer, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem. In different networks, terminal devices can be called different names, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, 5G network or terminal device in future evolution network, etc.

[0046] Below, the technical solution of the image rendering method of the embodiment of the present application will be described in detail with reference to the accompanying drawings.

[0047] Figure 1 A schematic diagram of a system architecture of an electronic device provided in an embodiment of the present application is shown.

[0048] Reference Figure 1 As shown, the electronic device may include an application layer 110, a framework layer 120, a system library 130, and a hardware layer 140, etc. Among them, the application layer 110 may also be referred to as an application layer, or an application (APP) layer. In some implementations, the application layer may include a series of application packages. The application package may include applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, etc. The application package may also include an application that needs to display pictures or videos to the user by rendering images. For example, the application included in the application layer 110 may be a game application, such as a shooting game program or a MOBA (Multiplayer Online Battle Arena, multiplayer online tactical competitive game), etc.

[0049] The framework layer 120 may also be referred to as an application framework layer. The framework layer 120 may provide an application programming interface (API) and a programming framework for the application of the application layer 110. The framework layer 120 includes some predefined functions.

[0050] In the embodiment of the present application, one or more functional modules may be provided in the framework layer 120 to implement the image rendering solution provided in the embodiment of the present application. The system library 130 may include multiple functional modules. For example: a surface manager, a media framework, a standard C library (libc), an open graphics library for embedded systems (OpenGL for Embedded Systems, OpenGL ES), SQLite, Webkit, etc.

[0051] Among them, the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of multiple commonly used audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: Moving Pictures Experts Group 4 (MPEG4), H.264, Moving Pictures Experts Group Audio Layer 3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi Rate (AMR), Joint Photographic Experts Group (JPEG), Portable Network Graphics (PNG), etc. OpenGLES provides drawing and operation of 2D and 3D graphics in applications. SQLite provides a lightweight relational database for applications of electronic devices.

[0052] In some implementations, OpenGL ES in the system library 130 can provide a variable rate shading function. When the electronic device needs to perform variable rate shading for a certain rendering command (Drawcall), it can call the variable rate shading API in OpenGL ES and implement variable rate shading for the current Drawcall together with other instructions. For example, the electronic device can use a shading rate (such as 1x1x1, 1x2x2, 2x2x2, 2x2x4, 2x4x4, etc.) to shade the current Drawcall, thereby reducing the overhead generated by shading the current Drawcall.

[0053] In such Figure 1In the example of , the electronic device may also include a hardware layer 140. The hardware layer 140 may include a processor such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc., and a component with a storage function. In some implementations, the CPU may be used to control each module in the framework layer 120 to implement its respective functions, and the GPU may be used to perform corresponding rendering processing according to an API in a graphics library (such as OpenGL ES) called by instructions processed by each module in the framework layer 120.

[0054] In order to more clearly illustrate the functions of each layer in the software architecture provided in the embodiment of the present application, the following takes image rendering as an example. Figure 1 The functional implementation of each component of the system architecture is illustrated by way of example.

[0055] Exemplarily, when an application in the application layer 110 needs to render an image, it can issue a rendering command. In the following description, a rendering command issued by an application can also be referred to as a Drawcall. In different examples, the rendering command can include different contents. For example, in some embodiments, an application needs to render a graphic in a frame of an image. The issued rendering command can include particle data of a particle group of the graphic to be rendered. In some implementations, the particle data can be used to indicate the coordinates of the particles of the graphic to be rendered. The coordinates can be based on the coordinates of the local space. The rendering command can also include one or more drawing elements, such as particle voxels or particle spaces. After receiving the rendering command, the framework layer 120 can convert the rendering command into a rendering instruction, which can carry the above-mentioned particle data and one or more drawing elements, etc. In some implementations, the framework layer 120 can also obtain the API required for the current Drawcall from the graphics library of the system library 130 according to the instructions of the application, so as to use the functions corresponding to the API to instruct other modules (such as GPU) to perform rendering operations.

[0056] Exemplarily, the electronic device may determine the parameters to be used in the variable rate shading process before rendering, such as the shading rate of the particle voxel. The electronic device may also send a variable shading instruction by calling the variable rate shading API in combination with the aforementioned parameters. Variable rate shading of the subsequent particle space is implemented. Taking the GPU in the hardware layer 140 performing rendering as an example, the GPU may obtain a variable shading instruction, and in response to the variable shading instruction, use the shading rate indicated by the corresponding parameter to perform rendering of the particles in the particle space.

[0057] The rendering method provided in the embodiment of the present application can also be applied to Figure 1 In the electronic device of the system architecture shown in FIG. Figure 1 The software composition shown illustrates the solution provided in the embodiment of the present application.

[0058] Figure 2 A schematic flow chart of an image rendering method provided according to some embodiments of the present application is shown. The execution subject of the image rendering method may be a computing device with a computing processing function, such as the above-mentioned electronic device. The image rendering method includes steps S210 to S230. The image rendering method in the example embodiment is described in detail below in conjunction with the accompanying drawings.

[0059] Reference Figure 2 As shown, in step S210, the three-dimensional space where the particle group of the scene to be rendered in the image is located is determined.

[0060] In an example embodiment, the scene to be rendered in the image may include scenes such as volumetric clouds, smoke, flames or explosions. The particle group of the scene to be rendered includes a plurality of particles in the particle system that constitute the scene to be rendered, and the particles in the particle group of the scene to be rendered may be generated by a random function. The three-dimensional space in which the particle group of the scene to be rendered is located may be a cubic space or a three-dimensional space of other appropriate shapes.

[0061] For example, the three-dimensional space where the particle group of the scene to be rendered is located is determined based on the particle system. For example, a three-dimensional bounding box containing the particle group of the scene to be rendered is established based on the particle system. The three-dimensional bounding box can be an oriented bounding box (OBB). The bounding box refers to a geometric body (called a bounding box) with a slightly larger volume and simpler characteristics to approximate a complex geometric object, and the bounding box contains the particle group that constitutes the geometric object.

[0062] It should be noted that, although the three-dimensional bounding box is an OBB bounding box as an example, those skilled in the art should understand that the three-dimensional bounding box may also be a bounding box of other appropriate shapes such as an axis-aligned bounding box (AABB) or a bounding sphere, which is also within the scope of the embodiments of the present application.

[0063] In step S220, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces, each particle space corresponding to a particle voxel of a certain shape.

[0064] In the exemplary embodiment, various shapes of particle voxels are pre-set, such as particle voxels of shapes such as 1x1x1, 1x2x2, 2x2x2, 2x2x4, 2x4x4, etc. The particle space refers to a space region containing particles, and each particle space corresponds to a particle voxel. Figure 3 As shown, the particle voxels include particle voxels of four shapes, namely, 1x1x1, 1x1x2, 1x2x1, and 1x2x2, and each particle space corresponds to a particle voxel of one shape.

[0065] Further, according to a predetermined division unit, the three-dimensional space where the particle group is located is divided into a plurality of voxel units, and the plurality of voxel units are divided or aggregated into a plurality of particle spaces according to the attribute information of each particle in the particle group. The predetermined division unit can be determined according to the resolvable unit size of the current space relative to the camera. For example, the predetermined division unit can be the minimum resolvable unit of the current space relative to the camera. The attribute information of the particle may include: one or more of the position of the particle relative to the viewpoint, the life cycle of the particle, and the transparency of the particle.

[0066] It should be noted that, in some embodiments of the present application, the attribute information of the particle may also include other appropriate attribute information such as the color of the particle or the speed of the particle, which is also within the scope of the embodiments of the present application.

[0067] For example, assuming that the three-dimensional space where the particle swarm is located is a three-dimensional bounding box, and the particle space is a particle voxel bounding box, the three-dimensional bounding box where the particle swarm is located is divided into multiple voxel units according to a predetermined division unit such as a cubic voxel; according to the attribute information of each particle in the particle swarm, the voxel unit is aggregated or divided into multiple particle voxel bounding boxes in combination with the shape of the particle voxel.

[0068] It should be noted that although the predetermined division unit is a cubic voxel as an example, those skilled in the art should understand that the predetermined division unit can also be other appropriate division units, such as a rectangular voxel or a spherical voxel, which is also within the scope of the embodiments of the present application.

[0069] In step S230 , particles in the particle space are rendered according to shading rates corresponding to particle voxels of various shapes.

[0070] In an exemplary embodiment, the shading rate corresponding to the particle voxel may represent the shape and size of the particle voxel, or represent the number of particles contained in the particle voxel, that is, the number of particles rendered each time. The shading rate corresponding to the particle voxel of each shape is different. For example, referring to Figure 3 As shown, the particle voxels include 4 shapes of particle voxels, namely, 1x1x1, 1x1x2, 1x2x1, and 1x2x2, and the numbers of particles corresponding to the particle voxels are 1, 2, 2, and 4. Furthermore, the particles in the particle space are rendered according to the shading rate of the particle voxels corresponding to the particle space.

[0071] For example, suppose the shading rates of the particle voxels corresponding to particle space 1, particle space 2 and particle space 3 are 1x1x1, 1x1x2, 1x2x2 respectively, that is, the number of particles rendered each time is 1, 2, and 4, and a sampling point is selected from the particle space, such as the center point of the particle space, and the particles in the particle space are rendered according to the rendering method of the sampling point.

[0072] according to Figure 2 According to the technical solution in the example embodiment, on the one hand, the three-dimensional space where the particle group of the scene to be rendered is located is divided into multiple particle spaces, each particle space corresponds to a particle voxel of a certain shape, and the number of particles to be rendered in the particle space can be reduced by downsampling; on the other hand, the particles in the particle space are rendered according to the shading rate corresponding to the particle voxel, which can reduce the DrawCall (rendering command) generated when rendering the particles in the particle group, reduce the rendering overhead of the graphics processor, and thus can efficiently render the particles in the particle system.

[0073] Figure 4 A schematic flow chart of another image rendering method according to an embodiment of the present application is shown.

[0074] Reference Figure 4 As shown, in step S410, a particle group of a scene to be rendered is generated.

[0075] In an exemplary embodiment, the scene to be rendered may include scenes such as atmosphere, clouds, fog, fire or explosion, etc. Particles in the particle group of the scene to be rendered may be generated by GPU simulation through a random function.

[0076] For example, the number of new particles entering the particle system per unit time is defined by a random function, that is, the new particles of a certain image frame in the particle system per unit time are generated by the random function. Figure 5 As shown, a particle group 505 of a scene to be rendered in an image is generated by GPU simulation.

[0077] In step S420, a three-dimensional bounding box where the particle group of the scene to be rendered is located is determined.

[0078] In an exemplary embodiment, a three-dimensional bounding box in which a particle group of the scene to be rendered is located is established based on the particle system, and the volume of the three-dimensional bounding box is determined by the position of the particle group of the scene to be rendered in the model space.

[0079] Reference Figure 5 As shown, E is a camera or a viewpoint, and a three-dimensional bounding box 510 is perpendicular to the line of sight of the camera. The near section and the far section of the three-dimensional bounding box 510 are calculated according to the position of the camera.

[0080] Further, refer to Figure 6As shown, according to the position of the camera E, the coordinates of the four vertices of the near section of the bounding box and the coordinates of the four vertices of the far section of the bounding box are calculated.

[0081] In step S430, the three-dimensional bounding box where the particle group is located is divided into a plurality of voxel units.

[0082] In an exemplary embodiment, a predetermined division unit is defined according to the minimum resolvable unit size of the current space relative to the camera, and the three-dimensional bounding box of the particle group is divided into a plurality of voxel units using the predetermined division unit. Figure 5 As shown, the predetermined division unit is assumed to be a cubic voxel unit, and the particles in the three-dimensional bounding box 510 of the particle group are divided into a plurality of voxel units 515 .

[0083] In step S440 , based on the attribute information of each particle, the voxel unit is segmented to generate a particle voxel bounding box.

[0084] In an exemplary embodiment, based on the attribute information of the particles, such as the position of the particles relative to the viewpoint, the life cycle of the particles, the transparency of the particles, etc., the particles in the voxel unit are region segmented or aggregated to generate particle voxel bounding boxes, each particle voxel bounding box corresponds to a particle voxel of a certain shape, and particle voxels of different shapes correspond to different shading rates.

[0085] For example, the voxel unit is segmented or aggregated into a number of particle voxel bounding boxes of different sizes through the point cloud segmentation model, and each particle voxel bounding box corresponds to a particle voxel of a certain shape.

[0086] For example, refer to Figure 5 As shown, the voxel unit is segmented into a plurality of particle voxel bounding boxes 525 through the point cloud segmentation model 520, such as particle voxel bounding boxes 525 of sizes such as 1x1x1, 1x2x2, 2x2x2, 2x2x4, 2x4x4, etc.

[0087] In the example embodiment, the point cloud segmentation model 520 may be a Mask-RCNN model. However, those skilled in the art should understand that the point cloud segmentation model may also be other appropriate region segmentation models such as a Faster RCNN model, etc., and the embodiment of the present application does not specifically limit this.

[0088] In step S450 , particles in the particle voxel bounding box are rendered according to shading rates corresponding to particle voxels of various shapes.

[0089] In an example embodiment, particles within a particle voxel bounding box are rendered according to a shading rate of a particle voxel corresponding to the particle voxel bounding box.

[0090] For example, the particles in the particle voxel bounding box are downsampled to obtain sampling points such as the center points of the particle voxel points, and the particles in the particle voxel bounding box are rendered based on the rendering mode of the sampling points and the shading rate of the particle voxels corresponding to the particle voxel bounding box. Fig. 9 As shown, based on the rendering method of the center point of the particle voxel, the particles in the particle voxel bounding box are rendered according to the shading rate of the particle voxel corresponding to the particle voxel bounding box.

[0091] according to Figure 4 According to the technical solution in the example embodiment, on the one hand, the three-dimensional bounding box where the particle group is located is divided into multiple voxel units, and based on the attribute information of the particles, the voxel units are aggregated into a particle voxel bounding box. By establishing the particle voxel bounding box, the number of particles in the bounding box can be reduced, the DrawCall can be reduced, and the rendering performance of the particle system can be optimized; on the other hand, for the detail area that requires high-quality display, more particles can be generated by interpolation, the rendering quality can be improved, and the rendering optimization of the particle system can be achieved.

[0092] Furthermore, in the exemplary embodiment, different shapes of particle voxel shading volumes are defined, such as Figure 7 As shown, various shapes of particle voxels are included, including 1x1x1, 1x2x1, 1x1x2, 1x2x2, 2x2x2, 1x1x4, 2x1x4, 1x2x4, 2x4x2, 2x2x4, 2x4x4, etc. Among them, the original particle point is the original particle contained in the particle voxel, and the sampling point actually drawn is the sampling point of the space where the particle voxel is located. Generally, the sampling point is the center point of the space where the particle voxel is located.

[0093] Further, each particle space corresponds to a particle voxel of a certain shape, and the shading rate of the particle voxel corresponds to the shape of the particle voxel. When generating a particle voxel bounding box, a corresponding relationship table between the index identifier of the particle space and the particle voxel is generated. In an exemplary embodiment, determining the shading rate of the particle voxel corresponding to each particle space includes: determining the index identifier of each particle space; and determining the shading rate of the particle voxel corresponding to each particle space according to the corresponding relationship between the index identifier and the shading rate of the particle voxel.

[0094] Figure 8 A schematic diagram showing the correspondence between the index identifier of the particle space and the particle voxel provided in the embodiment of the present application is shown. Figure 8As shown in the figure, the left side is the three-dimensional space where the particle group is located, and the middle is the particle space corresponding to the particle group. When the index mark of the particle space is 0, the corresponding particle voxel shape is 1x1x1; when the index mark of the particle space is 2, the corresponding particle voxel shape is 1x2x2; when the index mark of the particle space is 6, the corresponding particle voxel shape is 4x4x2. In other words, when the index mark of the particle space is 0, the shading rate of the corresponding particle voxel is 1x1x1; when the index mark of the particle space is 2, the shading rate of the corresponding particle voxel is 1x2x2; when the index mark of the particle space is 6, the shading rate of the corresponding particle voxel is 4x4x2.

[0095] By establishing a correspondence between the index identifier of the particle space and the particle voxel, the shading rate of each particle space can be efficiently determined, thereby further reducing the rendering overhead of the graphics processor and improving the rendering efficiency of the particles in the particle system.

[0096] Furthermore, the point cloud segmentation model can be trained using a machine learning model such as a Mask-RCNN model. For example, determine the three-dimensional bounding boxes of particle swarms in various sample scenes; divide the three-dimensional bounding boxes of particle swarms in various sample scenes into a plurality of particle voxel bounding boxes; generate sample data in various sample scenes according to the particle voxel bounding boxes corresponding to the particle swarms in various sample scenes; and train the point cloud segmentation model according to the sample data. For example, generate sample data for scenes such as atmosphere, clouds, and fog, i.e., labeled data GroundTruth, and train the point cloud segmentation model using the sample data.

[0097] Reference Fig.10 As shown, a ray tracing method is adopted. For each pixel point of the sample scene, such as point p(x, y), a ray is emitted in the direction of the pixel point pointed by the camera; the first particle in the particle group of the sample scene, such as point P(Xw, Yw, Zx), hit by the ray is taken as the starting point sample particle; the starting point particle is taken as the current sample point particle, and the current sample point particle is updated with a predetermined step length until the boundary of the particle group is reached; based on the depth of the current sample point particle, the projection plane where the current sample point particle is located is determined; based on the projection plane and the attribute information of the particle, the particle voxel bounding box surrounding the current sample point particle and the neighboring particles of the current sample point particle is determined in combination with the particle voxel. For example, the particles within the predetermined angle range of the emitted light, such as the angle range of 1 degree or 2 degrees, are wrapped in the particle voxel bounding box. Further, according to the particle voxel bounding box generated under the sample scene, the sample data corresponding to the sample scene is generated.

[0098] exist Fig.10There are 4 coordinate systems, among which Ow-XwYwZw is the world coordinate system, describing the camera position, with the unit of m; Oc-XcYcZc is the camera coordinate system, with the optical center as the origin, with the unit of m; O-xy is the image coordinate system, with the optical center as the midpoint of the image, with the unit of mm; uv is the pixel coordinate system, with the origin in the upper left corner of the image, with the unit of pixel. Point P (Xw, Yw, Zx) is the coordinate point in the world coordinate system, that is, the point in the scene to be rendered; point p (x, y) is the coordinate point in the image coordinate system, that is, the imaging point of point P in the image, with the coordinates in the image coordinate system (x, y), and the coordinates in the pixel coordinate system (u, v); f is the focal length of the camera.

[0099] The three-dimensional space where the particle swarm is located is divided into multiple particle voxel bounding boxes through a machine learning model. The particle swarm in various scenes can be accurately and efficiently divided into bounding boxes in the shape of particle voxels, so that the particles in the bounding boxes can be efficiently rendered.

[0100] Furthermore, in the scenario of 3D scene reconstruction, the types of each particle group of the scene to be rendered are determined; and according to the type of the particle group, the three-dimensional space where the particle group is located is divided into multiple particle spaces. In an exemplary embodiment, the point cloud segmentation model of the embodiment of the present application can be used to perform object detection and segmentation on the scene to be rendered in the image, determine the type of the particle group of each object, and divide the three-dimensional space where the particle group is located according to the type of the particle group.

[0101] For example, for objects that require high-quality rendering, such as tables, people, doors, etc., smaller particle voxels such as 1x1x1 are used to divide the three-dimensional space where the particle group is located; while for point clouds of other objects that do not require high-quality rendering, larger particle voxels such as 2x4x4 are used to divide the three-dimensional space where the particle group is located. In addition, for object types that require high-quality rendering, the particles in the bounding box can be upsampled or super-resolution reconstructed; for other object types that do not require high-quality rendering, downsampling can be performed.

[0102] According to the technical solution in the above embodiment, based on dividing the three-dimensional space where the particle group is located according to the type of particle group, different shading rates can be used for rendering according to the type of object to be rendered, so that rendering can be performed according to the display requirements of various objects in different scenes. On the one hand, upsampling the particles can enrich the details of high-quality rendered objects and improve the rendering quality; on the other hand, downsampling the particles can reduce Drawcall and optimize the performance of the GPU.

[0103] In addition, in an exemplary embodiment, in a particle system such as volumetric cloud and volumetric fog that can be penetrated by light, it is necessary to consider the mutual mixing of particles, for example, it is necessary to consider the transparency of the particles. For particles with higher transparency, light overlap will occur. For example, if the particle group of the scene to be rendered is a particle group that can be penetrated by light, the distance of each particle in the particle group along the light is determined; according to the distance of each particle in the particle group along the light and the attribute information of the particles, the three-dimensional space where the particle group is located is divided into multiple particle spaces. The direction of the light is the direction of the light emitted by the camera pointing to the particles of the particle group, and the distance of the particle along the light represents the distance between the particle position and the camera position, or the distance between the particle position and the viewpoint position.

[0104] like Fig.11 As shown, the particles in the smaller circle are closer to the line of sight or light, and require higher quality rendering. Downsampling is not required, so 1x1x1 particle voxels are used to divide them. The two particles in the larger circle are farther away from the line of sight, so downsampling is performed and 1x2x1 particle voxels are used to represent them.

[0105] According to the technical solution in the above embodiment, in a particle system that light can penetrate, the particle group touched by the line of sight is dynamically divided into different particle voxel shading volumes according to the distance of the particles from the viewpoint or camera position along the direction of the light, thereby reducing the number of particles that need to be mixed and optimizing rendering performance.

[0106] Furthermore, the distance and transparency of each particle in the particle group along the light are determined; based on the distance and transparency, a weighted operation is performed on the color of each particle to determine the coloring of the particles along the light. Fig.12 As shown, the distance and transparency of particles along a predetermined light ray in a particle group are determined, and the distance and transparency of the particles are used as weights to perform weighted calculations on the colors of the particles along the light ray to determine the coloring of the particles along the light ray.

[0107] According to the technical solution in the above embodiment, in a particle system that can penetrate light, by taking the distance of the particles along the light and the transparency as weights and performing weighted operations on the colors of the particles along the light, the coloring of the particles can be made closer to the real scene and the coloring result can be made more natural.

[0108] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0109] See also Fig.13, which shows a schematic diagram of the structure of an image rendering device provided by an exemplary embodiment of the present application. The image rendering device can be implemented as all or part of the device through software, hardware or a combination of both. The device 1300 includes a space determination module 1310, a space division module 1320 and a shading rendering module 1330.

[0110] A space determination module is used to determine the three-dimensional space where the particle group of the scene to be rendered in the image is located;

[0111] A space division module, used for dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of which corresponds to a particle voxel of a certain shape;

[0112] The shading and rendering module is used to render the particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes.

[0113] In some example embodiments, based on the above solution, the space division module includes:

[0114] An attribute determination unit, used to determine the attribute information of each particle in the particle group;

[0115] The region segmentation unit is used to perform region segmentation processing on the three-dimensional space where the particle group is located according to the attribute information of the particles, so as to generate a plurality of the particle spaces.

[0116] In some example embodiments, based on the above solution, the three-dimensional space where the particle group is located is a three-dimensional bounding box, the particle space is a particle voxel bounding box, and the region segmentation unit includes:

[0117] A unit division module, used for dividing the three-dimensional bounding box where the particle group is located into a plurality of voxel units according to a predetermined division unit;

[0118] The aggregation processing module is used to perform aggregation processing on the multiple voxel units according to the attribute information of each particle in the particle group, and generate a particle voxel bounding box corresponding to the particle voxel.

[0119] In some example embodiments, based on the above solution, the aggregation processing module is configured as follows:

[0120] Obtaining attribute information of each particle in the particle group;

[0121] Based on the attribute information of each particle, the plurality of voxel units are aggregated through a point cloud segmentation model.

[0122] In some example embodiments, based on the above solution, the apparatus further includes: a sample training module, wherein the sample training module is configured to:

[0123] Determine the three-dimensional bounding box of the particle swarm for various sample scenarios;

[0124] Dividing the three-dimensional bounding box of the particle group of various sample scenes into a plurality of particle voxel bounding boxes;

[0125] Generate sample data for various sample scenes according to the particle voxel bounding boxes corresponding to the particle groups of various sample scenes;

[0126] The point cloud segmentation model is trained according to the sample data.

[0127] In some example embodiments, based on the above solution, the sample training module is further configured to:

[0128] Using ray tracing, a ray is emitted from each pixel of the sample scene in the direction of the camera;

[0129] The first particle in the particle group of the sample scene hit by the light is used as the first sample point particle, and the second sample point particle is determined with a predetermined step length;

[0130] Based on the depth of the sample point particle, determining the projection plane where the sample point particle is located;

[0131] Based on the projection plane and the property information of the particle, a particle voxel bounding box that surrounds the sample point particle and neighboring particles of the sample point particle is determined in combination with the particle voxel.

[0132] In some example embodiments, based on the above solution, the attribute information includes one or more of the position of the particle relative to the viewpoint, the life cycle of the particle, and the transparency of the particle.

[0133] In some example embodiments, based on the above solution, the shading rendering module 1330 includes:

[0134] A sampling unit, used for sampling particles in each of the particle spaces to obtain sampling points;

[0135] A shading rate determination unit, used to determine a shading rate of a particle voxel corresponding to each particle space;

[0136] The variable speed rendering unit is used to render the particles in each of the particle spaces according to the shading rate corresponding to each of the particle spaces based on the rendering mode of the sampling points.

[0137] In some example embodiments, based on the above scheme, the shading rate determination unit is configured to:

[0138] Determine the index identification of each particle space;

[0139] The coloring rate of the particle voxel corresponding to each particle space is determined according to the corresponding relationship between the index identifier and the coloring rate of the particle voxel.

[0140] In some example embodiments, based on the above solution, the apparatus further includes:

[0141] The interpolation processing module is used to perform interpolation processing on the particles in the particle space before rendering the particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes, so as to generate new particles in the particle space.

[0142] In some example embodiments, based on the above solution, the scene to be rendered is a three-dimensional scene reconstruction, and the device further includes:

[0143] A type determination module, used to determine the type of each particle group of the scene to be rendered;

[0144] The space division module 1320 is configured to:

[0145] According to the type of the particle group, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

[0146] In some example embodiments, based on the above solution, the space division module 1320 is further configured to:

[0147] If the particle group of the scene to be rendered is a particle group that can be penetrated by light, then determining the distance of each particle in the particle group along the light;

[0148] According to the distance of each particle in the particle group along the light and the attribute information of the particle, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

[0149] In some example embodiments, based on the above solution, the apparatus further includes:

[0150] A weight determination module, used to determine the distance and transparency of each particle in the particle group along the light;

[0151] The coloring determination module is used to perform a weighted operation on the color of each particle based on the distance and transparency to determine the coloring of the particle.

[0152] It should be noted that, when the image rendering device provided in the above embodiment executes the image rendering method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the image rendering device provided in the above embodiment and the image rendering method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0153] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0154] An embodiment of the present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the image rendering method as described in the above embodiment. The specific execution process can be found in the specific description of the above embodiment, and will not be repeated here.

[0155] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded by the processor and executes the image rendering method as described in the above embodiment. The specific execution process can be found in the specific description of the above embodiment, which will not be repeated here.

[0156] See also Fig.14 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.14 As shown, the electronic device 1400 may include: at least one processor 1401 , at least one network interface 1404 , an input / output interface 1403 , a memory 1405 , and at least one communication bus 1402 .

[0157] The communication bus 1402 is used to realize the connection and communication between these components.

[0158] The input / output interface 1403 may include a display screen (Display) and a camera (Camera), and the optional input / output interface 1403 may also include a standard wired interface and a wireless interface.

[0159] The network interface 1404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0160] Among them, the processor 1401 may include one or more processing cores. The processor 1401 uses various interfaces and lines to connect various parts of the entire electronic device 1400, and executes various functions and processes data of the electronic device 1400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1405, and calling data stored in the memory 1405. Optionally, the processor 1401 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1401 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1401, and it can be implemented separately through a chip.

[0161] Among them, the memory 1405 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1405 includes a non-transitory computer-readable storage medium. The memory 1405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1405 may also be optionally at least one storage device located away from the aforementioned processor 1401. As Fig.14 As shown, the memory 1405 as a computer storage medium may include an operating system, a network communication module, an input and output interface module, and an image rendering application.

[0162] exist Fig.14In the electronic device 1400 shown, the input / output interface 1403 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1401 can be used to call the image rendering application stored in the memory 1405 and specifically perform the following operations:

[0163] Determine the three-dimensional space where the particle group of the scene to be rendered in the image is located;

[0164] Dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of the particle spaces corresponds to a particle voxel of a certain shape;

[0165] Particles in the particle space are rendered according to shading rates corresponding to particle voxels of various shapes.

[0166] In some embodiments, based on the above scheme, the three-dimensional space where the particle group is located is a three-dimensional bounding box, and the particle space is a particle voxel bounding box. When the processor 1401 divides the three-dimensional space where the particle group is located into multiple particle spaces, the processor 1401 specifically performs the following operations:

[0167] Dividing the three-dimensional bounding box where the particle group is located into a plurality of voxel units according to a predetermined division unit;

[0168] According to the attribute information of each particle in the particle group, the plurality of voxel units are aggregated to generate a particle voxel bounding box corresponding to the particle voxel.

[0169] In some embodiments, based on the above solution, the processor 1401 specifically performs the following operations when performing the aggregation process on the multiple voxel units according to the attribute information of each particle in the particle group:

[0170] Obtaining attribute information of each particle in the particle group;

[0171] Based on the attribute information of each particle, the plurality of voxel units are aggregated through a point cloud segmentation model.

[0172] In some embodiments, based on the above solution, the processor 1401 further performs the following operations:

[0173] Determine the three-dimensional bounding box of the particle swarm for various sample scenarios;

[0174] Dividing the three-dimensional bounding box of the particle group of various sample scenes into a plurality of particle voxel bounding boxes;

[0175] Generate sample data for various sample scenes according to the particle voxel bounding boxes corresponding to the particle groups of various sample scenes;

[0176] The point cloud segmentation model is trained according to the sample data.

[0177] In some embodiments, based on the above solution, the processor 1401 specifically performs the following operations when executing the step of dividing the three-dimensional bounding box of the particle group of various sample scenes into a plurality of particle voxel bounding boxes:

[0178] Using ray tracing, a ray is emitted from each pixel of the sample scene in the direction of the camera;

[0179] The first particle in the particle group of the sample scene hit by the light is used as the first sample point particle, and the second sample point particle is determined with a predetermined step length;

[0180] Based on the depth of the sample point particle, determining the projection plane where the sample point particle is located;

[0181] Based on the projection plane and the property information of the particle, a particle voxel bounding box that surrounds the sample point particle and neighboring particles of the sample point particle is determined in combination with the particle voxel.

[0182] In some embodiments, based on the above scheme, the attribute information includes one or more of the position of the particle relative to the viewpoint, the life cycle of the particle, and the transparency of the particle.

[0183] In some embodiments, based on the above solution, when the processor 1401 performs the rendering of particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes, the processor 1401 specifically performs the following operations:

[0184] Sampling particles in each of the particle spaces to obtain sampling points;

[0185] Determine the shading rate of the particle voxels corresponding to each particle space;

[0186] Based on the rendering mode of the sampling points, the particles in each of the particle spaces are rendered according to the shading rates corresponding to each of the particle spaces.

[0187] In some embodiments, based on the above solution, the processor 1401 specifically performs the following operations when determining the shading rate of the particle voxels corresponding to each particle space:

[0188] Determine the index identification of each particle space;

[0189] The coloring rate of the particle voxel corresponding to each particle space is determined according to the corresponding relationship between the index identifier and the coloring rate of the particle voxel.

[0190] In some embodiments, based on the above solution, before rendering the particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes, the processor 1401 further performs the following operations:

[0191] Interpolation processing is performed on the particles in the particle space to generate new particles in the particle space.

[0192] In some embodiments, based on the above solution, the scene to be rendered is a three-dimensional scene reconstruction, and the processor 1401 further performs the following operations:

[0193] Determine the type of each particle group of the scene to be rendered;

[0194] The step of dividing the three-dimensional space where the particle group is located into a plurality of particle spaces comprises:

[0195] According to the type of the particle group, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

[0196] In some embodiments, based on the above solution, the processor 1401 specifically performs the following operations when dividing the three-dimensional space where the particle group is located into multiple particle spaces:

[0197] If the particle group of the scene to be rendered is a particle group that can be penetrated by light, then determining the distance of each particle in the particle group along the light;

[0198] According to the distance of each particle in the particle group along the light and the attribute information of the particle, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

[0199] In some embodiments, based on the above solution, the processor 1401 further performs the following operations:

[0200] determining the distance and transparency of each particle in the particle group along the light ray;

[0201] Based on the distance and transparency, the color of each particle is weighted to determine the coloring of the particles along the ray.

[0202] The above is a schematic scheme of an electronic device in an embodiment of this specification. It should be noted that the technical scheme of the electronic device and the technical scheme of the above-mentioned image rendering processing method belong to the same concept, and the details not described in detail in the technical scheme of the electronic device can be referred to the description of the technical scheme of the above-mentioned image rendering processing method.

[0203] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.

[0204] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0205] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. An image rendering method, characterized in that: include: Determine the three-dimensional space where the particle group of the scene to be rendered in the image is located; Dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of the particle spaces corresponds to a particle voxel of a certain shape; Rendering particles in the particle space according to shading rates corresponding to the particle voxels of various shapes; The step of dividing the three-dimensional space where the particle group is located into a plurality of particle spaces comprises: If the particle group of the scene to be rendered is a particle group that can be penetrated by light, then determining the distance of each particle in the particle group along the light; According to the distance of each particle in the particle group along the light and the attribute information of the particle, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

2. The method according to claim 1, characterized in that: The step of dividing the three-dimensional space where the particle group is located into a plurality of particle spaces comprises: Determining attribute information of each particle in the particle group; According to the attribute information of the particles, the three-dimensional space where the particle group is located is subjected to region segmentation processing to generate a plurality of the particle spaces.

3. The method according to claim 2, characterized in that The three-dimensional space where the particle group is located is a three-dimensional bounding box, and the particle space is a particle voxel bounding box. According to the attribute information of the particles, the three-dimensional space where the particle group is located is subjected to region segmentation processing to generate a plurality of the particle spaces, including: Dividing the three-dimensional bounding box where the particle group is located into a plurality of voxel units according to a predetermined division unit; performing aggregation processing on the plurality of voxel units according to the attribute information of each particle in the particle group; A particle voxel bounding box corresponding to the particle voxel is generated.

4. The method according to claim 3, characterized in that The step of performing aggregating processing on the plurality of voxel units according to the attribute information of each particle in the particle group includes: Obtaining attribute information of each particle in the particle group; Based on the attribute information of each particle, the plurality of voxel units are aggregated through a point cloud segmentation model.

5. The method according to claim 4, characterized in that The method further comprises: Determine the three-dimensional bounding box of the particle swarm for various sample scenarios; Dividing the three-dimensional bounding box of the particle group of various sample scenes into a plurality of particle voxel bounding boxes; Generate sample data for various sample scenes according to the particle voxel bounding boxes corresponding to the particle groups of various sample scenes; The point cloud segmentation model is trained according to the sample data.

6. The method according to claim 5, characterized in that The step of dividing the three-dimensional bounding box of the particle group of various sample scenes into a plurality of particle voxel bounding boxes comprises: Using ray tracing, for each pixel point of the sample scene, a ray is emitted in the direction in which the camera points to the pixel point; Taking the particle in the particle group of the sample scene hit by the light as the current sample point particle, and updating the current sample point particle with a predetermined step length; Based on the depth of the particle at the current sample point, determining the projection plane where the particle at the current sample point is located; Based on the projection plane and the property information of the particle, a particle voxel bounding box that surrounds the current sample point particle and neighboring particles of the current sample point particle is determined in combination with the particle voxel.

7. The method according to any one of claims 2 to 6, characterized in that The attribute information includes one or more of a position of the particle relative to a viewpoint, a life cycle of the particle, and a transparency of the particle.

8. The method according to any one of claims 1 to 6, characterized in that The rendering of particles in the particle space according to shading rates corresponding to the particle voxels of various shapes includes: Sampling particles in each of the particle spaces to obtain sampling points; Determining a shading rate of a particle voxel corresponding to each of the particle spaces; Based on the rendering mode of the sampling points, the particles in each of the particle spaces are rendered according to the shading rates corresponding to each of the particle spaces.

9. The method according to claim 8, characterized in that Determining the shading rate of the particle voxels corresponding to each of the particle spaces includes: Determine the index identification of each particle space; The coloring rate of the particle voxel corresponding to each particle space is determined according to the corresponding relationship between the index identifier and the coloring rate of the particle voxel.

10. The method according to claim 1, characterized in that Before rendering the particles in the particle space according to the shading rates corresponding to the particle voxels of various shapes, the method further includes: Interpolation processing is performed on the particles in the particle space to generate new particles in the particle space.

11. The method according to any one of claims 1 to 6, characterized in that The scene to be rendered is a three-dimensional scene reconstruction, and the method further includes: Determine the type of each particle group of the scene to be rendered; The step of dividing the three-dimensional space where the particle group is located into a plurality of particle spaces comprises: According to the type of the particle group, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

12. The method according to claim 1, characterized in that The method further comprises: determining the distance and transparency of each particle in the particle group along the light ray; Based on the distance and transparency, the color of each particle is weighted to determine the coloring of the particles along the ray.

13. An image rendering device, characterized in that: include: A space determination module is used to determine the three-dimensional space where the particle group of the scene to be rendered in the image is located; A space division module, used for dividing the three-dimensional space where the particle group is located into a plurality of particle spaces, each of which corresponds to a particle voxel of a certain shape; A shading and rendering module, used for rendering particles in the particle space according to shading rates corresponding to the particle voxels of various shapes; The space division module is specifically used to determine the distance of each particle in the particle group along the light if the particle group of the scene to be rendered is a particle group that can be penetrated by light; According to the distance of each particle in the particle group along the light and the attribute information of the particle, the three-dimensional space where the particle group is located is divided into a plurality of particle spaces.

14. A computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 12.

15. An electronic device, comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Particle effect editing method and system based on Unity3D and NGUI

    CN106952329A

  • Virtual model rendering method and device, storage medium and electronic equipment

    CN113648655A