Rendering processing method, device, electronic device and storage medium
By generating rendering identifiers and creating map allocation arrays, the problem of handover at texture connections when rendering transparent materials is solved, improving visual effects and reducing rendering performance pressure.
Patent Information
- Application Number
- CN202510041555.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the prior art, when rendering transparent materials, especially when multiple glass blocks are adjacent, handovers will occur at the texture connection, affecting the visual effect, and it is difficult to achieve a balance between rendering performance and visual effect.
By generating the rendering identifier of each plane of voxel unit, it represents the adjacent relationship between voxel units. Based on the corresponding relationship between the rendering identifier and the material type, a map allocation array is established, and the map data of multiple material types is stored in the preset order. In the rendering phase, multiple voxel units are rendered according to the rendering identifier and map allocation array of the plane.
It effectively avoids texture handover at the connections in the rendering results, improves the visual effect of transparent materials, and reduces the rendering performance pressure to a certain extent.
Smart Images

Figure CN119444968B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphics rendering technology, and in particular to a rendering processing method, device, electronic device and storage medium. Background Art
[0002] Real-time rendering is a technology that generates three-dimensional images in a short period of time. It is widely used in games, virtual reality and other fields. Computers use the parallel computing power of graphics processing units to achieve efficient image processing. In game scenes, real-time rendering tasks for transparent materials are involved. Transparent materials need to simulate the refraction, reflection and projection of light through the surface, while ensuring the correct rendering order of the scene. When processing transparent objects such as glass materials, they are usually rendered with only one map. When multiple glass blocks are adjacent, the textures will intersect at the joints, affecting the visual effect. It will also cause performance pressure and it is impossible to achieve a good balance between rendering performance and visual effects. Summary of the invention
[0003] One purpose of the present application is to provide a rendering processing method, device, electronic device and storage medium for improving the rendering visual effect of transparent materials.
[0004] According to one aspect of an embodiment of the present application, a rendering processing method is provided, including:
[0005] Generate a rendering mark of each azimuth plane according to the adjacent plane information of each azimuth plane of the voxel unit, wherein the rendering mark is used to indicate the adjacent relationship between the voxel units based on the azimuth plane, and the azimuth plane is the plane of the voxel unit in each coordinate direction;
[0006] Based on the correspondence between the rendering identifier and the material type, a texture allocation array is established, wherein the texture allocation array is used to store texture data of multiple material types in a preset order;
[0007] According to the rendering identifier of the orientation plane and the texture allocation array, texture rendering is performed on a plurality of the voxel units.
[0008] According to one aspect of an embodiment of the present application, a rendering processing device is provided, including:
[0009] A rendering mark generation module, used to generate a rendering mark of each azimuth plane according to the adjacent plane information of each azimuth plane of the voxel unit, wherein the rendering mark is used to indicate the adjacent relationship between the voxel units based on the azimuth plane, and the azimuth plane is the plane of the voxel unit in each coordinate direction;
[0010] A texture allocation module, used to establish a texture allocation array based on the correspondence between the rendering identifier and the material type, wherein the texture allocation array is used to store texture data of multiple material types in a preset order;
[0011] A rendering module is used to perform texture rendering on a plurality of the voxel units according to the rendering identifier of the orientation plane and the texture allocation array.
[0012] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the methods provided in the above-mentioned various optional implementation modes.
[0013] According to one aspect of an embodiment of the present application, a computer program medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the methods provided in the above-mentioned various optional implementations.
[0014] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementations.
[0015] In the present application, a rendering identifier for each azimuthal plane is generated based on the adjacent surface information of each azimuthal plane of the voxel unit. The rendering identifier is based on the azimuthal plane and indicates the adjacent relationship between the voxel units. The azimuthal plane is the plane of the voxel unit in each coordinate direction. Based on the correspondence between the rendering identifier and the material type, a texture allocation array is established to store texture data of multiple material types. The material type of the texture data is related to the rendering identifier. The texture data of multiple material types are stored in the texture allocation array according to a preset order, which can quickly complete the allocation of the texture data. In the rendering stage, texture rendering is performed on multiple voxel units based on the rendering identifier of the azimuthal plane and the texture allocation array. When rendering objects of transparent materials, rendering is performed according to the adjacent surface information of each azimuthal plane of the voxel unit to ensure the visual effect after the final rendering, which can reduce the rendering performance pressure to a certain extent.
[0016] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0017] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0019] Figure 1 A flowchart of a rendering processing method provided by an embodiment of the present application is shown.
[0020] Figure 2 A schematic diagram showing the placement positions between voxel units and the adjacent surface information of each plane.
[0021] Figure 3 A schematic diagram of the structure of a rendering processing device provided by an embodiment of the present application is shown.
[0022] Figure 4 A schematic structural diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0024] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0025] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0026] The rendering of transparent materials is more complicated in the graphics rendering process, because transparent materials need to handle complex light interactions, including refraction, reflection, light and shadow occlusion, and color overlay. Transparent materials in the game field mainly involve glass, water, plastic, etc.
[0027] In the game scene, the implementation of seamless glass is to simulate the transparency, continuity and optical effects of glass in the three-dimensional scene, while avoiding rendering obvious seams or boundaries. In order to achieve this effect, it is necessary to ensure that there are no visible boundaries at the joints or connections of the glass during the rendering process.
[0028] When processing glass materials, the existing technology usually only uses one kind of texture rendering. When multiple glass blocks are connected or adjacent, texture intersections will appear at the connection points, affecting the visual effect.
[0029] Figure 1 A schematic diagram of a rendering process provided by an embodiment of the present application is shown, and the method comprises the following steps:
[0030] S100, generating a rendering identifier of each azimuth plane according to the neighboring plane information of each azimuth plane of the voxel unit, wherein the rendering identifier is used to indicate the neighboring relationship between the voxel units based on the azimuth plane, and the azimuth plane is the plane of the voxel unit in each coordinate direction.
[0031] S200, based on the correspondence between the rendering identifier and the material type, a texture allocation array is established, where the texture allocation array is used to store texture data of multiple material types in a preset order.
[0032] S300, performing texture rendering on a plurality of voxel units according to the rendering identifier of the azimuth surface and the texture allocation array.
[0033] Specifically, a voxel is a volume pixel in a three-dimensional space. A voxel unit refers to the smallest unit that constitutes a three-dimensional model in a three-dimensional space, and a cube is used to represent a volume unit in the space.
[0034] The orientation plane of a voxel unit refers to the plane of the voxel unit in different coordinate axis directions, that is, the relative position of each orientation plane in three-dimensional space is different. For a cubic voxel unit located in three-dimensional space, the direction of each orientation plane can be expressed according to the normal vector of the three-dimensional coordinate axis:
[0035] Front Face, the normal vector points to +Z;
[0036] Back Face, the normal vector points to -Z;
[0037] Left Face, the normal vector points to -X;
[0038] Right Face, the normal vector points to +X;
[0039] Top Face, the normal vector points to +Y;
[0040] Below (Bottom Face), the normal vector points to -Y.
[0041] In a three-dimensional scene, if multiple voxel units are stacked, in the process of rendering the voxel units into transparent materials, firstly, a rendering identifier for rendering is obtained according to the adjacent relationship between each voxel unit and other voxel units.
[0042] In this embodiment, each azimuth plane of each voxel unit is used as a reference, and the adjacent plane information of each azimuth plane is obtained according to a preset rule to obtain a rendering mark of each azimuth plane.
[0043] The rendering identifier of each azimuth plane is determined based on the adjacent relationship between the azimuth plane and other voxel units, and can indicate whether there are other voxel units in each direction of the azimuth plane. Based on the adjacent relationship between the azimuth plane and the azimuth planes of other voxel units, the rendering identifier of the azimuth plane of the voxel unit is generated.
[0044] This means that the adjacent relationship between a certain azimuth plane of a voxel unit and the azimuth planes of other voxel units is different, and the rendering identifier is also different. In other words, the rendering identifier of the azimuth plane can indicate the adjacent relationship between the azimuth plane and other voxel units; for a voxel unit, the rendering identifiers of all azimuth planes can indicate the adjacent relationship between the voxel unit and other voxel units.
[0045] When obtaining the adjacent surface information of each azimuth surface, it is obtained between voxel units and is determined based on the surface in the same coordinate axis direction of the voxel unit.
[0046] For example, there are two voxel units vertically overlapped, and voxel unit 1 is above voxel unit 2. Taking the front of voxel unit 1 as an example, on the two-dimensional plane where the front of voxel unit 1 is located, it only has an adjacent surface below, that is, the front of voxel unit 2.
[0047] Similarly, the right side of voxel unit 1 has an adjacent side below it, which is the right side of voxel unit 2.
[0048] The material type corresponds to the rendering identifier. The rendering identifier is used to indicate the adjacent relationship of each azimuth surface of the voxel unit. When rendering, different material types of maps should be used for rendering according to the adjacent relationship of the azimuth surfaces to ensure the visual effect of the transparent material.
[0049] Rendering identifiers can indicate the connection relationship and relative position of each voxel unit, which can effectively avoid texture intersections at the joints in the rendering results, thereby presenting better visual effects.
[0050] By establishing a texture allocation array, the correspondence between the rendering identifier and the material type is stored in the texture allocation array according to a preset order.
[0051] It should be noted that the texture allocation array may only store the index of the texture data, and the corresponding texture data can be quickly found according to the index.
[0052] As an optional implementation, when creating texture data, an index relationship is established between the texture data and the rendering identifier, and the rendering identifier and the index relationship are stored in a texture allocation array, so as to achieve the effect of dynamically allocating texture data during the rendering process.
[0053] During the rendering process, the corresponding texture data is obtained by reading the data of the texture allocation array through the rendering identifier of the voxel unit.
[0054] In this embodiment, a rendering identifier of each azimuthal surface is generated according to the adjacent surface information of each azimuthal surface of the voxel unit; the rendering identifier can represent the adjacent relationship between the voxel units based on the azimuthal surface, and establish the texture allocation data based on the corresponding relationship between the rendering identifier and the material type; the texture allocation data can obtain the texture data of the azimuthal surfaces with different adjacent relationships according to the rendering identifier, and store the texture data of multiple material types in the texture allocation array according to the preset order, so as to quickly complete the allocation of the texture data; in the rendering stage, texture rendering is performed on multiple voxel units according to the rendering identifier of the azimuthal surface and the texture allocation array, and when rendering an object of transparent material, texture rendering is performed according to the adjacent surface information of each azimuthal surface of the voxel unit, and when rendering an object of transparent material, different texture data is selected according to the rendering identifier, so as to use different texture data according to the adjacent relationship between each azimuthal surface of the voxel unit and other voxel units, so as to ensure the visual effect of the final rendering, and to reduce the rendering performance pressure to a certain extent.
[0055] Further, S100, generating a rendering mark of each azimuth surface according to the adjacent surface information of each azimuth surface of the voxel unit, including:
[0056] S110, based on the adjacent relationship between the voxel units, obtain the adjacent surface information of each orientation surface of the voxel unit in multiple directions.
[0057] S120, generating a rendering identifier according to the adjacent surface information of the azimuth plane in each direction, wherein the number of digits of the rendering identifier is the same as the number of directions of the azimuth plane.
[0058] Specifically, taking a voxel unit as a cube as an example, a voxel unit has six plane parts with a certain area in different coordinate directions, which are the basic units constituting a cube, namely, the orientation planes in this embodiment.
[0059] The adjacent relationship between voxel units can further obtain the adjacent surface information of the orientation plane in each direction.
[0060] A voxel unit has an adjacent voxel unit in the left and right directions respectively. Then, taking the front of the voxel unit as the reference, there is an adjacent surface in the left direction of the front and an adjacent surface in the right direction of the front; the two adjacent surfaces are respectively the front of the voxel unit adjacent to the left of the voxel unit and the front of the voxel unit adjacent to the right of the voxel unit.
[0061] The multiple directions of the azimuth plane refer to directions on the two-dimensional plane where the azimuth plane is located, including up, down, left and right.
[0062] Get the neighboring face information of an orientation face in each direction and generate a rendering identifier, where the number of bits of the rendering identifier is the same as the number of directions.
[0063] The number of directions indicates the effective number of adjacent faces of the azimuth plane. When setting the number of directions, it is also set in which directions the adjacent faces acquired by the azimuth plane are effective. The adjacent faces detected from these directions can generate adjacent face information according to preset rules.
[0064] The number of bits of the rendering mark refers to the data bits that store the adjacent surface information of the azimuth plane in the effective direction. Each bit stores the adjacent surface information in different directions.
[0065] Furthermore, the rendering flag is stored in a bit mask form. S120, generating the rendering flag according to the adjacent surface information of the azimuth surface in each direction includes:
[0066] S121, establishing a bit mask based on the number of directions of the azimuth plane, where the number of bits of the bit mask is the same as the number of directions of the azimuth plane.
[0067] S122, according to the relationship between the field bits of the bit mask and the direction attribute, record the neighboring surface information of the azimuth plane in each direction and generate a rendering identifier. The direction attribute is used to indicate the relative relationship between the azimuth plane and the azimuth planes of other voxel units.
[0068] Specifically, the bit mask is a binary number. A bit mask with the same number of bits is established according to the number of directions of the azimuth plane, and each field bit stores the adjacent face information of the corresponding direction attribute according to the preset rules, and finally obtains the rendering mark.
[0069] The data of each data bit of the bit mask is 0 or 1, and the orientation plane is on a two-dimensional plane and due to the characteristics of the voxel unit, an orientation plane has only four directions: up, down, left and right. Therefore, the four directions of up, down, left and right can be corresponded to each data bit of the bit mask according to preset rules, and the data bit is used to store whether there are adjacent planes in the four directions of the orientation plane.
[0070] The four directions of up, down, left and right are determined according to the directions of general coordinate axes. The directions of the X-axis are the left and right directions, and the directions of the Y-axis are the up and down directions.
[0071] The positive direction of the X-axis is the right direction, and the negative direction of the X-axis is the left direction; the positive direction of the Y-axis is the upward direction, and the negative direction of the Y-axis is the downward direction.
[0072] As an optional implementation, the bit mask has four bits, which store the neighboring face information in four directions respectively. The 0th bit of the bit mask stores the neighboring face information in the left direction of the azimuth plane; the 1st bit of the bit mask stores the neighboring face information in the lower direction of the azimuth plane; the 3rd bit of the bit mask stores the neighboring face information in the right direction of the azimuth plane; and the 4th bit of the bit mask stores the neighboring face information in the upper direction of the azimuth plane.
[0073] 1 means there is an adjacent face in the corresponding direction, and 0 means there is no adjacent face in the corresponding direction. So, if a certain azimuth face of a voxel unit has an adjacent face only in the upward direction, the rendering flag of that azimuth face is 0001, which means that the azimuth face has an adjacent face only in the upward direction.
[0074] Figure 2 A schematic diagram showing the placement positions between voxel units and the adjacent surface information of each plane.
[0075] like Figure 2 As shown in FIG. 1 , voxel unit 1 and voxel unit 2 are placed vertically. Figure 2 The coordinate axis in the voxel unit indicates that the surface located in the positive direction of the X axis and parallel to the YZ plane is the front surface.
[0076] Figure 2 The left side is the projection of the front view onto the YZ plane.
[0077] The bottom is the front of voxel unit 2, and the top of voxel unit 2 is the front of voxel unit 1.
[0078] According to the above rules, taking voxel unit 2 as a reference, the front of voxel unit 2 has an adjacent surface only in the upward direction, so the rendering identifier of the front of voxel unit 2 is 0001.
[0079] Further, S200, based on the correspondence between the rendering identifier and the material type, a texture allocation array is established, including:
[0080] S210: Based on the correspondence between the rendering identifier and the material type, create index information related to the material type for the map data of each material type.
[0081] S220 , storing the rendering identifiers and corresponding index information into a texture allocation array in the order of the rendering identifiers.
[0082] Specifically, the prepared texture data is matched with the rendering identifier, and each type of texture data corresponds to a rendering identifier of a situation.
[0083] For example, based on the azimuth plane of each voxel unit, the adjacent plane information in four directions will be obtained, and there will be 16 possible rendering identification data, corresponding to 16 types of material mapping data.
[0084] When processing texture data, index information corresponding to the rendering identifier may be allocated to the texture data of each material type, and then the rendering identifier and the corresponding index information may be stored in the texture allocation array in the order of the rendering identifier.
[0085] For example, the file name of the texture data of each material type is modified to the corresponding rendering identifier. When allocating texture data, the corresponding texture data can be directly found according to the index information and the rendering can be completed, which reduces the performance pressure of graphics rendering to a certain extent.
[0086] In addition, different material types of texture data are allocated according to the rendering identifier, and different texture data are selected according to different adjacent relationships to weaken the texture connection created by the transparent material, strengthen the integrity of the transparent material, and thus improve the visual effect after rendering.
[0087] Further, S300, according to the rendering identifier of the azimuth surface and the texture allocation array, texture rendering is performed on a plurality of voxel units, including:
[0088] S310 , when rendering each azimuth surface of the voxel unit, obtaining corresponding texture data from the texture allocation array based on the rendering identifier of the azimuth surface.
[0089] S320, creating corresponding material data based on the texture data, and performing texture rendering on each azimuth surface of the voxel unit according to the material data.
[0090] Specifically, material data includes various visual properties of the surface of transparent material objects. Texture data is a tool used to control the performance of different material properties. By mapping two-dimensional texture data or procedural graphics onto the surface of three-dimensional objects, details and variations can be added to transparent materials.
[0091] The type of texture data can change the visual properties of transparent material objects. For example, the diffuse map is used to show the basic color and texture of glass; the transparency map is used to control the transparency of glass in different areas, and the transparency map with different grayscale values is used to achieve the transition from transparent to opaque.
[0092] As an optional implementation, in S300, before performing texture rendering on a plurality of voxel units according to the rendering identifier of the azimuth plane and the texture allocation array, this embodiment further includes the following steps:
[0093] Detect the visibility of each orientation surface of the voxel unit.
[0094] If the aspect surface is not visible, the rendering process of the aspect surface is blocked.
[0095] Specifically, before rendering a plurality of voxel units, the visibility of each orientation of the voxel units is detected. If some orientation surfaces are not visible, the rendering process of the orientation surfaces is shielded to reduce the amount of rendering data and reduce performance pressure.
[0096] When voxel units are placed adjacent to each other, the overlapping parts of the two voxel units are merged together, and the two planes are invisible. There is no need to render the overlapping planes, so the rendering process of the two planes can be shielded.
[0097] For example, when two voxel units are placed vertically, the bottom surface of the upper voxel unit overlaps the top surface of the lower voxel unit. From the shape of the two voxel units overlapped, this means that the bottom surface of the upper voxel unit and the top surface of the lower voxel unit are not visible, so the overlapping part does not need to be rendered.
[0098] As an optional implementation, S300, performing texture rendering on a plurality of voxel units according to the rendering identifier of the azimuth plane and the texture allocation array, includes:
[0099] S330, generating a texture atlas based on texture data of multiple material types stored in the texture allocation array.
[0100] S340, when performing texture rendering on the voxel unit, mapping material data for rendering from the texture atlas.
[0101] Specifically, a map atlas is also called a texture atlas, which is a collection of multiple small textures (maps) merged into a large texture image.
[0102] Pack multiple texture data to generate a texture atlas, and generate the corresponding UV coordinate information according to the position of each texture data in the atlas. UV coordinates are a coordinate system that maps 2D textures to the surface of a 3D model. U represents the horizontal direction, V represents the vertical direction, and the range of reference is usually [0,1].
[0103] In the texture atlas, each texture data has its own UV coordinate range, which is used to accurately extract the corresponding texture part from the texture atlas when rendering.
[0104] During the rendering process, each texture switch will bring a certain performance overhead. Using a texture atlas, since multiple textures are on the same image, when rendering multiple objects that use these textures, the number of texture switches can be reduced.
[0105] In this embodiment, the neighboring face information of each azimuth face of the voxel unit is obtained to generate a rendering identifier, and one rendering identifier corresponds to one texture data. This means that in this embodiment, multiple objects need to use the same texture data. By integrating multiple texture data into a texture atlas, the atlas can be loaded at one time during rendering without frequently switching different textures, thereby reducing the number of draw calls and texture switching, and optimizing rendering performance.
[0106] Figure 3 FIG. 1 is a schematic diagram showing the structure of a rendering processing device provided by an embodiment of the present application. Figure 3 As shown, the rendering processing device includes:
[0107] The rendering mark generation module 31 is used to generate a rendering mark for each azimuth plane according to the adjacent plane information of each azimuth plane of the voxel unit. The rendering mark is used to indicate the adjacent relationship between the voxel units based on the azimuth plane. The azimuth plane is the plane of the voxel unit in each coordinate direction.
[0108] The texture allocation module 32 is used to establish a texture allocation array based on the correspondence between the rendering identifier and the material type. The texture allocation array is used to store texture data of multiple material types in a preset order.
[0109] The rendering module 33 is used to perform texture rendering on multiple voxel units according to the rendering identifier of the azimuth plane and the texture allocation array.
[0110] Furthermore, the rendering identification generating module 31 is further configured to:
[0111] Based on the adjacent relationship between voxel units, the adjacent surface information of each orientation surface of the voxel unit in multiple directions is obtained.
[0112] A rendering identifier is generated according to the adjacent surface information of the azimuth plane in each direction, and the number of digits of the rendering identifier is the same as the number of directions of the azimuth plane.
[0113] A bit mask is created based on the number of directions of the azimuth plane, and the number of bits in the bit mask is the same as the number of directions of the azimuth plane.
[0114] According to the relationship between the field bits of the bit mask and the direction attribute, the adjacent surface information of the orientation plane in each direction is recorded to generate a rendering identifier. The direction attribute is used to indicate the relative relationship between the orientation plane and the orientation planes of other voxel units.
[0115] Furthermore, the texture allocation module 32 is further configured to:
[0116] Based on the correspondence between the rendering identifier and the material type, index information related to the material type is created for the map data of each material type.
[0117] In the order of the rendering identifiers, the rendering identifiers and the corresponding index information are stored in the texture allocation array.
[0118] Furthermore, the rendering module 33 is also configured to:
[0119] When rendering each azimuth surface of the voxel unit, the corresponding texture data is obtained from the texture allocation array based on the rendering representation of the azimuth surface.
[0120] Corresponding material data is created based on the texture data, and texture rendering is performed on each azimuth surface of the voxel unit according to the material data.
[0121] The rendering processing device also includes the following modules:
[0122] The visibility detection module is used to detect the visibility of each azimuth surface of the voxel unit.
[0123] The rendering shielding module is used to shield the rendering process of the azimuth surface if the azimuth surface is not visible.
[0124] The rendering module is also configured to:
[0125] Generates a texture atlas based on texture data for multiple material types stored in a texture allocation array.
[0126] When texture rendering is performed on a voxel basis, the material data used for rendering is mapped from the texture atlas.
[0127] Reference below Figure 4 An electronic device 50 according to an embodiment of the present application is described. Figure 4 The electronic device 50 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0128] like Figure 4As shown, the electronic device 50 is in the form of a general computing device. The components of the electronic device 50 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, and a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510).
[0129] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 executes the steps according to various exemplary embodiments of the present application described in the description of the exemplary method described above in this specification. For example, the processing unit 510 can execute the following steps: Figure 1 The steps shown in .
[0130] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202 , and may further include a read-only storage unit (ROM) 5203 .
[0131] The storage unit 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0132] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0133] The electronic device 50 may also communicate with one or more external devices 600 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 50, and / or communicate with any device that enables the electronic device 50 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 550. The input / output (I / O) interface 550 is connected to a display unit 540. In addition, the electronic device 50 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 560. As shown, the network adapter 560 communicates with other modules of the electronic device 50 via a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0134] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a mobile terminal, etc.) to execute the rendering processing method according to the implementation of the present application.
[0135] In an exemplary embodiment of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the rendering processing method described in the above method embodiment.
[0136] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0137] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0138] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0139] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0140] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages, such as JAVA, C++, etc., and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0141] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0142] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0143] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a mobile terminal, etc.) to execute the method according to the implementation method of the present application.
[0144] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A rendering processing method, characterized in that: include: Based on the adjacent relationship between voxel units, adjacent surface information of each azimuth surface of the voxel unit in multiple directions is obtained; Establishing a bit mask based on the number of directions of the azimuth plane, the number of bits of the bit mask being the same as the number of directions of the azimuth plane; According to the relationship between the field bits of the bit mask and the direction attribute, the adjacent surface information of the azimuth plane in each direction is recorded to generate a rendering identifier, the number of bits of the rendering identifier is the same as the number of directions of the azimuth plane, the rendering identifier includes the adjacent surface information of the azimuth plane in each direction on the two-dimensional plane, and is used to indicate the adjacent relationship between the voxel units in the same coordinate direction with the azimuth plane as a reference, the azimuth plane is the plane of the voxel unit in each coordinate direction; the direction attribute is used to indicate the relative relationship between the azimuth plane and the azimuth planes of other voxel units; Based on the correspondence between the rendering identifier and the material type, a texture allocation array is established, wherein the texture allocation array is used to store texture data of multiple material types in a preset order; According to the rendering identifier of the orientation plane and the texture allocation array, texture rendering is performed on a plurality of the voxel units.
2. The rendering processing method according to claim 1, characterized in that: The step of establishing a texture allocation array based on the correspondence between the rendering identifier and the material type includes: Based on the correspondence between the rendering identifier and the material type, creating index information related to the material type for the texture data of each material type; The rendering identifiers and corresponding index information are stored in the texture allocation array according to the order of the rendering identifiers.
3. The rendering processing method according to claim 1, characterized in that: The step of performing texture rendering on a plurality of voxel units according to the rendering identifier of the orientation plane and the texture allocation array comprises: When rendering each azimuth surface of the voxel unit, obtaining corresponding texture data from the texture allocation array based on the rendering identifier of the azimuth surface; Corresponding material data is created based on the texture data, and texture rendering is performed on each azimuth surface of the voxel unit according to the material data.
4. The rendering method according to claim 1, characterized in that: Before performing texture rendering on a plurality of the voxel units according to the rendering identifier of the orientation plane and the texture allocation array, the method further comprises: Detecting the visibility of each azimuth surface of the voxel unit; If the azimuth surface is not visible, the rendering process of the azimuth surface is shielded.
5. The rendering method according to claim 1, characterized in that: The step of performing texture rendering on a plurality of voxel units according to the rendering identifier of the orientation plane and the texture allocation array comprises: Generate a texture atlas based on texture data of multiple material types stored in the texture allocation array; When texture rendering is performed on the voxel unit, material data for rendering is mapped from the texture atlas.
6. A rendering processing device, characterized in that: The device comprises: Rendering logo generation module, used to: Based on the adjacent relationship between voxel units, adjacent surface information of each azimuth surface of the voxel unit in multiple directions is obtained; Establishing a bit mask based on the number of directions of the azimuth plane, the number of bits of the bit mask being the same as the number of directions of the azimuth plane; According to the relationship between the field bits of the bit mask and the direction attribute, the adjacent surface information of the azimuth plane in each direction is recorded to generate a rendering identifier, the number of bits of the rendering identifier is the same as the number of directions of the azimuth plane, the rendering identifier includes the adjacent surface information of the azimuth plane in each direction on the two-dimensional plane, and is used to indicate the adjacent relationship between the voxel units in the same coordinate direction with the azimuth plane as a reference, the azimuth plane is the plane of the voxel unit in each coordinate direction; the direction attribute is used to indicate the relative relationship between the azimuth plane and the azimuth planes of other voxel units; A texture allocation module, used to establish a texture allocation array based on the correspondence between the rendering identifier and the material type, wherein the texture allocation array is used to store texture data of multiple material types in a preset order; A rendering module is used to perform texture rendering on a plurality of the voxel units according to the rendering identifier of the orientation plane and the texture allocation array.
7. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the rendering processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the rendering processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Voxel model mapping method and voxel model mapping device
CN115841567A
Model rendering method and device, medium and electronic equipment
CN116310029A
Illumination rendering method and device, equipment and storage medium
CN117876572A