Method and device for determining dynamic effect of 3D font, medium and product

By obtaining the target picture set and creating mesh, combining coordinate transformation, random selection and texture perturbation operations, the problem of traditional technology being unable to meet complex needs and large memory usage is solved, and more complex 3D font dynamic effects and memory savings are achieved.

CN119026570APending Publication Date: 2024-11-26SHANGHAI MIHA YOUHAIYUANCHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411115748.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Traditional 3D font dynamic effect technology cannot meet complex needs and consumes a lot of memory.

Method used

By obtaining the target picture set, create a mesh carrying the target data of text characters, and determine the dynamic effect of 3D fonts based on the mesh. Coordinate transformation, random selection and texture perturbation operations are used to achieve complex effects. At the same time, the index path and dynamic parameters are configured in an offline environment. Reduce memory burden.

Benefits of technology

It realizes more complex 3D font dynamic effects, reduces memory usage, reduces the configuration workload of planners, and improves performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026570A_ABST
    Figure CN119026570A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a method and equipment for determining the dynamic effect of a 3D font, a medium and a product. The method comprises the following steps: acquiring a target image set; according to the target image set, creating a mesh; wherein the mesh carries target data corresponding to text characters of the target atlas, and the target data is used for realizing a 3D font dynamic effect; and determining a 3D font dynamic effect according to the mesh. The technical problems that in traditional related technical schemes, the requirement for the more complex 3D font dynamic effect in actual application cannot be met, and the occupied memory is large can be solved at least.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, medium and product for determining a 3D font dynamic effect. Background Art

[0002] Currently, many game applications have implemented 3D dynamic font effects that support multiple languages. These 3D dynamic font effects can not only effectively improve the guidance of the game, making it possible to more intuitively guide players to pay attention to important information in the game (such as mission objectives, operation guides or plot prompts), but also increase aesthetic interest.

[0003] In the related technologies for realizing 3D dynamic font effects, a 3D font dynamic effect solution based on the TextMeshPro component is generally used. However, the inventors have at least found that the traditional related technical solutions cannot meet the needs of more complex 3D font dynamic effects in practical applications, and occupy a large amount of memory. Summary of the invention

[0004] One purpose of the present application is to provide a method, device, medium and product for determining 3D font dynamic effects, at least to solve the technical problem that traditional related technical solutions cannot meet the needs of more complex 3D font dynamic effects in practical applications and have a large memory usage.

[0005] To achieve the above objectives, some embodiments of the present application provide the following aspects:

[0006] In a first aspect, some embodiments of the present application also provide a method for determining a 3D font dynamic effect, the method comprising: obtaining a target atlas; creating a mesh based on the target atlas; wherein the mesh carries target data of text characters corresponding to the target atlas, and the target data is used to achieve a 3D font dynamic effect; and determining the 3D font dynamic effect based on the mesh.

[0007] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.

[0008] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.

[0009] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.

[0010] Optionally, acquiring the target atlas includes: acquiring a target atlas of a target component; wherein the target component is used to display text.

[0011] Optionally, the target atlas is used to represent image files based on different language types in different regions.

[0012] Optionally, the target data includes at least one of the following: the original order of text characters, the order after rearranging the original order, and the position information of the text characters; the creation of mesh according to the target atlas includes: determining the original order of text characters, the order after rearranging the original order, and the position information of the text characters according to the target atlas; creating mesh according to the original order of text characters, the order after rearranging the original order, and the position information of the text characters. In this way, a specific implementation content of the target data and a specific implementation method of creating mesh according to the target atlas are provided, which is conducive to realizing more complex 3D font dynamic effects.

[0013] Optionally, determining the 3D font dynamic effect according to the mesh includes: performing a target operation according to the target data in the mesh; wherein the target operation includes at least one of the following: a coordinate transformation operation, a random selection operation, and a texture disturbance operation; and determining the 3D font dynamic effect according to the result of performing the target operation. This is conducive to further realizing more complex 3D font dynamic effects such as three-dimensional rotation, random appearance, and sequential appearance.

[0014] Optionally, the coordinate transformation operation is used to perform at least one of three-dimensional rotation, scaling and offset operations on the text characters; the random selection operation is used to control the text characters to appear or disappear randomly or in a preset order; and the texture disturbance operation is used to make the text characters present a distortion effect.

[0015] Optionally, the target atlas is configured in an offline environment, and the method for determining the target atlas includes: determining an index path according to different areas included in the map; wherein the index paths of the target atlases corresponding to different areas are different; and loading the target atlas corresponding to the language type according to the index path. In this way, a specific implementation method for obtaining the target atlas is provided, which can solve the technical problem of large memory usage in traditional related technical solutions.

[0016] Optionally, after the target atlas corresponding to the language type is loaded according to the index path, the method further includes: automatically storing the target atlas in a preset resource path; configuring dynamic parameters corresponding to the target atlas according to the preset resource path; correspondingly, determining the 3D font dynamic effect according to the character mesh includes: determining the 3D font dynamic effect according to the dynamic parameters and the mesh. In this way, it is possible to support automatic baking of atlases of corresponding language types in a multilingual environment, thereby reducing the workload of planners in configuration.

[0017] Optionally, the automatic storage of the target atlas in a preset resource path includes: collecting text characters according to the target atlas; obtaining a texture image corresponding to the text characters; storing the target atlas in a preset resource path according to the texture image; correspondingly, determining the 3D font dynamic effect according to the dynamic parameter and the mesh includes: generating a font file according to the texture image, the dynamic parameter and the mesh; determining the 3D font dynamic effect according to the font file. A specific implementation method for automatically storing the target atlas in a preset resource path is provided.

[0018] Optionally, the method further includes: detecting whether the text character has changed; updating the texture image corresponding to the text character according to the detection result; storing the target atlas in a preset resource path according to the updated texture image; correspondingly, generating a font file according to the texture image, the dynamic parameter and the mesh includes: generating a font file according to the updated texture image, the dynamic parameter and the mesh. In this way, when the text character changes, the workload of the planner in configuration can be further reduced.

[0019] Compared with the related art, the solution provided in the embodiment of the present application is further improved based on the traditional 3D font dynamic effect solution based on the TextMeshPro component. In the present application, a target atlas is obtained, and then a mesh is created according to the target atlas; wherein the mesh carries target data of text characters corresponding to the target atlas, and the target data is used to achieve 3D font dynamic effects, thereby determining the 3D font dynamic effects based on the mesh. Since in the present application, the mesh carries target data of text characters corresponding to the target atlas, more complex 3D font dynamic effects can be achieved based on the target data, thereby achieving the purpose of meeting the demand for more complex 3D font dynamic effects in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0021] Figure 1 An exemplary flow chart of a method for determining a 3D font dynamic effect according to some embodiments of the present application;

[0022] Figure 2 An exemplary schematic diagram of a 3D font dynamic effect in a method for determining a 3D font dynamic effect provided according to some embodiments of the present application;

[0023] Figure 3 This is an exemplary flow chart of step S102 in a method for determining a 3D font dynamic effect according to some embodiments of the present application;

[0024] Figure 4 This is an exemplary flow chart of step S103 in a method for determining a 3D font dynamic effect according to some embodiments of the present application;

[0025] Figure 5 An exemplary schematic diagram of the target atlas in a method for determining a 3D font dynamic effect provided according to some embodiments of the present application;

[0026] Figure 6 An exemplary flow chart of an atlas baking part in an offline environment in an application example of a method for determining a 3D font dynamic effect provided according to some embodiments of the present application;

[0027] Figure 7 An exemplary flow chart of the effect calculation part at runtime in an application example of a method for determining a 3D font dynamic effect provided according to some embodiments of the present application;

[0028] Figure 8 This is a schematic diagram of an exemplary structure of an electronic device provided according to some embodiments of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] The following terms are used in this article.

[0031] 3D font dynamic effect: It is a kind of three-dimensional effect that can realize various dynamic transformations in three-dimensional space, such as rotation, scaling and jitter, etc. It is widely used in film, television and games.

[0032] TextMeshPro component: It is a component used to display text in the Unity game engine. It is a solution used to replace the original UI text component in Unity. It provides advanced text rendering functions and can flexibly and freely control text format and layout.

[0033] Multi-language: Games released for the international market generally need to consider multi-language support, so that the text content of the game can be localized and translated according to the user's system language settings, and automatically switched to the corresponding language. For example, a set of text effects will be displayed in Chinese, English or Japanese according to the user's settings.

[0034] Mesh: In computer graphics and game development, mesh refers to a mesh, which is a three-dimensional geometric structure composed of multiple vertices, edges, and faces. These vertices define the shape of an object in three-dimensional space, edges are line segments connecting vertices, and faces are polygons composed of multiple vertices and edges, usually triangles or quadrilaterals. They are the basis for rendering 3D scenes.

[0035] Shader: A program used to calculate rendering effects, mainly executed on the GPU.

[0036] SDF: Signed Distance Field, also known as Signed Distance Field, is a data tool used to define the surface of a shape or object in space. It provides a value for each point in space, which represents the exact distance from the point to the nearest surface.

[0037] Baking: In TextMeshPro, baking is the process of pre-rendering and storing the texture information of text characters into an image file.

[0038] Atlas: It is a large image file that contains multiple small images. These small images can be various textures, icons, font characters, etc. in the game.

[0039] Offline environment: refers to the stage where developers edit and create games within the game engine.

[0040] Runtime: refers to the stage when the game program is running, which is also the stage when the player finally plays the game.

[0041] Floor: In game development, Floor refers to a specific map or area that is part of the game world where players can explore and interact. Game developers can use the game editor to plan a map to configure game tasks, gameplay, and plot files.

[0042] First embodiment

[0043] The first embodiment of the present application relates to a method for determining a 3D font dynamic effect. Figure 1 As shown, the method may include the following steps:

[0044] Step S101, obtaining a target atlas;

[0045] Step S102, creating a mesh according to the target atlas; wherein the mesh carries target data of text characters corresponding to the target atlas, and the target data is used to achieve a 3D font dynamic effect;

[0046] Step S103: determining a 3D font dynamic effect according to the mesh.

[0047] The following is a detailed description of each of the above steps.

[0048] With respect to step S101, specifically, in some examples, obtaining the target atlas may include: obtaining the target atlas of the target component; wherein the target component is used to display text. For example, the target component may be a TextMeshPro component or other components for displaying text that have the same or similar functions as the TextMeshPro component, and this embodiment of the application does not specifically limit this. The target component may be applied to different engines according to actual needs, and this embodiment of the application does not specifically limit the engine. In some examples, the program may automatically assign the target atlas to the TextMeshPro component.

[0049] Optionally, in some embodiments, the target atlas can be used to represent image files based on different language types in different regions. In some other embodiments, the target atlas can also be a complete, full-scale atlas resource. The region mentioned here has the same meaning as the term Floor commonly used in games. The different language types may include, for example, Chinese, Japanese, Korean, etc., in order to adapt to the language type selected by the player based on the game.

[0050] Regarding step S102, specifically, in some examples, during the process of creating a mesh by the TextMeshPro component, target data corresponding to the text characters in the area for realizing a 3D font dynamic effect may be compressed and embedded into the mesh to complete the creation of the mesh.

[0051] Regarding step S103, specifically, in some examples, in Shader, the effect calculation may be performed according to the target data embedded in the mesh to determine the 3D font dynamic effect.

[0052] For example, Figure 2 The figure shows an exemplary display of a 3D font dynamic effect.

[0053] It is understandable that in some solutions of the related technology, in order to meet the needs of more complex 3D font dynamic effects in practical applications, the vertices of text characters are directly operated by the CPU. Although this can meet some complex needs, the CPU needs to perform a lot of calculations to process vertex data. In real-time games, this high calculation cost will affect the smoothness and response speed of the game, and the performance is not ideal. Since in this application, the calculation of 3D font dynamic effects can be performed in Shader, this means that this application is executed in parallel on the GPU side, so the performance is relatively outstanding.

[0054] Here is an explanation of the general principle implemented in the embodiment of the present application: the TextMeshPro component can use the signed distance field SDF technology to render 3D fonts. Specifically, game developers can render text characters as a target atlas in an offline environment, a process called "baking". Through baking, the texture information of the text characters is pre-calculated and stored so that it can be quickly used when the game is running. When the game is running and needs to display text, the TextMeshPro component will dynamically generate a 3D model corresponding to the text characters, and each text character will be converted into a mesh, each mesh is provided with corresponding texture coordinates, and through the texture coordinates, the TextMeshPro component can sample the corresponding texture from the pre-baked target atlas, thereby rendering the corresponding 3D font dynamic effect in 3D space. Due to the use of the signed distance field SDF technology, the TextMeshPro component can maintain the clarity of the text characters, and will not be blurred or distorted even at different resolutions and zoom levels, and it also makes it easier to achieve visual effects such as strokes and shadows, enhancing the visual effects and readability of 3D fonts.

[0055] It is not difficult to find that compared with the related art, the solution provided in the embodiment of the present application is based on the traditional 3D font dynamic effect solution based on the TextMeshPro component and has been further improved. In the present application, a target atlas is obtained, and then a mesh is created according to the target atlas; wherein the mesh carries target data of text characters corresponding to the target atlas, and the target data is used to achieve 3D font dynamic effects, thereby determining the 3D font dynamic effects based on the mesh. Since in the present application, the mesh carries target data of text characters corresponding to the target atlas, more complex 3D font dynamic effects can be achieved according to the target data, thereby achieving the purpose of meeting the demand for more complex 3D font dynamic effects in practical applications.

[0056] Second embodiment

[0057] The second embodiment of the present application relates to a method for determining a 3D font dynamic effect. The second embodiment is an improvement on the first embodiment, and the specific improvement is that: in the second embodiment of the present application, a specific implementation content of the target data is provided, and a specific implementation method of creating a mesh according to the target atlas is provided.

[0058] Specifically, in some embodiments, the target data may include, but is not limited to, at least one of the following: the original order of text characters, the order after rearranging the original order, and the position information of the text characters;

[0059] The step S102 of creating a mesh according to the target atlas may further include the following steps: Figure 3 As shown:

[0060] Step S1021, determining the original order of the text characters, the order after rearranging the original order, and the position information of the text characters according to the target atlas;

[0061] Step S1022: Create a mesh according to the original order of the text characters, the order after rearranging the original order, and the position information of the text characters.

[0062] Exemplarily, in the process of creating a mesh according to the target atlas, the original order of text characters obtained from the target atlas, the order after rearranging the original order, and the position information of the text characters can be compressed and stored in the mesh data structure to complete the creation of the mesh.

[0063] Exemplarily, a shuffling algorithm may be used according to the original order of the text characters to obtain an order after rearranging the original order.

[0064] It should be noted that the second embodiment of the present application may also be an improvement based on the first embodiment.

[0065] It is not difficult to find that in the embodiment of the present application, a specific implementation content of the target data is provided, as well as a specific implementation method of creating a mesh according to the target atlas, which is conducive to achieving more complex 3D font dynamic effects.

[0066] Third embodiment

[0067] The third embodiment of the present application relates to a method for determining a 3D font dynamic effect. The third embodiment is an improvement on the first embodiment, and the specific improvement is: in the third embodiment of the present application, a specific implementation method for determining a 3D font dynamic effect based on the mesh is provided.

[0068] Specifically, in some embodiments, the step of determining the 3D font dynamic effect according to the mesh, that is, step S103, may further include the following steps: Figure 4 As shown:

[0069] Step S1031', performing a target operation according to the target data in the mesh; wherein the target operation includes at least one of the following: a coordinate transformation operation, a random selection operation, and a texture disturbance operation;

[0070] Step S1032': determining a 3D font dynamic effect according to the result of performing the target operation.

[0071] For example, the mesh can be parsed in the Shader, and the target data can be combined with the dynamic parameters corresponding to the target atlas configuration to perform effect calculations to perform target operations. Among them, by performing at least one of the following operations according to the target information: coordinate transformation operation, random selection operation and texture perturbation operation, the purpose of achieving complex 3D font dynamic effects can be achieved.

[0072] Optionally, in some embodiments, the coordinate transformation operation is used to perform at least one of three-dimensional rotation, scaling and offset operations on the text characters; the random selection operation is used to control the text characters to appear or disappear randomly or in a preset order; and the texture disturbance operation is used to make the text characters present a distortion effect.

[0073] Exemplarily, the coordinate transformation operation can be used to perform at least one of three-dimensional rotation, scaling and offset operations on the text characters according to the position information of the text characters in the target data; specifically, the position information of each text character stored can be used to calculate the position value of the geometric vertex of each text character in its own coordinate space, and then at least one of three-dimensional rotation, scaling and offset operations can be performed on the text characters according to the position value. In this way, dynamic effects such as text characters rotating and falling from the air can be simulated.

[0074] Exemplarily, the random selection operation can be used to control the text characters to appear or disappear randomly or in a preset order according to the original order of the text characters in the target data and the order after the original order is rearranged; specifically, the original order of each stored text character and the order after the original order is rearranged can be used to create an effect in which text characters appear randomly (such as jump) or disappear in a sentence, or to create an effect in which text characters appear one by one in chronological order, similar to printing word by word on a typewriter.

[0075] Exemplarily, the texture perturbation operation can be used to add noise texture to the text characters to make the text characters appear distorted, thereby achieving the purpose of enhancing artistic expression.

[0076] It should be noted that the third embodiment of the present application may also be an improvement based on the second embodiment.

[0077] It is not difficult to find that in the embodiments of the present application, a target operation is performed according to the target data in the mesh; wherein the target operation includes at least one of the following: a coordinate transformation operation, a random selection operation, and a texture perturbation operation; and according to the result of performing the target operation, it is determined that the 3D font dynamic effect is satisfied, and a specific implementation method for determining the 3D font dynamic effect according to the mesh is provided, which is conducive to further realizing more complex 3D font dynamic effects such as three-dimensional rotation, random appearance, and sequential appearance.

[0078] Fourth embodiment

[0079] The fourth embodiment of the present application relates to a method for determining a 3D font dynamic effect. The fourth embodiment is an improvement on the first embodiment, and the specific improvement is that: in the fourth embodiment of the present application, the target atlas is configured in an offline environment, and a method for determining the target atlas is provided, and corresponding to the method for determining the target atlas, a specific implementation method for obtaining the target atlas is provided.

[0080] Specifically, in some embodiments, the target atlas is configured in an offline environment, and the method for determining the target atlas includes:

[0081] Step S201, determining an index path according to different areas included in the map; wherein the index paths of the target atlas corresponding to different areas are different;

[0082] Step S202: Load a target atlas corresponding to the language type according to the index path.

[0083] Specifically, in the embodiment of the present application, atlas baking is performed in an offline environment.

[0084] For example, planners can configure dialogue text in the game engine according to the game IP settings, and the dialogue text is the content to be displayed through 3D font dynamic effects later. The dialogue text refers to the dialogue between characters in the game or the interactive text between characters and the environment. These texts are important ways for players to understand the game story and character motivations.

[0085] For example, after the dialog text is configured, it can be baked separately according to the different areas included in the map, and the text of each area can be baked into an atlas separately to obtain multiple target atlases, and different target atlases correspond to texts in different areas. It can be understood that since the target atlases corresponding to different areas can be managed separately, planners can increase the number of texts configured for the target atlas according to actual needs without worrying about the impact of the overall size of the atlas on memory.

[0086] For example, see Figure 5 As shown in , different target atlases correspond to different language types. Especially for languages ​​with non-alphabet type, such as Chinese, Japanese, Korean, etc. Figure 5 In the example shown, floor_0, floor_1, ... floor_n represent different areas. Floor_0 includes target atlases with language types of Chinese, Japanese, and Korean, respectively; floor_1 includes target atlases with language types of Chinese, Japanese, and Korean, respectively, and so on. In this embodiment, by creating a separate target atlas for each language type, it can be ensured that the text of each language type can be displayed correctly and can be managed and loaded independently of other languages. It should be noted that the above is only an exemplary description, and the language types are not limited to the above.

[0087] Specifically, in the embodiment of the present application, the step of obtaining the target atlas is performed at runtime. The target atlas corresponds to different language types in different regions.

[0088] Exemplarily, the program can automatically obtain the target atlas according to the user's current region and the language selected by the user, and assign the target atlas to the TextMeshPro component.

[0089] It is understandable that in traditional related technical solutions, the entire atlas resource will be loaded into the memory at once and in full when the game is running, especially when these atlas resources generally include non-Latin alphabet languages ​​such as Chinese and Korean, which will cause the file corresponding to the atlas resource to be very large. Such large files will significantly increase memory usage, thus bringing a large memory burden to the game.

[0090] Since in the present application, the target atlas is obtained according to different language types corresponding to different regions, it is possible to bake text characters of different language types in different regions separately, and load them on demand when the game is running. This can avoid the process of loading the entire atlas resource into the memory all at once when the game is running, as in the traditional related technical solutions, thereby solving the technical problem of large memory usage in the traditional related technical solutions.

[0091] It should be noted that the fourth embodiment of the present application may also be an improvement based on the second embodiment and / or the third embodiment.

[0092] It is not difficult to find that in the embodiment of the present application, the target atlas is configured in an offline environment, and a method for determining the target atlas is provided, and a specific implementation method for obtaining the target atlas is provided corresponding to the method for determining the target atlas, which can solve the technical problem of large memory usage in traditional related technical solutions.

[0093] Fifth embodiment

[0094] The fifth embodiment of the present application relates to a method for determining a 3D font dynamic effect. The fifth embodiment is an improvement on the fourth embodiment, and the specific improvement is that in the fifth embodiment of the present application, a technical solution is provided after a target atlas corresponding to the language type is loaded according to the index path.

[0095] Specifically, in some embodiments, after loading the target atlas corresponding to the language type according to the index path, the method may further include the following steps:

[0096] Step S301, automatically storing the target atlas in a preset resource path.

[0097] Step S302, configuring dynamic parameters corresponding to the target atlas according to the preset resource path;

[0098] Correspondingly, determining the 3D font dynamic effect according to the character mesh may include:

[0099] Step S1031, determining a 3D font dynamic effect according to the dynamic parameter and the mesh.

[0100] Exemplarily, an editor tool may be used to save the target atlas to a specified resource path in an automated manner.

[0101] For example, the planner can configure the dynamic parameters according to the text content of the target atlas and the dynamic effect to be achieved. In actual application, the dynamic parameters corresponding to several common dynamic expressions can be preset in the system, and the relevant personnel can directly select according to these preset dynamic parameters.

[0102] Correspondingly, when the game is running, in the Shader, according to the dynamic parameters and the mesh, in the process of determining the dynamic effect of the 3D font, the corresponding Animator state machine can be activated according to the dynamic parameters, and the corresponding dynamic effect can be played. For example, if the text content of the target atlas is used to express fear, the target atlas can be configured with a disturbance and distortion effect, accompanied by a jittering dynamic parameter, so as to achieve the purpose of enhancing the fear atmosphere.

[0103] Optionally, in some embodiments, the target atlas is automatically stored in a preset resource path, that is, step S301 may further include the following steps:

[0104] Step S3011, collecting text characters according to the target atlas;

[0105] Step S3012, obtaining a texture image corresponding to the text character;

[0106] Step S3013: store the target atlas in a preset resource path according to the texture image.

[0107] Correspondingly, the step of determining the 3D font dynamic effect according to the dynamic parameter and the mesh, that is, step S1031, may further include the following steps:

[0108] Step S10311, generating a font file according to the texture image, the dynamic parameters and the mesh;

[0109] Step S10312, determining the 3D font dynamic effect according to the font file.

[0110] Exemplarily, all text characters can be extracted from the target atlas through an Excel list. The text characters can be converted into Unicode first, and then the Unicode is input into the Unity interface, so that Unity can generate a texture image corresponding to the text characters, and automatically store the target atlas in a preset resource path according to the texture image.

[0111] Correspondingly, the texture image, the dynamic parameters, the mesh and other material information are uniformly loaded into the game assets for baking, and the baked product is a font file that can be used at runtime. Thus, the 3D font dynamic effect can be determined based on the font file.

[0112] It should be noted that the fifth embodiment of the present application may also be an improvement based on any one or more embodiments of the first to third embodiments.

[0113] It can be understood that in the related art, atlases are generally manually baked for multiple languages, which is a relatively heavy task with low efficiency. In an embodiment of the present application, the target atlas can be automatically stored in a preset resource path in an offline environment according to the language type selected by the user, so as to configure the dynamic parameters corresponding to the target atlas according to the preset resource path, and complete the baking according to the dynamic parameters and the mesh to determine the 3D font dynamic effect. In this way, the embodiment of the present application supports automatic baking of atlases of corresponding language types in a multilingual environment, thereby reducing the workload of planners in configuration.

[0114] Sixth embodiment

[0115] The sixth embodiment of the present application relates to a method for determining a 3D font dynamic effect. The sixth embodiment is an improvement on the fifth embodiment, and the specific improvement is: in the sixth embodiment of the present application, a mechanism is provided for detecting whether the text characters have changed so as to automatically update the font file.

[0116] Specifically, in some embodiments, the method may further include the following steps:

[0117] Step S401, detecting whether the text character has changed;

[0118] Step S402, updating the texture image corresponding to the text character according to the detection result;

[0119] Step S403, storing the target atlas in a preset resource path according to the updated texture image;

[0120] Correspondingly, a font file is generated according to the texture image, the dynamic parameters and the mesh, that is, step S10311 may include: generating a font file according to the updated texture image, the dynamic parameters and the mesh.

[0121] It is understandable that in related technologies, for example, if the characters on the floor are updated, I need to bake them manually. However, the current process is automated. After the data source is updated, the font file will also be automatically baked at regular intervals.

[0122] It should be noted that the sixth embodiment of the present application may also be an improvement based on any one or more embodiments of the first to fourth embodiments.

[0123] It can be understood that in the related art, especially when the text characters of the game are frequently modified, each corresponding language type needs to be manually baked. In the embodiment of the present application, a mechanism is provided for detecting whether the text characters have changed to automatically update the font file. Specifically, by detecting whether the text characters have changed, and updating the texture image corresponding to the text characters according to the detection results, the target atlas is stored in a preset resource path according to the updated texture image. In this way, the font file can be automatically generated according to the updated texture image, the dynamic parameters and the mesh, so that when the text characters change, the workload of the planners in configuration can be further reduced.

[0124] Seventh embodiment

[0125] The seventh embodiment of the present application relates to a method for determining a 3D font dynamic effect. In the embodiment of the present application, a specific application example is provided.

[0126] Specifically, in some embodiments, the method for determining the 3D font dynamic effect provided by the embodiment of the present application is mainly divided into two parts: atlas baking in an offline environment and effect calculation at runtime. In this example, Floor is used to represent the area.

[0127] 1. For the offline atlas baking part, see Figure 6 As shown:

[0128] Planning configuration copy: Planners can configure dialogue text in the game engine according to the game IP settings. The dialogue text is the content that will be displayed through 3D font dynamic effects later. Among them, the dialogue text refers to the dialogue between characters in the game or the interactive text between characters and the environment. These texts are an important way for players to understand the game story and character motivations.

[0129] Split the text of the copy by Floor: Bake the text of each Floor separately according to the different areas of the map, and bake the text of each Floor into a separate atlas to obtain multiple atlases, and different atlases correspond to the text of different areas. Instead of loading a super large atlas, the atlas can be loaded on demand, saving memory, and planners can also add more text for each Floor.

[0130] The text of each Floor is then divided into multiple atlases according to the localization settings: this means that the atlas is further divided according to the localization language requirements, so as to create a separate atlas for each language type to obtain the target atlas; especially for languages ​​with non-alphabet types, such as Chinese, Japanese, Korean, etc.

[0131] Baking atlas using editor tools: refers to using editor tools to bake and save the target atlas that has been split according to requirements to the specified resource path in an automated manner.

[0132] Select a dynamic configuration from the dynamic library for the text: planners can configure dynamic parameters for the text characters of the target atlas according to the dynamic effect to be achieved. The system can preset several dynamic parameters corresponding to common dynamic performances, and relevant personnel can directly select according to these preset dynamic parameters. When the game is running, the corresponding Animator state machine can be activated according to the dynamic parameters and the corresponding dynamic effect can be played.

[0133] End the offline environment process: all resources used for the 3D font dynamic effect have been prepared.

[0134] 2. For the effect calculation part at runtime, see Figure 7 As shown:

[0135] Creating 3D dynamic fonts at runtime: refers to loading the related resources of 3D font dynamic effects when the game is running.

[0136] According to the language selected by the user, set the corresponding atlas resource (target atlas) to the TextMeshPro component: according to the language selected by the user, the program will automatically obtain the target atlas and assign the target atlas as the target atlas to the TextMeshPro component.

[0137] When TextMeshPro creates a character mesh, information related to the compression effect (target data) is entered into the mesh: this means that in the process of creating a mesh based on the target atlas, the original order of the text characters obtained from the target atlas, the order after rearranging the original order, and the position information of the text characters are compressed and stored in the mesh's data structure so that the effect can be calculated in the Shader.

[0138] Interpret mesh information in Shader and perform a series of effect calculations: parse mesh in Shader, and perform effect calculations on the target data in combination with dynamic parameters corresponding to the target atlas configuration to perform target operations. Among them, by performing at least one of the following operations according to the target information: coordinate transformation operation, random selection operation and texture perturbation operation, the purpose of achieving complex 3D font dynamic effects can be achieved.

[0139] The final effect in the game: refers to the 3D font dynamic effect seen by players during the actual game experience.

[0140] It can be seen that the technical solution provided by this application has at least the following technical effects:

[0141] 1. This application further expands the original TextMeshPro component, especially adding some target data (including the original order of text characters, the order after rearranging the original order, and the position information of the text characters, etc.), which are compressed into the mesh when the mesh is generated. Therefore, Shader can be used to achieve rich dynamic effects on the GPU. Currently, 9 common dynamic effects are realized, and planners can directly configure a 3D text asset into a specified dynamic effect according to the copywriting style.

[0142] 2. This application bakes atlases by map, creates independent atlases for each text character configured on Floor, and realizes the function of loading atlases on demand. This method can not only save memory, but also increase the amount of text configured for each Floor plan.

[0143] 3. This application supports automatic baking of corresponding language type atlases in a multilingual environment, thereby reducing the workload of planners in configuration.

[0144] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0145] Eighth embodiment

[0146] Some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.

[0147] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Figure 8 An exemplary structural diagram of the electronic device is disclosed. Figure 8 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0148] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0149] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a track ball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0150] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0151] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.

[0152] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.

[0153] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0154] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0155] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

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

[0157] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0158] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0159] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0160] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.

[0161] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.

Claims

1. A method for determining a 3D font dynamic effect, characterized in that: The method comprises: Get the target atlas; According to the target atlas, a mesh is created; wherein the mesh carries target data of text characters corresponding to the target atlas, and the target data is used to realize a 3D font dynamic effect; According to the mesh, a 3D font dynamic effect is determined.

2. The method according to claim 1, characterized in that The acquiring the target atlas comprises: acquiring the target atlas of the target component; wherein the target component is used to display text.

3. The method according to claim 1, characterized in that: The target atlas is used to represent image files based on different language types in different regions.

4. The method according to claim 1, characterized in that The target data includes at least one of the following: the original order of text characters, the order after rearranging the original order, and the position information of the text characters; The step of creating a mesh according to the target atlas includes: Determining, according to the target atlas, an original order of the text characters, an order after rearranging the original order, and position information of the text characters; A mesh is created according to the original order of the text characters, the order after the original order is rearranged, and the position information of the text characters.

5. The method according to claim 1, characterized in that Determining the 3D font dynamic effect according to the mesh includes: Execute a target operation according to the target data in the mesh; wherein the target operation includes at least one of the following: a coordinate transformation operation, a random selection operation, and a texture disturbance operation; A 3D font dynamic effect is determined according to a result of performing the target operation.

6. The method according to claim 5, characterized in that The coordinate transformation operation is used to perform at least one of three-dimensional rotation, scaling and offset operations on the text character; The random selection operation is used to control the text characters to appear or disappear randomly or in a preset order; The texture disturbance operation is used to make the text characters present a distortion effect.

7. The method according to any one of claims 1 to 6, characterized in that: The target atlas is configured in an offline environment, and the method for determining the target atlas includes: Determine an index path according to different areas included in the map; wherein the index paths of the target atlases corresponding to different areas are different; According to the index path, a target atlas corresponding to the language type is loaded.

8. The method according to claim 7, characterized in that After loading the target atlas corresponding to the language type according to the index path, the method further includes: Automatically storing the target atlas in a preset resource path; According to the preset resource path, configuring dynamic parameters corresponding to the target atlas; Correspondingly, determining the 3D font dynamic effect according to the character mesh includes: A 3D font dynamic effect is determined according to the dynamic parameter and the mesh.

9. The method according to claim 8, characterized in that The step of automatically storing the target atlas in a preset resource path includes: According to the target atlas, collecting text characters; Acquire a texture image corresponding to the text character; According to the texture image, storing the target atlas in a preset resource path; Correspondingly, determining the 3D font dynamic effect according to the dynamic parameter and the mesh includes: Generate a font file according to the texture image, the dynamic parameters and the mesh; A 3D font dynamic effect is determined according to the font file.

10. The method according to claim 9, characterized in that The method further comprises: Detecting whether the text characters have changed; According to the detection result, updating the texture image corresponding to the text character; According to the updated texture image, storing the target atlas in a preset resource path; Correspondingly, generating a font file according to the texture image, the dynamic parameter and the mesh includes: generating a font file according to the updated texture image, the dynamic parameter and the mesh.

11. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 10.

12. A computer readable medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.