Art asset processing method and device, program product and electronic equipment
By converting art asset files in language and data format, the problem of art asset reuse between different graphics platforms is solved, automatic conversion is realized, and manual migration costs are reduced.
Patent Information
- Application Number
- CN202411573108.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-14
AI Technical Summary
The existing technology is difficult to reuse art asset files between different graphics platforms, resulting in developers having to carry out a lot of manual migration, which consumes time and labor costs.
By obtaining the art asset files based on the first graphic platform, performing language conversion and data format conversion, an art asset file suitable for the second graphic platform is generated.
It realizes the reuse of art assets between different graphics platforms without manual migration, reducing time and labor costs.
Smart Images

Figure CN119440521A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an art asset processing method, an art asset processing device, a computer program product, and an electronic device. Background Art
[0002] The development of games, animations, movies, and TV shows requires the use of graphics platforms such as DCC (Digital Content Creation) software and game engines. The data structures of art asset files such as shaders and materials may be different on different graphics platforms. Therefore, it is difficult to reuse art asset files between different graphics platforms, and developers are usually required to perform a lot of manual migration work, which is time-consuming and labor-intensive. Summary of the invention
[0003] The present disclosure provides an art asset processing method, an art asset processing device, a computer program product and an electronic device, so as to at least to some extent solve the problem that art assets are difficult to reuse between different graphic platforms.
[0004] According to a first aspect of the present disclosure, a method for processing art assets is provided, the method comprising: obtaining a first art asset file based on a first graphic platform; performing language conversion processing on a first object to be processed in the first art asset file according to a first graphic language adopted by the first graphic platform and a second graphic language adopted by a second graphic platform; performing data format conversion processing on a second object to be processed in the first art asset file according to a data format of the second graphic platform; the second object to be processed includes variables associated with the first object to be processed; and generating a second art asset file suitable for the second graphic platform based on the processed first object to be processed and the processed second object to be processed.
[0005] According to a second aspect of the present disclosure, there is provided an art asset processing device, the device comprising: a file acquisition module, configured to acquire a first art asset file based on a first graphic platform; a first processing module, configured to perform language conversion processing on a first object to be processed in the first art asset file according to a first graphic language adopted by the first graphic platform and a second graphic language adopted by a second graphic platform; a second processing module, configured to perform data format conversion processing on a second object to be processed in the first art asset file according to a data format of the second graphic platform; the second object to be processed comprises variables associated with the first object to be processed; and a file generation module, configured to generate a second art asset file suitable for the second graphic platform based on the processed first object to be processed and the processed second object to be processed.
[0006] According to a third aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method of the first aspect and possible implementations thereof are implemented.
[0007] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of the above-mentioned first aspect and its possible implementation methods by executing the executable instructions.
[0008] The technical solution disclosed in this disclosure has the following beneficial effects:
[0009] Acquire a first art asset file based on a first graphic platform; perform language conversion processing on the first object to be processed therein; perform data format conversion processing on the second object to be processed therein; and generate a second art asset file suitable for a second graphic platform based on the processed first object to be processed and the second object to be processed. Thus, a solution for converting art assets between different graphic platforms is provided, which can automatically convert the first art asset file based on the first graphic platform into a second art asset file suitable for the second graphic platform, thereby realizing the reuse of art assets between different graphic platforms, eliminating the need for manual migration of art assets, and reducing time and labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A system architecture diagram in this exemplary embodiment is shown;
[0011] Figure 2 A flowchart showing a method for processing art assets in this exemplary embodiment;
[0012] Figure 3 A schematic diagram showing an art asset conversion interface in this exemplary embodiment;
[0013] Figure 4 A flowchart showing a language conversion process performed in the present exemplary embodiment;
[0014] Figure 5 A flowchart showing another execution language conversion process in this exemplary embodiment;
[0015] Figure 6 A schematic diagram showing inputting a first path and a second path in this exemplary embodiment;
[0016] Figure 7 A schematic diagram showing the effect of the first art asset file in this exemplary embodiment;
[0017] Figure 8A schematic diagram showing the effect of the second art asset file in this exemplary embodiment;
[0018] Fig. 9 A schematic diagram showing the structure of a fine art asset processing device in this exemplary embodiment is shown;
[0019] Fig.10 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0020] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0021] The accompanying drawings are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art should appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc.
[0022] A graphics platform is a software platform used to create computer graphics, which may include basic frameworks and functions. For example, a graphics platform may refer to a game engine or a DCC software. Different graphics platforms may have different data structures for their art asset files. For example, some game engines use HLSL (High-Level Shading Language) to write shaders, and some game engines use GLSL (OpenGL Shading Language) to write shaders. Shaders written in different computer graphics languages have different data structures. In related technologies, if art asset files are to be reused between different graphics platforms, developers are required to perform a lot of manual migration work, which is even equivalent to re-executing the development process, which is time-consuming and labor-intensive.
[0023] In view of one or more of the above problems, an exemplary embodiment of the present disclosure provides an art asset processing method for converting art asset files between different graphics platforms. The graphics platform may refer to a game engine or a DCC software. In this exemplary embodiment, the game engine includes but is not limited to various game engines commonly used in the market, and the DCC software includes but is not limited to various DCC software commonly used in the market, such as Houdini, MAYA, Blender, 3DS MAX, etc.
[0024] Figure 1 The system architecture diagram of the operating environment of this exemplary embodiment is shown. The system architecture may include a terminal device 110 and a server 120. Among them, the terminal device 110 may be a mobile phone, a tablet computer, a personal computer, a smart wearable device, a game console, etc., which has a display function and can display a graphical user interface. The graphical user interface may include an operating system interface or an application interface, etc. The terminal device 110 is provided with an art asset conversion tool. When the tool is enabled, an art asset conversion interface may be displayed. The user can perform corresponding operations for art asset conversion in the interface, such as inputting a first path and a second path, and clicking a "convert" control to start the conversion process. The server 120 can provide art asset conversion services, such as providing art asset conversion tools between different game engines, or performing specific art asset processing processes. It can be a single server or a cluster of multiple servers. The terminal device 110 and the server 120 can be connected via a wired or wireless communication link for data transmission.
[0025] In one embodiment, multiple versions of art asset conversion tools are provided on the server 120, and each version of the art asset conversion tool includes art asset conversion codes and scripts between two specific graphic platforms. For example, the art asset conversion tool of version A is used to convert art assets of the first game engine to the second game engine, and the art asset conversion tool of version B is used to convert art assets of the first game engine to the third game engine. If the user needs to convert the art asset files in the first game engine to assets that can be used by the second game engine, the art asset conversion tool of version A can be downloaded from the server 120 to the terminal device 110, and the tool can be used on the terminal device 110 to implement the specific conversion process.
[0026] The art asset processing method in this exemplary embodiment may be executed by any one or more of the terminal device 110 and the server 120 .
[0027] In one implementation, no server may be deployed, and the art asset processing method may be implemented only on the terminal device 110 .
[0028] Figure 2 The schematic flow of the art asset processing method is shown, which may include the following steps:
[0029] Step S210, obtaining a first art asset file based on a first graphic platform;
[0030] Step S220, performing language conversion processing on the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform;
[0031] Step S230, performing data format conversion processing on the second object to be processed in the first art asset file according to the data format of the second graphic platform; the second object to be processed includes a variable associated with the first object to be processed;
[0032] Step S240: generating a second art asset file suitable for a second graphic platform based on the processed first object to be processed and the processed second object to be processed.
[0033] Among them, the first object to be processed may be an object that needs to be processed by language conversion, such as a shader, function, etc.; the second object to be processed may be an object that needs to be processed by data format conversion, such as material data, variables, etc.
[0034] exist Figure 2 In the method shown, a first art asset file based on a first graphic platform is obtained; a language conversion process is performed on the first object to be processed therein; a data format conversion process is performed on the second object to be processed therein; and a second art asset file suitable for a second graphic platform is generated based on the processed first object to be processed and the second object to be processed. Thus, a solution for converting art assets between different graphic platforms is provided, which can automatically convert a first art asset file based on a first graphic platform into a second art asset file suitable for a second graphic platform, thereby realizing the reuse of art assets between different graphic platforms, eliminating the need for manual migration of art assets, and reducing time and labor costs.
[0035] Below Figure 2 Provide detailed instructions for each step.
[0036] refer to Figure 2 In step S210, a first art asset file based on a first graphics platform is obtained.
[0037] In this exemplary embodiment, the first graphics platform is the source platform for art asset conversion, and the second graphics platform is the target platform, that is, the art assets need to be converted from the first graphics platform to the second graphics platform. The first graphics platform and the second graphics platform can be any two different graphics platforms, such as the first graphics platform is a first game engine, and the second graphics platform is a second game engine.
[0038] Art asset files are files used to implement virtual elements with art effects, which may include art-related data of virtual elements. Exemplarily, art asset files may include, but are not limited to, shader files and material files. The present disclosure does not limit the format of art asset files, such as spzs, mtg, fx, etc.
[0039] The first art asset file is an art asset file based on the first graphics platform. Exemplarily, the first art asset file may be an art asset file edited and generated using the first graphics platform. Alternatively, the first art asset file may be an art asset file produced by other means and then imported into the first graphics platform for use. For example, if an art asset file produced by Houdini is imported into the first game engine for use, the first game engine may be regarded as the first graphics platform, and the art asset file is an art asset file based on the first graphics platform.
[0040] In one implementation, the first art asset file may be an art asset file imported by a user when performing art asset conversion. The user herein refers to a user who processes art assets, and may include a developer.
[0041] In one implementation, the obtaining of the first art asset file based on the first graphics platform may include the following steps:
[0042] Provides an art asset conversion interface;
[0043] According to the first path input in the art asset conversion interface, a first art asset file is obtained from the first path.
[0044] Among them, this exemplary embodiment can implement the art asset processing method as a corresponding program or tool (such as an art asset conversion tool), and the art asset conversion interface can be the interface of the tool for users to perform interactive operations. Figure 3 A schematic diagram of an art asset conversion interface is shown. A user can enter a first path in the "Original Shader Path" column of the interface, and the program can obtain a first art asset file from the first path.
[0045] In one implementation, after obtaining the first art asset file applicable to the first graphics platform, the art asset processing method may further include the following steps:
[0046] The first art asset file is pattern matched using a regular expression to find one or more of the following objects in the first art asset file: a variable of a preset variable type; a floating point number; a string that conforms to a preset format; an assignment statement. The one or more objects include one or more of the first object to be processed and the second object to be processed.
[0047] Exemplarily, a preconfigured regular expression can be used for pattern matching to find variable types in HLSL or GLSL, such as float, int, float2, uint3x3, etc.; or to find floating-point numbers (with or without a trailing f), matching numbers in the form of -1.0, 3.14, 2.718f, etc.; or to find strings that conform to a preset format, such as a string that starts with a newline character, contains angle brackets and any characters in the angle brackets, a string that starts with a colon and a space, and is followed by one or more word characters, etc.; or to find assignment statements, such as optional assignment statements in C, C++, and HLSL programming languages.
[0048] Continue to refer Figure 2 In step S220, language conversion is performed on the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform.
[0049] The first graphics language used by the first graphics platform and the second graphics language used by the second graphics platform may be different. For example, the first graphics platform is a first game engine, and the first graphics language used is HLSL, and the second graphics platform is a second game engine, and the second graphics language used is GLSL. The first object to be processed is an object with different statement forms under different graphics languages, such as a shader. According to the difference between the first graphics language and the second graphics language, the first object to be processed in the first art asset file can be converted into a language so that it complies with the rules of the second graphics language.
[0050] In one implementation, a regular expression may be used to perform pattern matching on the first art asset file to find the first object to be processed in the first art asset file, and then language conversion is performed on the first object to be processed according to the difference between the first graphic language and the second graphic language.
[0051] In one embodiment, reference Figure 4As shown, the language conversion process of the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform may include the following steps S410 and S420:
[0052] Step S410, determining syntax data to be converted between the first graphics platform and the second graphics platform according to a first graphics language used by the first graphics platform and a second graphics language used by the second graphics platform, and creating a corresponding macro;
[0053] Step S420 , mapping one or more of the following first objects to be processed using a macro: sampler, texture, batch parameter, vertex attribute.
[0054] For example, modules or statements with the same functions in the first graphic language and the second graphic language may be collected, and the grammatical data to be converted may be determined by comparison. The grammatical data to be converted may include but are not limited to: SamplerConvert, MacroUnused, MacroToUniform, UniformNegativeZ, AttributeConvert, UniformConvert, BatchUniformConvert, NxFunctionIncluded.
[0055] When the syntax data to be converted is determined, a macro for implementing syntax conversion and mapping can be created. Exemplarily, the macros that need to be converted can be adjusted according to the number of macro switches of the first graphics platform or the second graphics platform, sampler conversion, parameter conversion, batch parameter conversion can be created, and parameters that do not need to be converted, such as 'if', 'float2', 'float3', 'float4', 'int1', 'int2', 'mul', etc. are determined. Construct a mapping relationship between sampler names and texture names, obtain a uniform mapping relationship, obtain an attribute mapping relationship, obtain a vertex attribute mapping relationship, determine macros that need to be disabled, functions that need to be skipped, etc. Use macros to map the first object to be processed to the processed first object to be processed to achieve language conversion.
[0056] In one embodiment, the first art asset file includes a first shader file. Figure 5 As shown, the language conversion process of the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform may include the following steps S510 and S520:
[0057] Step S510, determining a first object to be processed in a first shader file; for example, pattern matching may be performed through a regular expression to find out the first object to be processed.
[0058] Step S520: performing character replacement on the first object to be processed according to the grammar conversion rule between the first graphic language and the second graphic language.
[0059] In different graphic languages, characters expressing the same meaning or function (such as functions) are usually not exactly the same. The language conversion rule may include character correspondence rules between two graphic languages, according to which the characters in the first object to be processed can be replaced with their corresponding characters in the second graphic language to achieve language conversion processing.
[0060] In one embodiment, the first graphics language includes a high-level shader language, and the second graphics language includes an OpenGL shader language. The above-mentioned character replacement of the first object to be processed according to the syntax conversion rule between the first graphics language and the second graphics language may include the following steps:
[0061] According to the syntax conversion rules between the high-level shader language and the OpenGL shading language, at least one of the following character replacements is performed on the first object to be processed: replacing the operator in the first object to be processed; replacing the variable name in the first object to be processed; replacing the function header in the first object to be processed; replacing the pixel attribute name in the first object to be processed; after completing the character replacement, the first processed object is obtained.
[0062] Exemplarily, the first art asset file can be traversed to obtain the data types of uniforms, local variables, and vertex attributes, obtain the variations (mutations) of the shader, and obtain varyings. Construct a varying mapping relationship from the first game engine fx (fx is a file or data format) to the second game engine fx, obtain the pixel shader function body, convert the macro into a uniform or variation switch, and convert tex2D, tex2Dlod, and tex2Dproj into the form of Sample calls. Convert mul (scalar / vector, scalar / vector) into the form of *, remove else{}, replace uniform, rename variables starting with an underscore, replace time with FrameTime→alphaRef with AlphaRef, replace the function header with #, replace the pixel attribute name, etc. Thus, the first processed object to be processed is obtained.
[0063] Continue to refer Figure 2In step S230, data format conversion is performed on the second object to be processed in the first art asset file according to the data format of the second graphics platform; the second object to be processed includes variables associated with the first object to be processed.
[0064] The first object to be processed may be an object in the first art asset file that needs to be processed for data format conversion. Exemplarily, the first object to be processed includes a shader, and the second object to be processed includes material data associated with the shader, which can be regarded as a variable with the shader as a function. During the data format conversion process, the parameter information of the material can be adjusted. In addition, the variable type can be converted, the format of the string can be converted, etc., to obtain the processed first object to be processed.
[0065] In one implementation, a regular expression may be used to perform pattern matching on the first art asset file to find the second object to be processed in the first art asset file, and then data format conversion is performed on the second object to be processed according to the data format of the second graphics platform.
[0066] In one embodiment, the second object to be processed includes vertex data. The data format conversion process of the second object to be processed in the first art asset file according to the data format of the second graphics platform may include the following steps:
[0067] According to the coordinate system format of the second graphics platform, coordinate system conversion processing is performed on the vertex data in the first art asset file.
[0068] Among them, different graphics platforms may use different coordinate system formats, such as coordinate system rules, coordinate representation methods, coordinate numerical scales, etc. There may be differences. For example, the first graphics platform uses a left-handed coordinate system, and the second graphics platform uses a right-handed coordinate system. These differences will cause the shader and the like on the first graphics platform and the second graphics platform to be inconsistent, and the effects cannot be aligned.
[0069] The coordinate system conversion can be performed on the vertex data in the first art asset file according to the coordinate system format of the second graphics platform. For example, in 3DS MAX, the model is generally facing backwards. When converting to other graphics platforms, the Y-axis coordinates of the model vertices in the local coordinate system can be changed to the opposite number (such as adding a minus sign before the Y-axis coordinate) to achieve the uniform orientation of the model.
[0070] By converting the coordinate system of the vertex data, the coordinate system format of the second graphics platform can be matched, which can ensure the consistency of the presentation effect of the art assets.
[0071] In one embodiment, since the second object to be processed includes variables associated with the first object to be processed, steps S220 and S230 can be executed synchronously, that is, in the process of performing language conversion processing on the first object to be processed, data format conversion processing can be performed synchronously on the variables associated with the first object to be processed, thereby ensuring that both functions and variables are converted and the processed statements can be executed correctly.
[0072] It should be understood that there may be some data objects in the first art asset file that are both first objects to be processed and second objects to be processed, and both language conversion processing and data format conversion processing are performed on these objects.
[0073] Continue to refer Figure 2 In step S240, a second art asset file suitable for a second graphics platform is generated based on the processed first object to be processed and the second object to be processed.
[0074] Exemplarily, the first object to be processed in the first art asset file can be replaced with the processed first object to be processed, and the second object to be processed can be replaced with the processed second object to be processed. The first art asset file after the above replacement is the second art asset file.
[0075] In one implementation, the generating of the second art asset file applicable to the second graphics platform may include the following steps:
[0076] According to the second path input in the art asset conversion interface, a second art asset file is generated in the second path.
[0077] refer to Figure 3 As shown, the user can enter the second path in the "Convert Shader Path" column in the art asset conversion interface, which indicates the generation path or save path of the converted second art asset file. Figure 6 As shown, after the user enters the first path and the second path, he can click "Start Conversion" and the program can obtain the first art asset file from the first path. Figure 2 After completing Figure 2 After the processing shown, a second art asset file may be generated in a second path.
[0078] In one implementation, after the second art asset file is generated, the second art asset file may be opened in the second graphics platform to facilitate the user to verify the final effect. Figure 7 The effect of loading the first art asset file in the first graphics platform is shown. Figure 8The effect of loading the second art asset file in the second graphics platform is shown. The user can compare the actual effects of the art assets in different graphics platforms. In response to the confirmation generation instruction, if the user passes the verification, click the confirmation instruction, and finally output the second art asset file.
[0079] The exemplary embodiment of the present disclosure also provides an art asset processing device. Fig. 9 As shown, the art asset processing device 900 includes the following program modules:
[0080] The file acquisition module 910 is configured to acquire a first art asset file based on a first graphic platform;
[0081] A first processing module 920 is configured to perform language conversion processing on a first object to be processed in the first art asset file according to a first graphic language adopted by the first graphic platform and a second graphic language adopted by the second graphic platform;
[0082] The second processing module 930 is configured to perform data format conversion processing on the second object to be processed in the first art asset file according to the data format of the second graphics platform; the second object to be processed includes a variable associated with the first object to be processed;
[0083] The file generation module 940 is configured to generate a second art asset file suitable for the second graphic platform based on the processed first object to be processed and the processed second object to be processed.
[0084] In one embodiment, the device is also used to: after obtaining a first art asset file based on a first graphics platform, use a regular expression to perform pattern matching on the first art asset file to find out one or more of the following objects in the first art asset file: a variable belonging to a preset variable type; a floating point number; a character string that conforms to a preset format; an assignment statement; wherein the one or more objects include one or more of the first object to be processed and the second object to be processed.
[0085] In one embodiment, the second object to be processed includes vertex data; and performing data format conversion processing on the second object to be processed in the first art asset file according to the data format of the second graphics platform includes: performing coordinate system conversion processing on the vertex data in the first art asset file according to the coordinate system format of the second graphics platform.
[0086] In one embodiment, the language conversion processing of the first object to be processed in the first art asset file according to the first graphics language adopted by the first graphics platform and the second graphics language adopted by the second graphics platform includes: determining the syntax data to be converted between the first graphics platform and the second graphics platform according to the first graphics language adopted by the first graphics platform and the second graphics language adopted by the second graphics platform, and creating corresponding macros; using the macros to map one or more of the following first objects to be processed: samplers, textures, batch parameters, vertex attributes.
[0087] In one embodiment, the first art asset file includes a first shader file; and the language conversion processing is performed on the first object to be processed in the first art asset file according to the first graphics language adopted by the first graphics platform and the second graphics language adopted by the second graphics platform, including: determining the first object to be processed in the first shader file; and performing character replacement on the first object to be processed according to the syntax conversion rules between the first graphics language and the second graphics language.
[0088] In one embodiment, the first graphics language includes a high-level shader language, and the second graphics language includes an OpenGL shading language; the character replacement of the first object to be processed according to the syntax conversion rules between the first graphics language and the second graphics language includes: performing at least one of the following character replacements on the first object to be processed according to the syntax conversion rules between the high-level shader language and the OpenGL shading language: replacing operators in the first object to be processed; replacing variable names in the first object to be processed; replacing function headers in the first object to be processed; replacing pixel attribute names in the first object to be processed.
[0089] In one embodiment, obtaining a first art asset file based on a first graphics platform includes: providing an art asset conversion interface; obtaining the first art asset file from a first path according to a first path entered in the art asset conversion interface; generating a second art asset file suitable for the second graphics platform includes: generating the second art asset file at the second path according to a second path entered in the art asset conversion interface.
[0090] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0091] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0092] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and the computer program implements the above method when executed by a processor.
[0093] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0094] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0095] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0096] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure. For example, the above method can be executed, which includes the following steps: Step S210, obtaining a first art asset file based on a first graphics platform; Step S220, performing language conversion processing on the first object to be processed in the first art asset file according to the first graphics language adopted by the first graphics platform and the second graphics language adopted by the second graphics platform; Step S230, performing data format conversion processing on the second object to be processed in the first art asset file according to the data format of the second graphics platform; the second object to be processed includes variables associated with the first object to be processed; Step S240, based on the processed first object to be processed and the processed second object to be processed, generating a second art asset file suitable for the second graphics platform.
[0097] The above method steps are implemented through a computer program to obtain a first art asset file based on a first graphic platform; perform language conversion processing on the first object to be processed therein; perform data format conversion processing on the second object to be processed therein; and generate a second art asset file suitable for a second graphic platform based on the processed first object to be processed and the second object to be processed. Thus, a solution for converting art assets between different graphic platforms is provided, which can automatically convert a first art asset file based on a first graphic platform into a second art asset file suitable for a second graphic platform, thereby realizing the reuse of art assets between different graphic platforms, eliminating the need for manual migration of art assets, and reducing time and labor costs.
[0098] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.
[0099] Reference below Fig.10 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Fig.10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0100] like Fig.10As shown, the electronic device 1000 may include: a processor 1010 , a memory 1020 , a bus 1030 , an I / O (input / output) interface 1040 , a network adapter 1050 , and a display 1060 .
[0101] The memory 1020 may include a volatile memory, such as a RAM 1021, a cache unit 1022, and may also include a non-volatile memory, such as a ROM 1023. The memory 1020 may also include one or more program modules 1024, such program modules 1024 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 1024 may include each module in the above-mentioned device.
[0102] The processor 1010 may include one or more processing units. For example, the processor 1010 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0103] Processor 1010 can be used to execute executable instructions stored in memory 1020, such as the above method, which includes the following steps: step S210, obtaining a first art asset file based on a first graphics platform; step S220, performing language conversion processing on a first object to be processed in the first art asset file according to a first graphics language adopted by the first graphics platform and a second graphics language adopted by the second graphics platform; step S230, performing data format conversion processing on a second object to be processed in the first art asset file according to a data format of the second graphics platform; the second object to be processed includes variables associated with the first object to be processed; step S240, generating a second art asset file suitable for the second graphics platform based on the processed first object to be processed and the processed second object to be processed.
[0104] The processor 1010 executes the above method steps to obtain a first art asset file based on a first graphic platform; performs language conversion processing on the first object to be processed; performs data format conversion processing on the second object to be processed; and generates a second art asset file suitable for a second graphic platform based on the processed first object to be processed and the second object to be processed. Thus, a solution for converting art assets between different graphic platforms is provided, which can automatically convert a first art asset file based on a first graphic platform into a second art asset file suitable for a second graphic platform, realizes the reuse of art assets between different graphic platforms, eliminates the need for manual migration of art assets, and reduces time and labor costs.
[0105] The bus 1030 is used to realize the connection between different components of the electronic device 1000, and may include a data bus, an address bus, and a control bus.
[0106] The electronic device 1000 can communicate with one or more external devices 1100 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 1040 .
[0107] The electronic device 1000 can communicate with one or more networks through the network adapter 1050. For example, the network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 1050 can communicate with other modules of the electronic device 1000 through the bus 1030.
[0108] The electronic device 1000 may display a graphical user interface, such as an art asset conversion interface, through the display 1060 .
[0109] although Fig.10 Not shown, other hardware and / or software modules may also be provided in the electronic device 1000, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0110] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0111] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
Claims
1. A method for processing art assets, characterized in that: The method comprises: Acquire a first art asset file based on a first graphics platform; Performing language conversion processing on the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform; According to the data format of the second graphics platform, a data format conversion process is performed on the second object to be processed in the first art asset file; the second object to be processed includes a variable associated with the first object to be processed; A second art asset file suitable for the second graphics platform is generated based on the processed first object to be processed and the processed second object to be processed.
2. The method according to claim 1, characterized in that After obtaining the first art asset file based on the first graphic platform, the method further includes: Performing pattern matching on the first art asset file using a regular expression to find one or more of the following objects in the first art asset file: a variable of a preset variable type; a floating point number; a string that complies with a preset format; an assignment statement; The one or more objects include one or more of the first object to be processed and the second object to be processed.
3. The method according to claim 1, characterized in that The second object to be processed includes vertex data; and performing data format conversion processing on the second object to be processed in the first art asset file according to the data format of the second graphics platform includes: According to the coordinate system format of the second graphics platform, coordinate system conversion processing is performed on the vertex data in the first art asset file.
4. The method according to claim 1, characterized in that: The performing language conversion processing on the first object to be processed in the first art asset file according to the first graphic language adopted by the first graphic platform and the second graphic language adopted by the second graphic platform includes: Determine syntax data to be converted between the first graphics platform and the second graphics platform according to a first graphics language used by the first graphics platform and a second graphics language used by the second graphics platform, and create corresponding macros; The macro is used to map one or more of the following first objects to be processed: samplers, textures, batch parameters, and vertex attributes.
5. The method according to claim 1, characterized in that The first art asset file includes a first shader file; and performing language conversion processing on the first object to be processed in the first art asset file according to the first graphics language adopted by the first graphics platform and the second graphics language adopted by the second graphics platform includes: Determine the first object to be processed in the first shader file; According to the grammar conversion rule between the first graphic language and the second graphic language, characters of the first object to be processed are replaced.
6. The method according to claim 5, characterized in that The first graphics language includes a high-level shader language, and the second graphics language includes an OpenGL shader language; and performing character replacement on the first object to be processed according to a syntax conversion rule between the first graphics language and the second graphics language includes: According to the syntax conversion rules between the high-level shader language and the OpenGL shading language, at least one of the following character replacements is performed on the first object to be processed: replacing the operator in the first object to be processed; replacing the variable name in the first object to be processed; replacing the function header in the first object to be processed; replacing the pixel attribute name in the first object to be processed.
7. The method according to any one of claims 1 to 6, characterized in that: The obtaining of a first art asset file based on a first graphics platform includes: Provides an art asset conversion interface; According to a first path input in the art asset conversion interface, obtaining the first art asset file from the first path; The generating a second art asset file applicable to the second graphics platform includes: The second art asset file is generated in the second path according to the second path input in the art asset conversion interface.
8. An art asset processing device, characterized in that: The device comprises: A file acquisition module, configured to acquire a first art asset file based on a first graphic platform; A first processing module is configured to perform language conversion processing on a first object to be processed in the first art asset file according to a first graphic language adopted by the first graphic platform and a second graphic language adopted by the second graphic platform; A second processing module is configured to perform data format conversion processing on a second object to be processed in the first art asset file according to a data format of the second graphics platform; the second object to be processed includes a variable associated with the first object to be processed; The file generation module is configured to generate a second art asset file suitable for the second graphics platform based on the processed first object to be processed and the processed second object to be processed.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
