Method and device for making top layer pattern on the surface of three-dimensional object
By expanding the three-dimensional object model into a plane and defining the color value according to the vertex coordinates, the problems of complexity and performance overhead of top-level pattern production in the prior art are solved, and more efficient top-level pattern production and better compatibility are achieved.
Patent Information
- Application Number
- CN202011000459.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-09-22
AI Technical Summary
When making top-layer patterns on the surface of three-dimensional objects, the prior art has a large workload and a large number of maps, which affects the loading time and is difficult to reuse, which brings additional burden to the CPU and GPU, and has a large performance overhead on the mobile platform.
Expand the object model into a plane, create a top-level pattern map, define the first color value and the second color value according to the vertex coordinates of the object model plane, and use the top-level pattern map to define the weight value, determine the final color value, and reduce the amount of map production And improve reusability.
It reduces the amount of map production and model load, reduces the computing load of the CPU and GPU, improves compatibility, and achieves more efficient top-level pattern production without affecting the original project.
Smart Images

Figure CN112288846B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method and device for making or generating a top layer pattern on the surface of a three-dimensional object. Background Art
[0002] When an object model is displayed on a computer, it is usually realized through texture rendering, and mapping is one of the necessary processes. Figure 1 Three schemes are generally used.
[0003] The first solution is to create a fully combined map. For example, suppose an object has a total of 3 surfaces with different colors when the top-level pattern is not used, and then has 3 different top-level patterns that can be applied. A total of 9 different maps need to be created based on the unfolded plane of the object to display the combination of all colors and all top-level patterns. However, this technical solution is labor-intensive and requires a large number of maps to be created. The maps created earlier without the top-level pattern cannot be reused, and a large number of maps will increase the data size of the program, affect the loading time, and occupy more GPU video memory.
[0004] The second solution is to create an additional object model suspended above the original object, and apply the top-level pattern map to this additional model; this technical solution requires the creation of an additional model, which brings additional burden to the CPU, and because it is suspended above the original object, there may be position deviations or poor surface fit problems; if a large-area suspended model is used, a transparent channel must be used in order not to affect the unmasked part of the original object, which in turn creates an additional burden on the GPU.
[0005] The third solution is a deferred decal rendering solution based on screen space post-processing technology. This solution uses various screen cache data in the GPU to calculate the final shape and visual effects of the decal in real time, and is generally used to generate dynamic decals in real time. This solution has the widest range of adaptability, but also has the highest performance overhead and has very high requirements for hardware. It is difficult to apply it on a large scale on mobile platforms.
[0006] When rendering a car model, it is necessary to display various styles of top patterns (decorations) on the car body according to preset requirements. The size, color, and position of the top patterns are different, and the original paint color of the car body cannot be affected. No matter which of the above two existing technologies is adopted, the manufacturing process is relatively complicated and the efficiency is relatively low, which requires a lot of manpower, material resources, and financial resources. Therefore, it is necessary to find a better technical solution to at least solve at least part of the above defects to at least a certain extent. Summary of the invention
[0007] In view of this, the present application proposes a method and device for making a top layer pattern on the surface of a three-dimensional object, which improves the reusability of the top layer pattern and solves the cost problem.
[0008] According to one aspect of the present application, a method for making a top layer pattern on a surface of an object is proposed, the method comprising:
[0009] Unfold the object model into a plane;
[0010] Produce a top-layer pattern map, wherein the top-layer pattern map partially overlaps with the pattern after the object model plane is unfolded;
[0011] Defining a first color value of each vertex according to the coordinates of each vertex unfolded by the object model plane, and defining a second color value of the object at each vertex coordinate using a top-level pattern map, wherein the top-level pattern map at least includes at least one attribute value for indicating a weight value of a top-level pattern on the surface of the object;
[0012] A final color value of each vertex is determined according to the at least one attribute value, the first color value, and the second color value.
[0013] Preferably, the at least one property value comprises a reference color value, which is different from an intrinsic color value of the top pattern map.
[0014] Preferably, determining the color value of each vertex according to the at least one attribute value, the first color value and the second color value comprises:
[0015] When the second color value is equal to the reference color value, the color value of the vertex is the first color value; otherwise, the color value of the vertex is the second color value.
[0016] Preferably, the at least one attribute value includes transparency, the transparency of the pattern after the object model is unfolded in a plane is set to be completely transparent, and the transparency of the top-layer pattern map is set to be opaque.
[0017] Preferably, determining the color value of each vertex according to the at least one attribute value, the first color value and the second color value comprises:
[0018] When the transparency of the vertex is completely transparent, the color value of the vertex is the first color value, otherwise the color value of the vertex is the second color value.
[0019] Preferably, the step of making a top-layer pattern map comprises:
[0020] Determine the corresponding vertex coordinates in each top-level pattern according to the preset position of the top-level pattern and the coordinates of each vertex in the plane of the object model;
[0021] Match the vertex coordinates in the top pattern with the vertex coordinates of the object model plane;
[0022] At least one property value of the top-level pattern map is set.
[0023] The present application provides a device for making a top layer pattern on the surface of a three-dimensional object, the device comprising:
[0024] An unfolding module is used to unfold the object model into a plane;
[0025] A production module, used for producing a top-level pattern map, wherein the top-level pattern map overlaps with a pattern portion after the object model plane is unfolded;
[0026] A definition module, used to define a first color value of each vertex according to the coordinates of each vertex unfolded by the object model plane, and to define a second color value of the object at each vertex coordinate using a top-level pattern map, wherein the top-level pattern map at least includes at least one attribute value for indicating a weight value of a top-level pattern on the surface of the object;
[0027] A determination module is used to determine a final color value of each vertex according to the at least one attribute value, the first color value and the second color value.
[0028] Preferably, the at least one property value comprises a reference color value, which is different from an intrinsic color value of the top pattern map.
[0029] Preferably, the determination module is further configured to set the color value of the vertex to the first color value if the second color value is equal to the reference color value, and otherwise set the color value of the vertex to the second color value.
[0030] Preferably, the at least one attribute value includes transparency, the transparency of the pattern after the object model is unfolded in a plane is set to be completely transparent, and the transparency of the top-layer pattern map is set to be opaque.
[0031] Preferably, the determination module is further configured to set the color value of the vertex to the first color value when the transparency of the vertex is completely transparent, and otherwise set the color value of the vertex to the second color value.
[0032] Preferably, the production module is also used to determine the corresponding vertex coordinates in each top-level pattern according to the pre-set position of the top-level pattern and the coordinates of each vertex when the object model is unfolded in the plane; correspond the vertex coordinates in the top-level pattern to the coordinates of each vertex when the object model is unfolded in the plane; and set at least one attribute value of the top-level pattern map.
[0033] According to the technical solution of the present application, the amount of texture production can be reduced, and existing textures can be reused, the amount of model loading can be reduced, the computing load of the CPU and GPU can be reduced, and good compatibility can be achieved.
[0034] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings constituting a part of the present application are used to provide a further understanding of the present application, and the schematic implementation modes and descriptions of the present application are used to explain the present application. In the accompanying drawings:
[0036] Figure 1 It is a framework diagram of a method for making a top layer pattern on the surface of an object according to a preferred embodiment of the present application.
[0037] Figure 2 It is a partial flow chart of a method for making a top layer pattern on the surface of an object according to a preferred embodiment of the present application.
[0038] Figure 3 It is a schematic diagram of the structure of an apparatus for making a top layer pattern on the surface of an object according to a preferred embodiment of the present application.
[0039] Figure 4A-4E The present invention illustrates the processing process and processing effect of the method for making a top layer pattern on the surface of an object according to a preferred embodiment of the present application on a physical model.
[0040] Figure 5A-5E This is the application effect of the method for making a top layer pattern on the surface of an object according to the preferred embodiment of the present application in a real-time interactive case of an automobile. DETAILED DESCRIPTION
[0041] It should be noted that, in the absence of conflict, the embodiments of the present application and the features in each embodiment may be combined with each other.
[0042] The present application will be described in detail below with reference to the accompanying drawings and in combination with implementation modes.
[0043] The method for making a top layer pattern on the surface of an object provided in the present application is preferably as follows Figure 1 As shown, specifically including:
[0044] Step 101, unfolding the object model into a plane; the plane unfolding of the object model may also be called the UV unfolding of the object model, which is to unfold the 3D object model into a plane, for example, unfolding each face of a cube onto a plane.
[0045] Step 102, making a top-level pattern map, wherein the color of the vertices that are not covered by the top-level pattern after the object model plane is unfolded is a reference color value, and cannot be the same as the color value used in the top-level pattern; when making the top-level map, first find the corresponding UV coordinates in the above-mentioned object model UV unfolding plane according to the preset position of the top-level map; then place the top-level pattern on the corresponding coordinates, and set the color value of other areas of the non-top-level pattern to a reference color value that does not appear in the top-level pattern.
[0046] Step 103, calculating the first color value of each vertex according to the coordinates of each vertex of the object model plane unfolding, and calculating the second color value of the top-layer texture at the coordinates of each vertex;
[0047] Step 104: Determine the color value of each vertex according to the reference color value, the first color value, and the second color value.
[0048] It should be noted that the colors displayed on the computer are generally represented by RGB values. Through the above steps, the color that each vertex should use when rendering can be determined. When an additional pattern (top pattern map) is pasted on an object, the additional pattern does not cover the entire object, that is, only the part covering the additional pattern is the content of the pattern, and the other parts are still the original color of the object (such as the inherent material texture of the object itself). When making the map of this additional pattern, the part that is not covered by the pattern needs to be represented by a special color. This color cannot be the color used in the content of the additional pattern, and this color is set to the reference color value. For example, the content of the additional pattern is a blue number, and the color of other areas is a dark gray that has not appeared in the additional pattern, and the reference color is also set to dark gray. In this example, the additional pattern is pasted on a geometric body, assuming that the original color of the geometric body is a red and green square. According to the method of the present application, the first color value is [red or green], and the second color value is the color in the corresponding additional pattern, that is, one of [blue and dark gray], depending on whether the vertex covers the additional pattern. If the second color value is [dark gray], that is, it is the same as the reference color value, it proves that the vertex is not covered by the additional pattern, and the final color value is [red or green], depending on the grid distribution state; if it is not dark gray, that is, different from the reference color value, it proves that the vertex is covered by the additional pattern, and the final color is [blue], which is the inherent color of the additional pattern.
[0049] To explain in detail, Figure 2 The detailed process of the above step 103 and step 104 is shown, which specifically includes:
[0050] Step 201, obtain the top-level texture and calibrate the reference color RGB value of the texture; the reference color value is calibrated here to determine that the reference color value is different from the color in the top-level texture.
[0051] Step 202, obtaining a vertex coordinate of the object model after UV unfolding; in the object model, each surface thereof is divided into a plurality of irregular polygons, each polygon has a plurality of vertices, and each vertex has its own UV coordinate after UV unfolding;
[0052] Step 203, defining the object model according to the UV coordinate of the vertex and determining the first color value of the vertex, that is, the original color value;
[0053] Step 204, defining the RGB value of the second color corresponding to the coordinate in the corresponding top layer pattern according to the UV coordinate;
[0054] Step 205, determining whether the second color RGB value is equal to the reference RGB value; if so, executing step 206, otherwise executing step 207;
[0055] Step 206, the vertex color value corresponding to the UV coordinate is the first color value;
[0056] Step 207, the vertex color value corresponding to the UV coordinate is the second color value;
[0057] Step 208, determine whether all vertices have been processed, if so, end the process, otherwise execute step 202.
[0058] In addition, the present application can also realize the production of the top-layer pattern according to the transparency. The following only describes the differences between this embodiment and the above-mentioned embodiment, and the similarities are omitted here. In this embodiment, the transparency of the pattern after the object model plane is unfolded can be set to 0, that is, completely transparent, and the transparency of the top-layer pattern can be set to 1, that is, completely opaque. After calculating the color of each vertex and the color of each vertex of the corresponding top-layer pattern, if the transparency of the vertex is 0, the vertex uses the original color of the object model; if the transparency is 1, the vertex uses the color of the top-layer pattern, that is, the color of the additional pattern.
[0059] In order to further explain the technical solution of the present application in detail, the present application provides the following preferred embodiments:
[0060] Step 4.1, unfold the three-dimensional object model (in this example, a regular dodecahedron is used) into a plane, that is, the UV unfolding step, as shown in Figure 4A shown.
[0061] Step 4.2, according to the corresponding positions of the vertices of the object after two-dimensional expansion in the plane coordinates, make the bottom layer map. The map partially overlaps with the pattern in the two-dimensional expansion plane of the object, and the color information (in this example, a red and green checkered pattern is used) is used to define the first color value of each vertex of the object, such as Figure 4B shown.
[0062] Step 4.3, create a top-level pattern map based on the vertex coordinates of the two-dimensional unfolded plane. This map overlaps the pattern of the object model after the plane is unfolded, and uses the color information in it (in this case, blue numbers and dark gray background are used) to define the second color value of each vertex of the object. The left figure shows the rendering effect of each vertex of the three-dimensional object completely using the second color value and ignoring the first color value. Figure 4C shown.
[0063] Step 4.4, the top-level pattern map produced above contains at least one attribute value, which is used to indicate the weight value of the top-level pattern on the surface of the object. The attribute describes a reference color value, which is different from the intrinsic color value and the second color value of the top-level pattern map. In this example, the reference color value describes the dark gray color of the digital background. In the second color value depicted in the top-level pattern map (4D figure on the left), all points with the same reference color value will receive a weight of 0, and all points with different reference color values will receive a weight of 1. The figure above on the right shows the weight map of the top-level pattern map, where white is a weight of 1 and black is a weight of 0, as shown in the figure below. Figure 4D shown.
[0064] Step 4.5, according to the weight map of the top-level pattern texture obtained in the previous step, determine the final coloring state of each vertex of the 3D object model according to the plane unfolding coordinates. The position of the top-level pattern texture with a weight of 0 will be set to the first color value, that is, the color of the bottom-level texture (the red and green checkered pattern in this example); Figure 1 The weight position will be set to the second color value, which is the top texture color (the blue number in this example), such as Figure 4E shown.
[0065] Figure 5A-5E Another preferred embodiment is shown for a certain brand of car. Figure 5A In the interactive online display case of a car, the display effect of the car body decal (additional pattern) is not used. When the car body decal is not loaded, the green color of the car body is the pre-defined first color value. Figure 5B , enable the display effect of the car body decal (additional pattern). After loading the decal, the part of the car body covered by the decal shows the decal pattern content, that is, the second color value; the uncovered part still shows the green first color value. Figure 5C The figure shows the three-dimensional geometric model of the car body and the pattern of unfolding the model into a plane coordinate state. Figure 5DIn the figure, the top-level pattern map produced by overlapping the patterns after the above-mentioned three-dimensional geometric body of the car body is unfolded in a plane is presented on the left. The pattern map contains white, light blue, purple, etc. as second color values, among which purple, as the background, does not appear in the actual decal content of the car body. The pattern map contains at least one attribute value, and the reference color value described by it is the purple that exists in a large area in the background. Through the reference color value described by the attribute value and the color value distribution in the actual pattern map, the color weight value of the car body decal described in the black and white schematic diagram on the right can be obtained. The white part in the black and white schematic diagram presents the second color value on the car body, that is, the decal content; the black part presents the first color value on the car body, that is, the original green car body. Figure 5E In the process, after weight calculation and judgment, the color distribution state of the three-dimensional object of the car body shows the superposition effect of the correct car body decal pattern and the basic color of the car body.
[0066] Accordingly, the present application provides a device for making a top layer pattern on a surface of an object, such as Figure 3 As shown, the device includes: an unfolding module, used to unfold the object model into a plane; a making module, used to make a top-level pattern map, wherein the top-level pattern partially overlaps with the pattern after the object model plane is unfolded; a defining module, used to define the first color value of each vertex according to the coordinates of each vertex of the unfolded object model plane, and use the top-level pattern map to define the second color value of the object at each vertex coordinate, wherein the top-level pattern map at least includes at least one attribute value for indicating the weight value of the top-level pattern on the object surface; a determining module, used to determine the color value of each vertex according to the at least one attribute value, the first color value and the second color value.
[0067] The above technical solution provided by this application can reduce the amount of texture production, and the textures previously produced for the original object can continue to be used; reduce the amount of model loading, reduce the burden on the CPU. Reduce the amount of texture loading, reduce the burden on the GPU; this function can be added without affecting the original project or product.
[0068] The above description is only a preferred implementation mode of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for making a top layer pattern on a three-dimensional object surface, characterized in that: The method includes: Unfold the object model into a plane; Produce a top-layer pattern map, wherein the top-layer pattern map partially overlaps with the pattern after the object model plane is unfolded; Defining a first color value of each vertex according to the coordinates of each vertex unfolded by the object model plane, and defining a second color value of the object at each vertex coordinate using a top-level pattern map, wherein the top-level pattern map at least includes at least one attribute value for indicating a weight value of a top-level pattern on the surface of the object; Determine a final color value of each vertex according to the at least one attribute value, the first color value, and the second color value, wherein the final color value is the first color value or the second color value; wherein the at least one attribute value comprises a reference color value, the reference color value being different from an intrinsic color value of the top pattern map; Among them, determining the color value of each vertex according to the at least one attribute value, the first color value and the second color value includes: when the second color value is equal to the reference color value, the color value of the vertex is the first color value, otherwise the color value of the vertex is the second color value.
2. The method according to claim 1, characterized in that The at least one attribute value includes transparency, the transparency of the pattern after the object model is unfolded in a plane is set to be completely transparent, and the transparency of the top-layer pattern map is set to be opaque.
3. The method according to claim 1, characterized in that Determining the color value of each vertex according to the at least one attribute value, the first color value, and the second color value comprises: When the transparency of the vertex is completely transparent, the color value of the vertex is the first color value, otherwise the color value of the vertex is the second color value.
4. The method according to any one of claims 1 to 3, characterized in that: The making of the top layer pattern map comprises: Determine the corresponding vertex coordinates in each top-level pattern according to the preset position of the top-level pattern and the coordinates of each vertex in the plane of the object model; Match the vertex coordinates in the top pattern with the vertex coordinates of the object model plane; At least one property value of the top-level pattern map is set.
5. A device for making a top layer pattern on the surface of a three-dimensional object, characterized in that: The device includes: An unfolding module, used to unfold the object model into a plane; A production module, used for producing a top-level pattern map, wherein the top-level pattern map overlaps with a pattern portion after the object model plane is unfolded; A definition module, used to define a first color value of each vertex according to the coordinates of each vertex unfolded by the object model plane, and to define a second color value of the object at each vertex coordinate using a top-level pattern map, wherein the top-level pattern map at least includes at least one attribute value for indicating a weight value of a top-level pattern on the surface of the object; a determination module, configured to determine a final color value of each vertex according to the at least one attribute value, the first color value, and the second color value, wherein the final color value is the first color value or the second color value; wherein the at least one attribute value comprises a reference color value, the reference color value being different from an intrinsic color value of the top pattern map; The determination module is further configured to set the color value of the vertex to the first color value if the second color value is equal to the reference color value, and to set the color value of the vertex to the second color value otherwise.
6. The device according to claim 5, characterized in that The at least one attribute value includes transparency, the transparency of the pattern after the object model plane is unfolded is set to be completely transparent, and the transparency of the top pattern map is set to be opaque.
7. The device according to claim 5, characterized in that The determination module is further configured to set the color value of the vertex to a first color value when the transparency of the vertex is completely transparent, and to set the color value of the vertex to a second color value otherwise.
8. The device according to any one of claims 5 to 7, characterized in that: The production module is also used to determine the corresponding vertex coordinates in each top-level pattern according to the pre-set position of the top-level pattern and the vertex coordinates of the object model plane; correspond the vertex coordinates in the top-level pattern to the vertex coordinates of the object model plane; and set at least one attribute value of the top-level pattern map.
Citation Information
Patent Citations
Multi-earthquake-attribution-fused texture mapping body drawing method based on nontransparency weighing
CN102903141A
Model rendering method and device, electronic equipment and storage medium
CN111540024A