Image rendering method, device, electronic device and storage medium

By detecting contacts during image rendering and numerical analysis to determine the target category, directly rendering the object model, solving the problem of large amount of computing and boundary jagging caused by splitting the model into multiple grids in the prior art, reducing device performance and video memory requirements.

CN114742931BActive Publication Date: 2025-08-29BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210471315.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-08-29
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

The prior art requires splitting the model into multiple grids and generating multiple maps during image rendering, resulting in large amounts of computing, high device performance and video memory requirements, and easy to see jagged in the model boundaries.

Method used

By detecting the user's contacts on the display interface, performing numerical analysis to determine the target category, and directly rendering the object model based on the target display attributes, avoiding the tedious process of splitting the model into multiple grids.

Benefits of technology

It reduces the amount of computing during the rendering process, reduces the requirements for device performance and video memory, and avoids model boundary jagging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742931B_ABST
    Figure CN114742931B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a method, apparatus, electronic device, and storage medium for rendering an image. The method includes: when a trigger is detected on a display interface, determining a target contact on the object model to be processed, and numerically analyzing the current display attributes of the target contact to determine the target category of the target contact; determining a target display attribute corresponding to the target category, and rendering the object model to be processed based on the target display attribute to obtain a target image. The technical solution of the embodiments of the present disclosure avoids the tedious process of splitting the model into multiple grids during image rendering. At the same time, it also reduces the amount of calculation in the rendering process, indirectly reducing the application's requirements for device performance and video memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to a method, device, electronic device, and storage medium for rendering an image. Background Art

[0002] With the continuous development of image processing technology, application software provides users with the function of interacting with virtual object models. For example, in scenarios such as industrial model preview and games, users can use the tools provided by the application to draw various patterns on the virtual object model.

[0003] In existing technologies, when an application renders a model based on a pattern drawn by the user, it is usually necessary to first split the model into multiple meshes and then assign corresponding attributes to different meshes, or use multiple maps (masks) to distinguish different areas. However, this method of splitting multiple meshes and generating multiple maps requires a lot of work, and the edges of the rendered model are prone to jagged edges. At the same time, the application has high requirements for device performance and video memory during the rendering process. Summary of the Invention

[0004] The present disclosure provides a method, apparatus, electronic device, and storage medium for rendering images, which avoid the tedious process of splitting a model into multiple grids during image rendering. At the same time, it also reduces the amount of calculation during the rendering process, indirectly lowering the application's requirements for device performance and video memory.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for rendering an image, comprising:

[0006] When a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, and a current display attribute of the target contact is numerically analyzed to determine a target category of the target contact;

[0007] A target display attribute corresponding to the target category is determined, and the model of the object to be processed is rendered based on the target display attribute to obtain a target image.

[0008] In a second aspect, an embodiment of the present disclosure further provides a device for rendering an image, comprising:

[0009] a numerical analysis module configured to, when detecting a model of an object to be processed on a trigger display interface, determine a target contact on the model of the object to be processed, and perform numerical analysis on a current display attribute of the target contact to determine a target category of the target contact;

[0010] The rendering module is used to determine the target display attribute corresponding to the target category, and render the object model to be processed based on the target display attribute to obtain a target image.

[0011] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0012] one or more processors;

[0013] a storage device for storing one or more programs,

[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for rendering an image as described in any one of the embodiments of the present disclosure.

[0015] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the method for rendering an image as described in any one of the embodiments of the present disclosure.

[0016] The technical solution of the embodiment of the present disclosure is that when a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, that is, which area of ​​the object to be processed the user wants to be processed is determined, and further, the current display properties of the target contact are numerically analyzed to determine the target category of the target contact, thereby determining the target display properties corresponding to the target category, and rendering the model of the object to be processed based on the target display properties. By performing numerical analysis on the display properties of the contact, the tedious process of splitting the model into multiple grids during the image rendering process is avoided, thereby avoiding the problem of jagged edges on the boundaries of the rendered model. At the same time, the amount of calculation in the rendering process is reduced, and the application's requirements for device performance and video memory are indirectly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0018] Figure 1 A schematic flow chart of a method for rendering an image provided by an embodiment of the present disclosure;

[0019] Figure 2 A schematic diagram of a method for rendering an image provided by an embodiment of the present disclosure;

[0020] Figure 3 A schematic diagram of the structure of an image rendering device provided by an embodiment of the present disclosure;

[0021] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "a plurality of" mentioned in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or more".

[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0027] Before introducing the present technical solution, an example description of the application scenario of the embodiment of the present disclosure may be given.

[0028] For example, in some game application scenarios, when a user draws a pattern on an object model according to his or her own wishes through the functions provided by the application, the application usually needs to split the model of the object into multiple meshes and assign different materials to each mesh before the object can be rendered together with the pattern of the user's receipt to the display interface; or, in an industrial model preview application scenario, when a user customizes the colors of various parts of a certain mechanical component according to business needs, the application can use multiple maps (masks) to enable the shader to distinguish different areas of the mechanical component. However, in both of the above methods, the application requires a more complex process to generate corresponding materials for the corresponding areas on the model, and the above process has higher performance requirements for the hardware. At this time, based on the solution of the embodiment of the present disclosure, when it is detected that the user triggers the model, the category of the contact can be determined by directly performing numerical analysis on the properties of the contact, so that the model can be rendered to the corresponding display interface according to the user's needs.

[0029] Figure 1 This is a flow chart of a method for rendering an image provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where the category of the touch point is determined based on the user's touch, thereby rendering the model. The method can be executed by a device for rendering the image, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.

[0030] like Figure 1 As shown, the method includes:

[0031] S110 , when a to-be-processed object model on a trigger display interface is detected, a target contact point on the to-be-processed object model is determined, and a current display attribute of the target contact point is numerically analyzed to determine a target category of the target contact point.

[0032] Among them, the device for executing the method for rendering an image provided by the embodiment of the present disclosure can be integrated into an application software that supports the image rendering processing function, and the software can be installed in an electronic device. Optionally, the electronic device can be a mobile terminal or a PC, etc. The application software can be a type of software for image / video processing. The specific application software will not be described here one by one, as long as the image / video processing can be achieved. It can also be a specially developed application to implement the software for adding special effects and displaying the special effects, or it can be integrated into the corresponding page, and the user can process the special effects video through the page integrated in the PC.

[0033] In this embodiment, the model of the object to be processed can be a pre-built 3D model. At the same time, the model can be integrated into the application after associating it with a corresponding identifier (such as an icon or text, etc.). When the user selects the identifier corresponding to the model of the object to be processed, the application can retrieve the model and present it on the display interface. Based on this, the user can touch the displayed model and then draw a specific pattern on a certain area on the surface of the model, or adjust the material (such as texture or color) on a certain area on the surface of the model.

[0034] It should be noted that before processing the object model to be processed, the object model to be processed can be generated first, and optionally, the map to be used corresponding to the object model to be processed is determined; the map to be used is rendered based on the rendering equation to obtain the object model to be processed displayed on the display interface.

[0035] Among them, the map to be used can be generated based on a blank map, and the blank map can be an image that is pre-generated and bound to the object model after the Digital Content Creation (DCC) software loads the object model to be processed. Those skilled in the art should understand that the scope of DCC includes two-dimensional / three-dimensional animation, audio / video editing and synthesis, DVD creation, dynamic / interactive content creation, image editing and other fields. Therefore, in addition to blank maps, various types of images can be generated based on DCC software and bound to the model, such as solid-color static images or dynamic images containing multiple colors.

[0036] At the same time, the user draws a corresponding pattern on the surface of the object model to be processed, or when the material of the surface of the object model to be processed is adjusted, the result of the drawing or adjustment can be synchronized to the map to be used. Specifically, in the process of determining the map to be used, the current drawing position of the brush position on the object model to be processed can be determined first, and the target face corresponding to the current position drawing can be determined. Among them, the brush is a tool used for drawing in image editing software, and the face refers to the mesh in the application software that supports image rendering processing, which can be understood as the object used to carry the image in the application software. Each face is composed of two triangles. Accordingly, a face contains 12 vertices and two front and back faces. It can be understood that the front and back faces of the face each contain 6 vertices. At the same time, the model to be processed is composed of at least one face. Based on this, after the application determines the pattern drawn by the user, it can associate the pattern with a specific face of the model to be processed, and the associated face is the target face. For example, when the object model to be processed is a model of a sneaker, the user can select a brush in the application software and then draw a circle on the upper of the sneaker model. During the drawing process, the application can determine the drawing position of the brush in real time, so that the circle drawn by the user on the upper is associated with the surface patch of the upper. It can be understood that the surface patch of the upper is the target surface patch.

[0037] Furthermore, after determining the map to be used and its corresponding target face, the target rendering category corresponding to the current drawing position can be determined based on the target face, the preset drawing radius, the drawing color, and the numerical analysis method; and the map to be used is determined based on each target rendering category and the corresponding drawing color. Among them, the preset drawing radius can be a parameter reflecting the size of the brush. It can be understood that the contact surface of the brush on the object model to be processed can be a circle, and the radius of the circle is the preset drawing radius. At the same time, this circle can correspond to a pixel point or an area on the model. Of course, in actual application, the preset drawing radius can be adjusted according to the actual needs of the user. The embodiment of the present disclosure does not make specific limitations here. For example, when the user wants to draw thicker lines on the surface of the object model to be used, a brush with a larger contact surface with the model surface can be selected. Accordingly, the preset drawing radius of this brush is also larger. Conversely, when the user wants to draw thinner lines on the surface of the object model to be used, a brush with a smaller contact surface with the model surface can be selected. Accordingly, the preset drawing radius of this brush is also smaller. The drawing color reflects the color selected by the user during the drawing process. For example, when the user selects red as the color corresponding to the brush, the application software can determine that the current drawing color is red.

[0038] In this embodiment, after the application determines the target face, the preset drawing radius, and the drawing color, the numerical analysis method can be used to process the above information, wherein numerical analysis can be understood as a numerical calculation method based on a computer to solve computational problems. In actual applications, the numerical analysis method can be embodied based on a pre-written program. For example, after determining the above information, the application can run the program corresponding to the numerical analysis method to determine the target rendering category corresponding to the current drawing position.

[0039] The rendering category is information representing a specific area on the object model to be processed. The object model to be processed includes at least one category to be rendered, and the map to be used includes the color scale value corresponding to each pixel. Those skilled in the art will understand that color scale is an index that represents the brightness of an image, namely a color index. In digital image processing, it also refers to the grayscale resolution of a pixel. Therefore, the color scale value corresponding to each pixel in the map to be used determines the color richness and fineness of the image. Continuing with the sneaker example mentioned above, after the user draws a circle on the model, the application runs the corresponding program for the numerical analysis method and determines that the rendering category corresponding to the drawn circle is the upper. Once the target rendering category is determined, the application can obtain the map to be used based on the corresponding drawing color. For example, if the drawing color on the upper is determined to be red, the corresponding map to be used can be determined for the upper portion of the sneaker model. It can be understood that each point in the map corresponds to each pixel in the corresponding area on the model. Therefore, the above process also automatically maps the drawing result to the map to be used.

[0040] In this embodiment, once the application obtains the texture to be used, it can render the texture to be used based on the rendering equation to obtain the object model to be processed and displayed on the display interface. Optionally, the color scale value of each pixel in the texture to be used is obtained, and the first numerical distance metric function and the second numerical distance metric function are respectively used to determine the numerical precision corresponding to the pixel; the numerical precision is processed based on the step function in the graphics processor to determine the target rendering category corresponding to each pixel; and the model to be processed displayed on the display interface is determined based on the drawing color corresponding to the target rendering category.

[0041] Specifically, after the application determines the color scale value of each pixel in the map to be used, the numerical accuracy corresponding to the pixel can be determined based on the two functions. Among them, the first numerical distance metric function can be The second numerical distance metric function can be Among them, I1 can represent the point in the map to be used, that is, the RGB value of the point in the two-dimensional image, and I2 can represent the point on the object model to be processed, that is, the RGB value of the point in the three-dimensional model. The above two numerical distance measurement functions are used to calculate the distance error between pixel RGB. For example, the distance d1(I1, I2) is the distance from a point to X and then to Y, and the distance d2(I1, I2) is the distance between X and Y.

[0042] In this embodiment, based on the above two functions, the application can determine the numerical precision of the pixel point, where numerical precision refers to the degree of approximation between the observed value and the true value, or what can be considered the true value. It can be understood that in the OpenGL Shading Language (GLSL), the lowp precision of the shader is accurate to two decimal places, so values ​​0 to 255 are scaled to lowp floating-point numbers between 0 and 1. This means that the "equal to" operation in the logical method is unreliable and requires a logical operation method more suitable for floating-point numbers. Therefore, the step function in the Graphics Processing Unit (GPU) can be used to process numerical precision. It can be understood that the step function in GLSL is suitable for logical operations on floating-point numbers. When using this function, it is necessary to provide two values ​​corresponding to the function, x and edge. If x is greater than edge, it returns 1, and if x is less than edge, it returns 0, thereby achieving the function of converting numerical precision into logical distance (i.e., 0 or 1).

[0043] In actual applications, after numerical precision processing based on a step function, at least two target rendering types can be determined. For example, the rendering types corresponding to the upper, sole, and shoelaces of a sneaker can be determined. Furthermore, based on the corresponding rendering colors for each rendering type, a model to be processed can be obtained. The model to be processed is the model on the display interface that the application ultimately renders, for example, a 3D image of a sneaker with a red upper, white laces, and a black sole.

[0044] In this embodiment, the application may further determine a material map corresponding to the object model to be processed, so as to render the object model to be processed displayed on the display interface based on the material map and the map to be used.

[0045] The material map can be a map that reflects the texture and color of a specific material. For example, if the object model to be processed is a sneaker model, the corresponding material map can be a map that reflects the texture and color of leather. Once the application software determines the map to be used that corresponds to the object model to be processed, it can overlay the material map with the map to be used to generate a pattern on the surface of the object model to be processed and render it.

[0046] For example, when it is determined that the material map corresponding to the sneaker model is a leather material map, the map can be mixed and superimposed with the map to be used, which is determined based on the user's drawing results on the model and contains a red circular pattern, to obtain an image for rendering the surface of the sneaker model. After the sneaker model is retrieved, sneakers with the above-mentioned red circular pattern and leather texture material can be rendered on the display interface based on the image.

[0047] In this embodiment, after the application determines the material map, the material map and the map to be used can also be rendered based on the rendering equation to obtain a model of the object to be processed. Among them, the material map includes material parameters corresponding to the target rendering category. Those skilled in the art should understand that the material parameters may include many parameters such as texture, color, brightness, etc., and the present embodiment does not make specific limitations here. The rendering equation is an integral equation in computer graphics. It is the theoretical basis of all global illumination methods (such as ray tracing, path based, and radiosity, etc.). Based on this, it can be understood that in computer graphics, the goal of realistic rendering is to solve the above rendering equation.

[0048] For example, when the application determines that the material map corresponding to the sneakers is a leather texture material map, and generates the corresponding map to be used based on the user's drawing results on the sneaker model, it can call a pre-written program that reflects the rendering equation to process the above-mentioned leather texture material map and the map to be used, and obtain the information of each pixel point on the model. After passing the information of each pixel point to the GPU, the sneakers as the object model to be processed can be rendered, and the rendering results can be displayed on the display interface.

[0049] In this embodiment, the method of determining the contact point and then determining the target category can be to determine the target vertex corresponding to the target contact point, and determine the map pixel point corresponding to the target vertex; determine the map pixel point and the corresponding numerical precision value based on the first numerical distance measurement function and the second numerical distance measurement function, and determine the target category corresponding to the target numerical precision based on the step function.

[0050] Among them, the target vertex corresponding to the target contact point can be reflected in the UV texture space. Those skilled in the art should understand that when UVs are used as two-dimensional texture coordinate points residing on the vertices of the polygonal mesh, a two-dimensional texture coordinate system is defined, and this coordinate system is the UV texture space. In this space, U and V are used to define the coordinate axes to determine how to place a texture image on the three-dimensional model surface. In other words, UVs provide a connection between the model surface and the texture image, and are responsible for determining which vertex on the model surface a pixel point on the texture image should be placed, so that the entire texture can be covered on the model.

[0051] Based on this, when the application determines the target vertex, the map pixel point corresponding to the vertex, that is, the pixel UV, can be determined through rasterization processing. Among them, rasterization is the process of converting the set data into pixels after a series of transformations, so that the corresponding pattern is presented on the display interface. The essence of rasterization is coordinate transformation and geometric discretization. In the rasterization process, it is necessary to ensure that each pixel is correctly mapped to the corresponding pixel point or area. After obtaining the pixel UV, the pixel point of the map can be determined based on the first numerical distance function and the second numerical distance metric function described in the embodiment of the present disclosure, so as to obtain the corresponding numerical precision value of the pixel UV point. This process can be understood as a process of re-determining the numerical precision value of a pixel point in a two-dimensional plane based on an inverse function, and then judging the target category to which the pixel point belongs based on the numerical precision value.

[0052] Continuing with the example of a sports shoe model as the object model to be processed, when it is determined that the target vertex UV corresponding to the target contact point corresponds to a certain position on the shoe upper, the mapping pixel point corresponding to the vertex UV can be determined at the same time. Furthermore, the numerical precision value corresponding to the point is determined based on the first numerical distance measurement function and the second numerical distance measurement function (such as 0.9), and then the numerical precision value is processed based on the step function to obtain an integer corresponding to the value, thereby determining that the category information corresponding to this integer is the shoe upper category.

[0053] S120 , determining a target display attribute corresponding to the target category, and rendering the object model to be processed based on the target display attribute to obtain a target image.

[0054] In this embodiment, after the application determines the target category, it can further determine the target display attributes corresponding to the category. Among them, the target display attributes can be information that characterizes the pixel attributes corresponding to the category, such as the pixel color. Furthermore, the target attribute information can be sent to the shader used to render the image, thereby generating a target image that contains the pattern drawn by the user and reflects the model of the object to be processed. Among them, the shader is a programmable program used for image rendering and replaces the fixed rendering pipeline, and is mainly responsible for the geometric operations of each pixel in the model. Those skilled in the art should understand that only one shader can be activated at the same time. At the same time, when the shader is running in the GPU, the corresponding image can be rendered in the display interface. The embodiments of the present disclosure will not be repeated here.

[0055] Optionally, the target display color and target material triggered on the display interface are obtained as target display attributes; the target rendering area corresponding to the target classification is determined, and the target rendering area on the object model to be processed is rendered based on the graphics processor to obtain a target image.

[0056] Among them, the target display color and target material can be determined according to the trigger operation of the user on the display interface. For example, when the user clicks the drop-down list corresponding to the color on the display interface and selects red, and further clicks the drop-down list corresponding to the material on the display interface and selects leather material, the application can determine that the target display color is red and the target material is leather material based on the user's selection results.

[0057] In this embodiment, after the application determines the target display color and target material, the above two types of information can be integrated as the target display attributes. Further, the target rendering area corresponding to the target classification is determined, wherein the target rendering area is the area that needs to be rendered based on the GPU. At the same time, each rendering area has corresponding classification information corresponding to it. For example, when the determined target classification is the upper category, the application can determine that the upper area on the sports shoe model is the target rendering area based on the upper category information. Accordingly, the image obtained by rendering this area is the target image. It can be understood that the target image is at least used to present the pattern corresponding to the target rendering area.

[0058] After determining the target rendering area, the application can further send information about the multiple pixels contained in the area to the GPU's shader, thereby rendering the target rendering area based on the shader and displaying the image containing the target rendering area on the display interface. Continuing with the above example, when determining that the target rendering area is the upper area of ​​a sneaker, the application can send information about the pixels corresponding to the area to the GPU, thereby rendering the image corresponding to the sneaker model based on the shader, and the rendered image at least includes the pattern corresponding to the upper.

[0059] In actual application, you can also follow Figure 2 The schematic diagram shown implements the solution of the embodiment of the present disclosure. Figure 2 In the process of rendering the target image, the application can first obtain the target vertex UV, and further, perform rasterization processing on the vertex UV to obtain the corresponding pixel UV. It can be understood that this process is the process of pasting the two-dimensional map back to the 3D model through grid point mapping. Furthermore, the pixel UV, texture information and the pre-generated map (mask) to be used corresponding to the object model to be processed are combined for sampling processing to obtain the attribute information of each pixel point, and the mask value corresponding to each pixel point can also be obtained. That is to say, after the numerical analysis can analyze the difference between the two mask values, the two mask values ​​can represent a category respectively, achieving the purpose of one value representing two categories. Based on this, if N mask values ​​can be distinguished through numerical analysis, then these N values ​​can represent N categories. The specific numerical analysis scheme can be implemented according to the above description of the embodiment of the present disclosure, and will not be repeated here.

[0060] Continue to see Figure 2 When the application obtains the mask value corresponding to each pixel, it can perform numerical analysis on these values ​​to calculate the corresponding material category, and select the rendering equation based on the adaptability of the calculated material category. Finally, by solving the rendering equation, the color of each pixel reflected by a specific material can be obtained, allowing users to achieve customized color interaction based on application software.

[0061] The technical solution of the embodiment of the present disclosure is that when a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, that is, which area of ​​the object to be processed the user wants to be processed is determined, and further, the current display properties of the target contact are numerically analyzed to determine the target category of the target contact, thereby determining the target display properties corresponding to the target category, and rendering the model of the object to be processed based on the target display properties. By performing numerical analysis on the display properties of the contact, the tedious process of splitting the model into multiple grids during the image rendering process is avoided, thereby avoiding the problem of jagged edges on the boundaries of the rendered model. At the same time, the amount of calculation in the rendering process is reduced, and the application's requirements for hardware performance and video memory are indirectly reduced.

[0062] Figure 3 A schematic diagram of a device structure for rendering an image provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the device includes: a numerical analysis module 210 and a rendering module 220.

[0063] The numerical analysis module 210 is used to determine the target contact on the object model to be processed when detecting the trigger display interface, and perform numerical analysis on the current display attribute of the target contact to determine the target category of the target contact.

[0064] The rendering module 220 is configured to determine target display attributes corresponding to the target category, and render the object model to be processed based on the target display attributes to obtain a target image.

[0065] On the basis of the above technical solutions, the image rendering device further includes a module for determining a map to be used and a module for determining a model of an object to be processed.

[0066] The to-be-used map determining module is used to determine the to-be-used map corresponding to the object model to be processed.

[0067] The module for determining the model of the object to be processed is used to render the texture to be used based on the rendering equation to obtain the model of the object to be processed displayed on the display interface.

[0068] Based on the above technical solutions, the model of the object to be processed is composed of at least one surface patch.

[0069] On the basis of the above technical solutions, the to-be-used map determination module includes a target patch determination unit, a target rendering category determination unit and a to-be-used map determination unit.

[0070] The target face determining unit is used to determine the current drawing position of the brush on the object model to be processed, and determine the target face corresponding to the drawing at the current position.

[0071] The target rendering category determining unit is configured to determine a target rendering category corresponding to the current rendering position based on the target patch, a preset rendering radius, a rendering color, and a numerical analysis method.

[0072] The map to be used determining unit is used to determine the map to be used based on each target rendering category and the corresponding drawing color; wherein the object model to be processed includes at least one category to be rendered, and the map to be used includes the color level value corresponding to each pixel point.

[0073] On the basis of the above technical solutions, the to-be-processed object model determination module includes a numerical precision determination unit, a target rendering category determination unit and a to-be-processed model determination unit.

[0074] The numerical precision determining unit is used to obtain the color scale value of each pixel point in the map to be used, and respectively determine the numerical precision corresponding to the pixel point using the first numerical distance metric function and the second numerical distance metric function.

[0075] The target rendering category determining unit is configured to process the numerical precision based on a step function in a graphics processor to determine a target rendering category corresponding to each pixel point.

[0076] The to-be-processed model determining unit is configured to determine the to-be-processed model to be displayed on the display interface based on a drawing color corresponding to the target rendering category.

[0077] Based on the above technical solutions, the image rendering device further includes a material mapping determination module.

[0078] The material map determining module is used to determine the material map corresponding to the object model to be processed, so as to render the object model to be processed displayed on the display interface based on the material map and the map to be used.

[0079] Optionally, the module for determining the model of the object to be processed is further configured to render the material map and the map to be used based on a rendering equation to obtain the model of the object to be processed;

[0080] The material map includes material parameters corresponding to the target rendering category.

[0081] On the basis of the above technical solutions, the numerical analysis module 210 includes a target vertex determination unit and a map pixel determination unit.

[0082] The target vertex determination unit is used to determine the target vertex corresponding to the target contact point and determine the mapping pixel point corresponding to the target vertex.

[0083] The mapping pixel point determination unit is used to determine the numerical precision value corresponding to the mapping pixel point based on the first numerical distance measurement function and the second numerical distance measurement function, and determine the target category corresponding to the target numerical precision based on the step function.

[0084] On the basis of the above technical solutions, the rendering module 220 includes a target display attribute determination unit and a target image generation unit.

[0085] The target display attribute determination unit is used to obtain the target display color and target material triggered on the display interface as the target display attribute.

[0086] The target image generating unit is configured to determine a target rendering area corresponding to the target classification, and render the target rendering area on the object model to be processed based on a graphics processor to obtain the target image.

[0087] The technical solution provided by this embodiment, when detecting a model of an object to be processed on a triggered display interface, determines a target contact on the model of the object to be processed, that is, determines which area of ​​the object to be processed the user wants to process, further performs a numerical analysis on the current display properties of the target contact, determines the target category of the target contact, thereby determining the target display properties corresponding to the target category, and renders the model of the object to be processed based on the target display properties. By performing a numerical analysis on the display properties of the contact, the tedious process of splitting the model into multiple grids during the image rendering process is avoided, thereby avoiding the problem of jagged edges on the boundaries of the rendered model. At the same time, the amount of calculation in the rendering process is reduced, indirectly reducing the application's requirements for hardware performance and video memory.

[0088] The image rendering device provided in the embodiments of the present disclosure can execute the image rendering method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0089] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0090] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 4 , which shows an electronic device (eg Figure 4The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0091] like Figure 4 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a pattern processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.

[0092] Typically, the following devices may be connected to the I / O interface 305: an editing device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0093] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0094] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0095] The electronic device provided by the embodiment of the present disclosure and the method for rendering an image provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0096] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the method for rendering an image provided by the above embodiment is implemented.

[0097] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0098] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0099] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0100] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0101] When a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, and a current display attribute of the target contact is numerically analyzed to determine a target category of the target contact;

[0102] A target display attribute corresponding to the target category is determined, and the model of the object to be processed is rendered based on the target display attribute to obtain a target image.

[0103] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0104] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0105] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0106] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0107] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.

[0108] According to one or more embodiments of the present disclosure, [Example 1] provides a method for rendering an image, the method comprising:

[0109] When a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, and a current display attribute of the target contact is numerically analyzed to determine a target category of the target contact;

[0110] A target display attribute corresponding to the target category is determined, and the model of the object to be processed is rendered based on the target display attribute to obtain a target image.

[0111] According to one or more embodiments of the present disclosure, [Example 2] provides a method for rendering an image, the method further comprising:

[0112] Optionally, determining a texture to be used corresponding to the object model to be processed;

[0113] The texture to be used is rendered based on the rendering equation to obtain a model of the object to be processed displayed on the display interface.

[0114] According to one or more embodiments of the present disclosure, [Example 3] provides a method for rendering an image, wherein the object model to be processed is composed of at least one facet, and the method further includes:

[0115] Optionally, determining a current drawing position of the brush on the model of the object to be processed, and determining a target face corresponding to the drawing at the current position;

[0116] Determining a target rendering category corresponding to the current rendering position based on the target patch, a preset rendering radius, a rendering color, and a numerical analysis method;

[0117] Determining the texture to be used based on each target rendering category and the corresponding drawing color;

[0118] The object model to be processed includes at least one category to be rendered, and the texture to be used includes the color level value corresponding to each pixel point.

[0119] According to one or more embodiments of the present disclosure, [Example 4] provides a method for rendering an image, the method further comprising:

[0120] Optionally, obtaining the color scale value of each pixel point in the to-be-used map, and applying a first numerical distance metric function and a second numerical distance metric function respectively to determine the numerical accuracy corresponding to the pixel point;

[0121] Processing the numerical precision based on a step function in a graphics processor to determine a target rendering category corresponding to each pixel;

[0122] The model to be processed displayed on the display interface is determined based on the drawing color corresponding to the target rendering category.

[0123] According to one or more embodiments of the present disclosure, [Example 5] provides a method for rendering an image, the method further comprising:

[0124] Optionally, a material map corresponding to the object model to be processed is determined, so as to render the object model to be processed displayed on the display interface based on the material map and the map to be used.

[0125] According to one or more embodiments of the present disclosure, [Example 6] provides a method for rendering an image, the method further comprising:

[0126] Optionally, the material map and the map to be used are rendered based on a rendering equation to obtain the model of the object to be processed;

[0127] The material map includes material parameters corresponding to the target rendering category.

[0128] According to one or more embodiments of the present disclosure, [Example 7] provides a method for rendering an image, the method further comprising:

[0129] Optionally, determining a target vertex corresponding to the target contact point, and determining a map pixel point corresponding to the target vertex;

[0130] The numerical precision value corresponding to the map pixel point is determined based on the first numerical distance metric function and the second numerical distance metric function, and the target category corresponding to the target numerical precision is determined based on the step function.

[0131] According to one or more embodiments of the present disclosure, [Example 8] provides a method for rendering an image, the method further comprising:

[0132] Optionally, determining a target vertex corresponding to the target contact point, and determining a map pixel point corresponding to the target vertex;

[0133] The numerical precision value corresponding to the map pixel point is determined based on the first numerical distance metric function and the second numerical distance metric function, and the target category corresponding to the target numerical precision is determined based on the step function.

[0134] According to one or more embodiments of the present disclosure, [Example 9] provides a device for rendering an image, the device comprising:

[0135] a numerical analysis module configured to, when detecting a model of an object to be processed on a trigger display interface, determine a target contact on the model of the object to be processed, and perform numerical analysis on a current display attribute of the target contact to determine a target category of the target contact;

[0136] The rendering module is used to determine the target display attribute corresponding to the target category, and render the object model to be processed based on the target display attribute to obtain a target image.

[0137] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0138] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0139] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A method for rendering an image, characterized in that: include: When a model of an object to be processed on a trigger display interface is detected, a target contact on the model of the object to be processed is determined, and a current display attribute of the target contact is numerically analyzed to determine a target category of the target contact; Determining a target display attribute corresponding to the target category, and rendering the object model to be processed based on the target display attribute to obtain a target image; The method further includes: determining a to-be-used texture corresponding to the to-be-processed object model, wherein the to-be-used texture is related to the to-be-processed object model, and the to-be-processed object model is composed of at least one facet; rendering the to-be-used texture based on a rendering equation to obtain the to-be-processed object model displayed on the display interface; Determining a to-be-used texture corresponding to the object model to be processed, specifically comprising: determining a current drawing position of a brush on the object model to be processed, and determining a target face corresponding to the current drawing position; Determining a target rendering category corresponding to the current rendering position based on the target patch, a preset rendering radius, a rendering color, and a numerical analysis method; Determining the texture to be used based on each target rendering category and the corresponding drawing color; The object model to be processed includes at least one category to be rendered, and the texture to be used includes the color level value corresponding to each pixel point.

2. The method according to claim 1, characterized in that The rendering process of the to-be-used texture based on the rendering equation to obtain a to-be-processed object model displayed on the display interface includes: Obtaining the color scale value of each pixel point in the to-be-used map, and respectively applying a first numerical distance metric function and a second numerical distance metric function to determine the numerical accuracy corresponding to the pixel point; Processing the numerical precision based on a step function in a graphics processor to determine a target rendering category corresponding to each pixel; The object model to be processed displayed on the display interface is determined based on the drawing color corresponding to the target rendering category.

3. The method according to claim 2, characterized in that Also includes: A material map corresponding to the object model to be processed is determined, so as to render the object model to be processed displayed on the display interface based on the material map and the map to be used.

4. The method according to claim 3, characterized in that The rendering process of the to-be-used texture based on the rendering equation to obtain a to-be-processed object model displayed on the display interface includes: Rendering the material map and the map to be used based on a rendering equation to obtain a model of the object to be processed; The material map includes material parameters corresponding to the target rendering category.

5. The method according to claim 1, wherein The determining of the target contact on the object model to be processed and performing numerical analysis on the current display attribute of the target contact to determine the target category of the target contact includes: Determine a target vertex corresponding to the target contact point, and determine a mapping pixel point corresponding to the target vertex; The numerical precision value corresponding to the map pixel point is determined based on the first numerical distance metric function and the second numerical distance metric function, and the target category corresponding to the numerical precision is determined based on the step function.

6. The method according to claim 1, characterized in that The determining of the target display attributes corresponding to the target category and rendering the object model to be processed based on the target display attributes to obtain a target image includes: Acquire the target display color and target material triggered on the display interface as the target display attributes; A target rendering area corresponding to the target category is determined, and the target rendering area on the object model to be processed is rendered based on a graphics processor to obtain the target image.

7. A device for rendering an image, characterized in that: include: a numerical analysis module configured to, when detecting a model of an object to be processed on a trigger display interface, determine a target contact on the model of the object to be processed, and perform numerical analysis on a current display attribute of the target contact to determine a target category of the target contact; a rendering module, configured to determine a target display attribute corresponding to the target category, and render the object model to be processed based on the target display attribute to obtain a target image; The apparatus further includes: a to-be-used texture determining module, configured to determine a to-be-used texture corresponding to the to-be-processed object model, wherein the to-be-used texture is related to the to-be-processed object model, and the to-be-processed object model is composed of at least one facet; and to render the to-be-used texture based on a rendering equation to obtain the to-be-processed object model displayed on the display interface; The map to be used determination module includes: a target face determination unit, configured to determine a to-be-used texture corresponding to the object model to be processed, specifically comprising: determining a current drawing position of a brush on the object model to be processed, and determining a target face corresponding to the current drawing position; a target rendering category determining unit, configured to determine a target rendering category corresponding to the current rendering position based on the target patch, a preset rendering radius, a rendering color, and a numerical analysis method; A texture to be used determining unit, configured to determine the texture to be used based on each target rendering category and the corresponding drawing color; The object model to be processed includes at least one category to be rendered, and the texture to be used includes the color scale value corresponding to each pixel point. The texture to be used.

8. An electronic device, characterized in that: The electronic device comprises: 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, the one or more processors implement the method for rendering an image according to any one of claims 1 to 6.

9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the method for rendering an image according to any one of claims 1 to 6 when executed by a computer processor.

Citation Information

Patent Citations

  • Panoramic processing method and device

    CN109801354A

  • Map labeling method and device, electronic equipment and storage medium

    CN113127584A