Disclosure of Invention
In order to solve the problem that technicians pay extra labor to generate extra production amount no matter modeling or model binding in a process with a requirement on previewing in the prior art, the invention provides a method and a device for previewing CG assets efficiently.
In a first aspect, the present invention provides a method for efficiently previewing CG assets, the method comprising:
mapping multi-quadrant UV of the UDIM space into an initial UV quadrant by UV editing software through an arrangement algorithm;
acquiring coordinates of any point in an initial UV quadrant in a UV mapping relation;
according to the coordinate corresponding relation of any point in the initial UV quadrant, acquiring a corresponding space point and side in the UDIM space multi-quadrant UV;
determining mapping information of each channel required by the material of the surface according to spatial points and edges of a multi-quadrant UV of a UDIM space, sampling according to resolution to obtain mapping information of a corresponding mapping in an initial space UV quadrant, and determining mapping information in a preview UV space;
and acquiring different preview requirements of the user, and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements.
Further, determining mapping information of each channel required by the material of the surface according to the spatial point and the edge of the UDIM space multi-quadrant UV, sampling according to the resolution to obtain mapping information of a corresponding mapping in the initial space UV quadrant, and determining the mapping information in the preview UV space comprises:
obtaining a corresponding mapping surface according to the space points and edges of the UDIM space multi-quadrant UV;
acquiring a corresponding color on a picture as first color information;
replacing the color of the mapping surface with the mapping relation in the initial UV quadrant with the first color information, and taking the replaced color as second color information;
and determining the mapping information in the preview UV space according to all the acquired second color information.
Further, obtaining a corresponding mapping surface according to the spatial points and edges of the UDIM spatial multi-quadrant UV includes:
and preprocessing except the shape of a face block is carried out on an image formed by the space points and edges of the multi-quadrant UV in the UDIM space.
Further, obtaining a corresponding mapping surface according to the spatial points and edges of the UDIM space multi-quadrant UV, and then:
and performing computer processing of pixel extension on the boundary line of the obtained mapping surface.
Further, acquiring different preview requirements of the user, and displaying the UV corresponding mapping relation and the map information according to the preview requirements includes:
if the requirement of a user for previewing the UV mapping is obtained, displaying the UDIM space multi-quadrant UV and the mapping information on the multi-quadrant UV as previewing contents;
and if the requirement of a user for previewing the UV mapping of the UDIM space is obtained, displaying the mapping information mapped to an initial UV quadrant and the initial UV quadrant as preview content.
Further, acquiring different preview requirements of a user, and displaying the UV corresponding mapping relation and the map information according to the preview requirements further comprises:
and respectively and independently storing the generated files corresponding to different preview requirements into separate files according to different preview requirements of the user.
In a second aspect, the present invention provides an apparatus for efficiently previewing CG assets, the apparatus comprising:
the initial UV quadrant generation module is used for mapping the UDIM space multi-quadrant UV into an initial UV quadrant by the UV editing software through an arrangement algorithm;
the system comprises an initial UV quadrant acquisition module, a data acquisition module and a data acquisition module, wherein the initial UV quadrant acquisition module is used for acquiring coordinates of any point in the initial UV quadrant in a UV mapping relation;
the corresponding space point and edge acquisition module is used for acquiring a space point and an edge corresponding to any point coordinate corresponding relation in the initial UV quadrant in the UDIM space multi-quadrant UV;
the preview mapping information determining module is used for determining mapping information of each channel required by the material of the surface of the UDIM space according to the spatial points and edges of the UDIM space multi-quadrant UV, obtaining mapping information of a corresponding mapping in an initial space UV quadrant according to resolution sampling, and determining mapping information in a preview UV space;
and the different-requirement display information module is used for acquiring different preview requirements of the user and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements.
Further, the preview map information determining module includes:
acquiring a three-dimensional space mapping surface unit, which is used for acquiring a corresponding mapping surface according to space points and edges of multi-quadrant UV (ultraviolet) in a UDIM space;
a first color obtaining unit for obtaining a corresponding color on the sticker sheet as first color information;
the second color information acquisition unit is used for replacing the color of the mapping surface with the mapping relation in the initial UV quadrant with the first color information, and taking the replaced color as second color information;
and the map information determining unit is used for determining the map information in the preview UV space according to all the acquired second color information.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the steps of the method for efficiently previewing CG assets provided by the first aspect.
In a fourth aspect, the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method for efficiently previewing CG assets provided by the first aspect.
The method and the device for efficiently previewing the CG assets provided by the invention simultaneously solve the manufacturing problem of rendering and animation previewing which have almost opposite technical requirements on materials, can provide asset output of two downstream links aiming at different requirements on the premise of not additionally increasing workload, avoid manual time of doing UV and making a mapping twice, and can obtain a color previewing effect basically consistent with a rendering effect. When the animation is manufactured, the animation can be manufactured by the display effect close to the final rendering, the effect is more accurate, and the efficiency is higher.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, a general three-dimensional character asset production is divided into these several stages: and modeling a polygon, rendering a model by UV, pasting a picture, and rendering a material ball. The specific description is as follows:
1. and (3) polygon modeling: in the stage, a three-dimensional space model is created according to the design, and for a model meeting the subsequent specification, the water-rising ship height is inevitable according to the model details and the polygon quantity to meet the design with more complex and higher quality requirements.
UV development: after any model white model is subjected to structure and technical inspection, a set of planes UV for drawing a chartlet needs to be created and unfolded in the tool, and the planes UV are required to be arranged in a square coordinate for drawing convenience. In popular terms, the skin in a three-dimensional space is cut and flattened. Technically speaking, a set of mapping relation from a two-dimensional space to a three-dimensional model surface is provided.
3. Mapping: according to the unfolded square UV grid, a chartlet of each channel required by rendering the material ball is drawn in the plane drawing software, the higher the chartlet resolution is, the thinner the drawing is according to the detail requirement, and the better the final effect is. The map comprises: bright and dark color texture maps, highlight texture maps, concave-convex normal maps, and the like.
4. Rendering a material ball: defining a calculation mode of final rendering presentation in a renderer, and connecting a chartlet drawn by the chartlet to corresponding channels on a material ball, or drawing the chartlet according to channels required by the material ball. Many renderers require advanced features that often have additional mapping requirements. In addition, the later rendering link can require the texture rendering side to output enough AOV layered output.
Based on the introduction of the manufacturing stage, if the quality of the assets needs to be improved, the following steps are required:
a. in the modeling phase, lines and details are laid out as much as possible.
b. The UV is spread out reasonably and a sufficient amount of detail is drawn using a map with as high a resolution as possible.
c. The material ball with advanced rendering characteristics in some renderers is used, and in addition, strong AOV layered output can bring great convenience to synthesis after the later rendering is finished.
After the above operations are completed, subsequent binding and animation take a complex material ball or material network plus several tens of posters multiplied by a channel. When the display is opened in a three-dimensional preview window in a subsequent link production platform, for example, maya, a complex material network does not necessarily contain openGL codes for display because points on the network do not necessarily contain openGL codes for display, and the three-dimensional preview window cannot necessarily be called and displayed normally. And even under the condition of normal display, the production platform has to read the dozens of pictures to normally calculate the result display in the tool through the display card. While a common 4k resolution tif image file size ranges from tens of megabits to tens of megabits. Then an entire set of maps will amount to hundreds of megabytes or gigabytes of maps. In subsequent links, such as animation links, this number will be doubled. This makes smooth interactivity almost impossible when creating a slightly larger animation scene.
The existing solution idea is as follows: 1. in some production projects with low requirements, the subsequent link can directly use a standard simple Lambert material ball without any input to cover a complex rendering material on the model to enter the subsequent link. This method is to remove texture maps in exchange for interactivity. 2. In some production projects which need to have color information to produce subsequent animation links, the resolution of a chartlet for rendering is directly reduced on the premise of no UV, and a set of low-resolution preview chartlet is generated. 3. An un-textured model can be directly exported for binding and animation during the model publishing phase by using an automatic means. For the reduced resolution, the low-resolution mapping can be directly generated by using a script when the model is published, or directly generated by using a third-party picture processing tool in a folder.
The disadvantages of this are: in some cases causing animation to be out of place, with additional rework. For example, a map without eyes results in an incorrect gaze of a character in the rendered image; by adopting a high-low resolution method, the problem of path switching of two sets of maps is necessarily existed in the later use, and in addition, in the incomplete automation environment, the problem of the non-matching of two sets of version maps is possibly generated; the purpose is achieved by establishing a second completely different set of preview UV of the model and a simple map redrawn according to the preview UV, but the additional second set of UV and the map bring additional workload cost, and the cost of modification and updating is doubled.
In order to solve the above problem, an embodiment of the present invention provides a method for efficiently previewing CG assets, as shown in fig. 2, the method including:
step S201, mapping multi-quadrant UV of a UDIM space into an initial UV quadrant by UV editing software through an arrangement algorithm;
step S202, acquiring coordinates of any point in an initial UV quadrant in a UV mapping relation;
step S203, acquiring a corresponding space point and edge in the UDIM space multi-quadrant UV according to the coordinate corresponding relation of any point in the initial UV quadrant;
step S204, determining mapping information of each channel required by the material of the surface according to the spatial point and the edge of the UDIM spatial multi-quadrant UV, sampling according to the resolution to obtain mapping information of a corresponding mapping in the initial spatial UV quadrant, and determining mapping information in the preview UV space;
and S205, acquiring different preview requirements of the user, and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements.
Specifically, according to UV editing software, such as the layout UV function in Maya, a plurality of Maya UV plug-ins, the UV rearrangement function of ufold 3d third-party tool, the UV Pelt in houdini, and the uvflatted node, etc., the arrangement of each UV image in three-dimensional space into one UV quadrant is realized, specifically, the UV is actually the projection of a set of three-dimensional space point number coordinates (xyz) and edge numbers in two-dimensional space (UV), in various UV editing graphics tools, the UV of a cut block is scaled by using the operations of shifting, cutting, and gluing, the density is kept averaged according to the area in three-dimensional space, the rotational movement is scaled and arranged into one UV quadrant, so that the UV compression in UDIM space is mapped into a unified initial UV quadrant.
Obtaining any point coordinate in the initial UV quadrant in the UV mapping relationship, where the UV space point and edge on each set of UV corresponds to the three-dimensional space point and edge on the UDIM space multi-quadrant UV, so that it can be found which space points and edges of the UDIM space multi-quadrant UV correspond to the obtained space points and edges, for example: for example, a triangle, three vertices of a two-dimensional triangle in the UV space can actually find three vertices of a corresponding three-dimensional space, and similarly, the three-dimensional space vertices can also find their own two-dimensional space vertices in the UV space coordinates, that is, there is a certain mapping relationship between them.
And then according to the mapping relation, determining each channel mapping information required by the material of the surface to which the spatial point and the edge of the UDIM space multi-quadrant UV belong, wherein the mapping information comprises information such as color, intensity, direction and the like. And displaying the image in the space corresponding to the UV image in the 0-1 quadrant to obtain the same mapping information so as to obtain the previewed mapping information.
And then, displaying the mapping relation and the mapping information of the UV corresponding image according to the preview requirement of the user. In the embodiment of the present invention, two sets of UV image mapping relationships and mapping information for different requirements are provided, and specifically, refer to fig. 3.
The method for efficiently previewing the CG assets provided by the embodiment of the invention simultaneously solves the manufacturing problem of rendering and animation previewing which have almost opposite technical requirements on materials, can provide asset output of two downstream links aiming at different requirements on the premise of not additionally increasing workload, avoids manual time of doing UV and making a mapping twice, and can obtain a color previewing effect basically consistent with a rendering effect. When the animation is manufactured, the animation can be manufactured by the display effect close to the final rendering, the effect is more accurate, and the efficiency is higher.
Based on the content of the above embodiments, as an alternative embodiment: determining mapping information of each channel required by the material of the surface according to the spatial point and the edge of the UDIM space multi-quadrant UV, sampling according to the resolution to obtain mapping information of a corresponding mapping in the initial space UV quadrant, and determining the mapping information in the preview UV space comprises the following steps:
obtaining a corresponding mapping surface according to the space points and edges of the UDIM space multi-quadrant UV;
acquiring a corresponding color on a picture as first color information;
replacing the color of the mapping surface with the mapping relation in the initial UV quadrant with the first color information, and taking the replaced color as second color information;
and determining the mapping information in the preview UV space according to all the acquired second color information.
Specifically, in the UDIM space multi-quadrant UV, each spatial point and associated edge are combined into a surface, and the combined surface is displayed with a color, that is, a corresponding color on the surface of the map, which is referred to herein as first color information. And then replacing the color of the mapping surface with the mapping relation in the initial UV quadrant by the first color information, wherein the mapping surface formed in the initial UV quadrant is corresponding to the spatial point and the edge of the UDIM spatial multi-quadrant UV to present a mapping relation, then calling the color information after the mapping replacement in the initial UV quadrant as second color information, and taking the mapping information presented by the UV in the whole 0-1 quadrant as a preview image for a user to preview.
Based on the content of the above embodiments, as an alternative embodiment: obtaining a corresponding mapping surface according to spatial points and edges of the UDIM spatial multi-quadrant UV includes:
and preprocessing except the shape of a face block is carried out on an image formed by the space points and edges of the multi-quadrant UV in the UDIM space.
Specifically, UV is usually in units of tiles, so images other than tiles on a map can be pre-processed for discard.
Based on the content of the above embodiments, as an alternative embodiment: obtaining a corresponding mapping surface according to spatial points and edges of multi-quadrant UV in a UDIM space, and then:
and performing computer processing of pixel extension on the boundary line of the obtained mapping surface.
Specifically, since the chartlet is a dot-matrix chart, the oblique lines at the boundary of the UV block need to consider the problem of black-edged jaggies due to the loss caused by sampling, and therefore, 1-2 pixels are generally extended from the boundary in the calculation process.
Based on the content of the above embodiments, as an alternative embodiment: acquiring different preview requirements of a user, and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements comprises the following steps:
if the requirement of a user for previewing the UV mapping is obtained, displaying the UDIM space multi-quadrant UV and the mapping information on the multi-quadrant UV as previewing contents;
and if the requirement of a user for previewing the UV mapping of the UDIM space is obtained, displaying the mapping information mapped to an initial UV quadrant and the initial UV quadrant as preview content.
Specifically, as shown in fig. 3, after the polygon modeling is obtained, according to the obtained requirement of the user on the preview quality, two assets of downstream links can be output, for example, a UV mapping node for user preview is obtained, and then mapping information on a multi-quadrant UV and a multi-quadrant UV in a UDIM space is displayed as preview content; and if the user previewing the UDIM space UV mapping node is obtained, displaying the mapping information mapped to an initial UV quadrant and the initial UV quadrant as previewing content. Shown in FIG. 3 are: selecting a branch according to the UVset, if the UV mapping node is previewed, corresponding to a previewing material file, previewing a corresponding simple material, and displaying the previewing information in a VP2.0 window in real time; if the UDIM space UV mapping node is previewed, corresponding to the UDIM material file, and then previewing the corresponding simple material, the previewing information is calculated and output aov through a renderer such as arnlod. It should be noted that, for different requirements of rendering and previewing, a suitable material ball and a material network may be selected according to actual situations, for example, in maya, a material and UV previewed on a base material ball such as surface and lambert may be used. And in the aspect of rendering, a better effect can be realized by using a renderer-dedicated material ball, such as an arnold's own material ball.
Compared with the traditional method for scaling the mapping resolution, the embodiment of the invention has the advantages that the number of the mapping is less from the aspect of efficiency, no matter the number of the original rendered mapping is, only one mapping is previewed, the read data volume is reduced from hundreds of giga to one mapping after the file is calculated and opened, tens of mega is calculated, and the interaction speed is increased by hundreds of times. But also does not need to constantly switch the resolution to meet different differences between preview and rendering; in the display window of the maya production tool, the lifting range of the FPS of the unit number to the dozens of FPS is generated. The memory occupied by the whole asset is reduced, and the problem of explosion display memory of a computer display card and the problem of stability of the whole manufacturing environment are avoided.
Based on the content of the above embodiments, as an alternative embodiment: the method comprises the following steps of acquiring different preview requirements of a user, and displaying corresponding UV images and mapping information according to the preview requirements, and further comprises the following steps:
and respectively and independently storing the generated files corresponding to different preview requirements into separate files according to different preview requirements of the user.
Specifically, as shown in fig. 4, in the final output stage of different preview requirements, the UV image and the map information displayed according to the preview requirements are separately stored as separate files, and there are two output schemes, which are not interfered with each other and are used by different downstream links. For example, the original project files for making the finished rendering UV and rendering the mapping in the step of passing through during release in the diagram are independently stored as the original working files; the step of uploading the map to the server in the step of issuing is independently stored as a map file, the following storage is sequentially carried out, and in addition, the attached GPUcache, the alert, the ass and the dependency information are stored as files with suffixes of gpu, abc, ass and info.
According to another aspect of the present invention, an apparatus for providing credit data storage is provided in the embodiment of the present invention, referring to fig. 5, fig. 5 is a block diagram of an apparatus for efficiently previewing CG assets provided in the embodiment of the present invention. The device is used for completing the efficient preview of CG assets provided by the embodiment of the invention in the previous embodiments. Therefore, the description and definition in the method for efficiently previewing CG assets provided by the embodiments of the present invention in the foregoing embodiments can be used for understanding of the execution modules in the embodiments of the present invention.
The device includes:
an initial UV quadrant generation module 501, configured to map the UDIM spatial multi-quadrant UV into an initial UV quadrant through an arrangement algorithm by UV editing software;
an arbitrary point acquisition module 502 in the initial UV quadrant, configured to acquire an arbitrary point coordinate in the initial UV quadrant in the UV mapping relationship;
a corresponding space point and edge acquiring module 503, configured to acquire a space point and an edge corresponding to any point coordinate in the initial UV quadrant in the UDIM space multi-quadrant UV;
a preview mapping information determining module 504, configured to determine mapping information of each channel required by a material to which a surface belongs according to spatial points and edges of a multi-quadrant UV in the UDIM space, obtain mapping information of a corresponding mapping in an initial space UV quadrant according to resolution sampling, and determine mapping information in a preview UV space;
and a different requirement display information module 505, configured to obtain different preview requirements of the user, and display the UV corresponding mapping relationship and the map information according to the preview requirements.
Specifically, the specific process of each module in the apparatus of this embodiment to implement its function may refer to the related description in the corresponding method embodiment, and is not described herein again.
The device for efficiently previewing the CG assets provided by the embodiment of the invention simultaneously solves the manufacturing problem of rendering and animation previewing which have almost opposite technical requirements on materials, can provide asset output of two downstream links aiming at different requirements on the premise of not additionally increasing workload, avoids manual time of doing UV and making a mapping twice, and can obtain a color previewing effect basically consistent with a rendering effect. When the animation is manufactured, the animation can be manufactured by the display effect close to the final rendering, the effect is more accurate, and the efficiency is higher.
Based on the content of the above embodiments, as an alternative embodiment: the preview map information determining module comprises:
acquiring a three-dimensional space mapping surface unit, which is used for acquiring a corresponding mapping surface according to space points and edges of multi-quadrant UV (ultraviolet) in a UDIM space;
a first color obtaining unit for obtaining a corresponding color on the sticker sheet as first color information;
the second color information acquisition unit is used for replacing the color of the mapping surface with the mapping relation in the initial UV quadrant with the first color information, and taking the replaced color as second color information;
and the map information determining unit is used for determining the map information in the preview UV space according to all the acquired second color information.
Specifically, the specific process of each module in the apparatus of this embodiment to implement its function may refer to the related description in the corresponding method embodiment, and is not described herein again.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device includes: a processor 601, a memory 602, and a bus 603;
the processor 601 and the memory 602 complete communication with each other through the bus 603, respectively; the processor 601 is used to invoke program instructions in the memory 602 to perform the method for efficiently previewing CG assets provided by the above embodiments, including for example: mapping multi-quadrant UV of the UDIM space into an initial UV quadrant by UV editing software through an arrangement algorithm; acquiring coordinates of any point in an initial UV quadrant in a UV mapping relation; according to the coordinate corresponding relation of any point in the initial UV quadrant, acquiring a corresponding space point and side in the UDIM space multi-quadrant UV; determining mapping information of each channel required by the material of the surface according to spatial points and edges of a multi-quadrant UV of a UDIM space, sampling according to resolution to obtain mapping information of a corresponding mapping in an initial space UV quadrant, and determining mapping information in a preview UV space; and acquiring different preview requirements of the user, and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, performs the steps of a method for efficiently previewing CG assets. Examples include: mapping multi-quadrant UV of the UDIM space into an initial UV quadrant by UV editing software through an arrangement algorithm; acquiring coordinates of any point in an initial UV quadrant in a UV mapping relation; according to the coordinate corresponding relation of any point in the initial UV quadrant, acquiring a corresponding space point and side in the UDIM space multi-quadrant UV; determining mapping information of each channel required by the material of the surface according to spatial points and edges of a multi-quadrant UV of a UDIM space, sampling according to resolution to obtain mapping information of a corresponding mapping in an initial space UV quadrant, and determining mapping information in a preview UV space; and acquiring different preview requirements of the user, and displaying the UV corresponding mapping relation and the mapping information according to the preview requirements.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, the principle and the implementation of the present invention are explained by applying the specific embodiments in the present invention, and the above description of the embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.