Fuzzy font effect generation method and device, storage medium and electronic equipment
By setting the light and shadow effect and blur intensity parameters on the graphical user interface, the blur font effect is generated, which solves the problem of imbalance between effects and resource consumption in the generation of blur font effects in the existing technology, and achieves more efficient and diversified effect generation. .
Patent Information
- Application Number
- CN202410810717.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-13
AI Technical Summary
In the field of computer image processing, it is difficult for existing technologies to achieve a balance between effect and resource consumption when generating blurry font effects, resulting in difficulty in meeting demand when generating blurry effects.
By displaying the modified shader editing interface on the graphical user interface, users can set light and shadow effect parameters and blur intensity parameters, and generate blur font effects based on these parameters, avoiding unnecessary calculation processing and reducing storage space requirements.
It achieves more flexible and diversified blur font effect generation, reduces resource consumption, improves processing efficiency, and solves the balance problem between effects and resource consumption.
Smart Images

Figure CN118644584A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer image processing, and in particular to a method, device, storage medium and electronic device for generating a fuzzy font effect. Background Art
[0002] At present, in the field of computer image processing, there is a demand for blurring and fading fonts, that is, the image can be beautified or the artistic effect of the image can be increased by generating a blurred font effect. In the related art, in order to achieve the generation of blurred font effects, the following two technical solutions can usually be adopted: the first solution can pre-generate and store a certain number of blurred images, which requires more storage resources; the second solution can use a box blur algorithm (BoxBlur Algorithm, referred to as BoxBlur) or a Gaussian Blur Algorithm (Gaussian Blur Algorithm, referred to as GBA algorithm), that is, the Gaussian Blur algorithm directly blurs the font image, the box blur algorithm is simple to implement, but the generated blurred font effect is poor, the Gaussian Blur algorithm generates a good blurred font effect, but the consumption of computing resources is high. As can be seen from the above, it is difficult to balance the blur effect with computing and storage resources when generating blurred font effects in the related art, resulting in it being difficult to achieve a balance between blur effect and resource consumption when generating blurred font effects.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] At least some embodiments of the present disclosure provide a method, device, storage medium and electronic device for generating a blurred font effect, so as to at least solve the technical problem in the related art that it is difficult to achieve a balance between the blurred effect and resource consumption when generating the blurred font effect.
[0005] According to one embodiment of the present disclosure, a method for generating a blurred font effect is provided, comprising: displaying an editing interface corresponding to a modified shader on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold; in response to a first operation instruction triggered by the editing interface, the original font is acquired; in response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur strength parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur strength parameters are used to generate the blurred font effect of the original font; based on the light and shadow effect parameters and the blur strength parameters, the blurred font effect corresponding to the original font is generated.
[0006] According to one embodiment of the present disclosure, there is also provided a device for generating a blurred font effect, including: a display module, for displaying an editing interface corresponding to a modified shader on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold; an acquisition module, for responding to a first operation instruction triggered by the editing interface to acquire the original font; a determination module, for responding to a second operation instruction triggered by the editing interface to determine light and shadow effect parameters and blur strength parameters, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur strength parameters are used to generate the blurred font effect of the original font; a generation module, for generating the blurred font effect corresponding to the original font based on the light and shadow effect parameters and the blur strength parameters.
[0007] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the methods in various embodiments of the present disclosure when run.
[0008] According to one embodiment of the present disclosure, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the methods in various embodiments of the present disclosure.
[0009] According to another aspect of the embodiments of the present disclosure, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present disclosure is implemented.
[0010] According to another aspect of an embodiment of the present disclosure, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present disclosure is implemented.
[0011] According to another aspect of the embodiments of the present disclosure, a computer program is further provided. When the computer program is executed by a processor, the methods in the various embodiments of the present disclosure are implemented.
[0012] In at least some embodiments of the present disclosure, an editing interface corresponding to the modified shader is displayed on a graphical user interface; in response to a first operation instruction triggered by the editing interface, the original font is obtained; in response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined; based on the light and shadow effect parameters and blur intensity parameters, a blurred font effect corresponding to the original font is generated. It is easy to notice that the present disclosure allows users to set light and shadow effect parameters and blur intensity parameters directly on the editing interface by adding blur intensity parameters to the shader, allowing users to customize the light and shadow effects and blur degree of the font, thereby increasing flexibility, and based on the light and shadow effect parameters and blur intensity parameters, not only can unnecessary blur effects be avoided and unnecessary computing processing can be reduced, but also blurred font effects that better meet the needs can be generated to achieve more diverse effects, while reducing the storage space required to generate font blur effects, thereby solving the technical problem in the related art that it is difficult to achieve a balance between blur effects and resource consumption when generating blurred font effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for generating a blurred font effect according to an embodiment of the present disclosure;
[0015] Figure 2 is a flow chart of a method for generating a blurred font effect according to one embodiment of the present disclosure;
[0016] Figure 3 is a schematic diagram of a font blur effect generated based on a blur font effect generation method according to one embodiment of the present disclosure;
[0017] Figure 4 is a structural block diagram of a device for generating a fuzzy font effect according to one embodiment of the present disclosure;
[0018] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0021] In a possible implementation, for the commonly used background in the field of computer image processing, after practice and careful research, the inventor still found that it is difficult to achieve a balance between blur effect and resource consumption when generating blurred font effects in related technologies. Based on this, the game scene applied to the embodiment of the present disclosure can be any game scene in a mobile terminal device game, and a method for generating a font blur effect is proposed. The technical concept adopted determines the light and shadow effect parameters and blur intensity parameters of the original font, and based on the light and shadow effect parameters and blur intensity parameters, determines the light and shadow effect parameters and blur intensity parameters. When generating a blurred font effect, the light and shadow effect and blur degree of the font can be flexibly adjusted, thereby achieving more diversified effects. The setting of the light and shadow effect parameters and blur intensity parameters can make the method of generating a blurred font effect more efficient, reduce unnecessary computing processing, and also reduce the storage space required for generating a font blur effect, thereby improving the processing efficiency of the font blur effect generation, thereby solving the technical problem that it is difficult to achieve a balance between blur effect and resource consumption when generating a blurred font effect in related technologies.
[0022] The above method embodiments involved in the present disclosure can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a handheld computer, a mobile Internet device, a PAD, a game console and other terminal devices. Figure 1FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for generating a blurred font effect according to an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 The processor 102 (only one is shown) may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a field-programmable logic device (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. In one embodiment of the present disclosure, it may also include: an input / output device 108 and a display device 110.
[0023] In some optional embodiments mainly based on game scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface. The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0024] In one embodiment of the present disclosure, the method for generating a blurred font effect can be run on a local terminal device or a server. When the method for generating a blurred font effect is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0025] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the method for generating the blurred font effect are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0026] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed and run by the conventional electronic device. The local terminal device can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the display screen of the terminal, or provided to the player through holographic projection.
[0027] For example, the local terminal device can be a mobile terminal, a computer terminal or a similar computing device, which may include a display screen and a processor, wherein the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate the graphical user interface and control the display of the graphical user interface on the display screen.
[0028] Taking running on a mobile terminal as an example, the mobile terminal may be a smart phone, a tablet computer, a PDA, a mobile Internet device, a PAD, a game console, or other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for generating a blurred font effect according to an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data. Optionally, the mobile terminal may further include a transmission device 106, an input and output device 108 and a display device 110.
[0029] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0030] According to one embodiment of the present disclosure, an embodiment of a method for generating a blurred font effect is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] In a possible implementation, the embodiment of the present disclosure provides a method for generating a blurred font effect. Figure 2 is a flow chart of a method for generating a blurred font effect according to one embodiment of the present disclosure, such as Figure 2 As shown, the method comprises the following steps:
[0032] Step S202, displaying an editing interface corresponding to the modified shader on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0033] The above-mentioned graphical user interface (GUI) can be a user interface that uses graphic symbols and visual indicators, such as icons, windows, menus, etc. to achieve human-computer interaction. The graphical user interface allows users to interact with the computer system in a graphical way without having to remember and enter command line codes. The use of GUI allows users to use the computer system more easily, improves user experience and operating efficiency, and the graphical user interface can include desktop environments of multiple operating systems (for example, Windows, Mac OS, Linux, etc.), but is not limited to this.
[0034] The above-mentioned editing interface may refer to an interface in a graphical user interface for editing and modifying text, images, videos and other contents, and may include editing toolbars, editing areas, property panels and other parts. Users may add, delete, modify, format and other operations on the contents through the editing interface, and users may conveniently edit and process various types of operation parameters through the editing interface. Optionally, in the disclosed embodiment, the above-mentioned editing interface may refer to the editing interface of a game engine such as Nexo2.0, and the editing interface may also be determined according to actual needs, which is not limited here.
[0035] The above-mentioned shader may refer to a program or code for describing how to render or color the appearance and attributes of graphics or images. Shaders may be used for real-time rendering, such as in video games, virtual reality, and computer animation. Shaders may control the color, lighting, texture, shadow, and other aspects of an image to achieve the desired visual effect. Shaders include vertex shaders, fragment shaders, geometry shaders, and the like. There is no limitation on the type of shader here. Different types of shaders may be used in combination to achieve complex image processing effects. Shaders may be executed by a graphics processor to improve the efficiency and speed of image processing.
[0036] The above-mentioned preset threshold may refer to a pre-set clarity threshold, which is used to confirm that the clarity of the original font meets the preset clarity threshold. The preset threshold may be a standard or threshold set in image processing or video processing. The preset threshold may be determined by the user according to actual conditions and is not limited here.
[0037] The above-mentioned original font may refer to a font that uses a distance field (Signed Distance Field, abbreviated as SDF) to represent glyphs. The SDF font may refer to a vector font representation method based on a distance field, which can present fonts with less memory usage and high quality. The SDF font can be used in game development and graphics rendering, and can present clear and smooth font effects at various resolutions. The font type of the original font can also be determined by the user according to actual needs, which is not limited here. The font content of the original font can be input or selected by the user according to actual needs, and the font content of the original font is not limited here.
[0038] The above-mentioned blur intensity parameter refers to a parameter used to control the degree of change of the blur effect when blurring is performed. By adjusting the blur intensity parameter, the clarity or blurriness of the blur effect can be controlled, thereby achieving different visual effects. The larger the blur intensity parameter, the more obvious the blur effect and the blurrier the font; the smaller the blur intensity parameter, the milder the blur effect and the clearer the font. In the field of image processing and computer vision, the blur intensity parameter can be used to adjust the visual effect of the font image and improve the quality and readability of the font image. The present disclosure can use a blur intensity parameter (BlurInten) to control the blur change. The blur intensity parameter can also be input by the user according to actual needs and is not limited here.
[0039] The above-mentioned modified shader may refer to a shader obtained by adding a blur intensity parameter to the shader corresponding to the original font. The modified shader (surf shader) may be a shader with a corresponding implementation function added. Through the corresponding implementation function, the user can set the blur intensity parameter (BlurInten) in the editing interface to implement the corresponding font blur intensity control function. The modified shader may also be determined by the user according to actual needs. There is no limitation on the modified shader here.
[0040] In an optional embodiment, during the font blurring process, the blurring effect can be achieved by modifying the shader corresponding to the font. Adding a blur intensity parameter in the shader corresponding to the original font allows the user to control the degree of blurring by adjusting the parameters to dynamically adjust the blurring effect, thereby meeting user needs.
[0041] Specifically, a blur strength parameter can be added to the shader corresponding to the original font to control the blur degree of the font. The blur strength parameter can be a floating point number that represents the degree of blur. The blur effect is achieved in the shader code based on the blur strength parameter. A control can be added to the editing interface to adjust the blur strength parameter. The control can be a slider, input box, or other forms of controls, allowing users to easily adjust the degree of blur. A preview window can be added to the editing interface to display the modified font effect. When the user adjusts the blur strength parameter, the preview window can be updated in real time to display the modified font effect, allowing users to intuitively see the changes in the blur effect. Through the above steps, users can conveniently adjust the blur effect of the font through the editing interface to achieve customized font display effects. At the same time, the real-time preview function can also help users understand the modified effect more intuitively and improve user experience.
[0042] Step S204, responding to the first operation instruction triggered by the editing interface, obtaining the original font.
[0043] The above-mentioned first operation instruction may refer to the user performing relevant touch operations on the editing interface to obtain the instruction or command of the original font. The first operation instruction may be the instruction for the user to input the original font into the editing interface, or it may be the instruction for the user to automatically retrieve the original font by controlling the editing interface. The first operation instruction may be the instruction generated by the user performing the editing operation through mouse clicks, keyboard input or touch screen operation, such as copying, pasting, cutting, selecting text, inserting text and other operations, and may also be the instruction generated by the user's voice, gestures, etc. The first operation instruction is not limited here.
[0044] In an optional embodiment, during the font blurring process, when the user operates on the editing interface, a first operation instruction can be generated, and the original font can be obtained based on the first operation instruction. The system can identify which texts the user wants to blur based on the user's operations on the editing interface, such as entering text, adjusting font size or style, etc. The system can obtain the original font information, which may include font shape, size, color, etc., so that subsequent blurring processing can be adjusted and operated based on the original font information, and the original font can be used as the basis for subsequent processing to ensure that the final text effect meets the user's expectations.
[0045] Step S206, responding to the second operation instruction triggered by the editing interface, determining the light and shadow effect parameters and the blur intensity parameters, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0046] The above-mentioned second operation instruction may refer to an instruction or command issued by the user to the editing interface to control the blurring of the original font. The second operation instruction may be an instruction generated by the user performing an editing operation through mouse clicks, keyboard input or touch screen operation. It may also be an instruction generated by the user interacting with the editing interface through voice, gestures, etc. The second operation instruction is not limited here.
[0047] The above-mentioned light and shadow effects may refer to adding effects such as strokes, glow, and shadows around the fonts to make the fonts look three-dimensional and visually layered. The light and shadow effects may make the fonts more visually prominent, enhance the visual effect, and make the text more vivid and attractive. The font light and shadow effects may include inner and outer strokes, text glow, text shadows, etc. The light and shadow effects may be achieved through graphics processing software or specific font processing tools.
[0048] The above-mentioned light and shadow effect parameters may refer to parameters used to adjust the font blurring effect during the font blurring process. The light and shadow effect parameters may control the degree, direction, and light source position of the font blurring, thereby making the font look more three-dimensional, vivid, and have light and shadow effects. Adjusting the light and shadow effect parameters may make the font more prominent in the design and enhance the visual effect. The light and shadow effect parameters include blurring degree, blurring direction, lighting angle, shadow color, and the like.
[0049] The blurred font effect mentioned above may refer to adding some blur or gradient effects to the font, so that the font is no longer so sharp and clear. The blurred font effect can make the font look more comfortable and easy to read.
[0050] In an optional embodiment, during the font blurring process, the user can select the required light and shadow effect parameters and blur intensity parameters through the editing interface. The light and shadow effect parameters can be used to generate the light and shadow effect of the original font, and the blur intensity parameters can be used to generate the blurred font effect of the original font. The light and shadow effect parameters may include parameters such as the light source position, light source intensity, and shadow color of the selected font, so as to add realistic light and shadow effects to the font. By adjusting the light and shadow effect parameters, the font can look more three-dimensional and vivid. The blur intensity parameter can be the blur degree of the specified font, that is, the font looks blurred and soft instead of clear and sharp. By adjusting the light and shadow effect parameters and the blur intensity parameters, a soft visual effect can be added to the font, making the overall layout softer and more unified. By combining the light and shadow effect parameters and the blur intensity parameters, the font can be customized according to user needs and design requirements, so that the overall blur effect of the font is softer and more unified.
[0051] Step S208: generating a blurred font effect corresponding to the original font based on the light and shadow effect parameters and the blur intensity parameters.
[0052] The above-mentioned blurred font effect may refer to the blurred effect of the font corresponding to the original font finally generated by the present disclosure. The blurred font effect may include the blurred effect achieved by the original font itself, and may also include the blurred font effect that achieves light and shadow effects such as stroke, glow and shadow.
[0053] In an optional embodiment, the light and shadow effect parameters can be used to control the light and shadow effects such as projection, reflection and shadow of the font, which can make the blurred font look more three-dimensional and vivid, and the blur intensity parameter can be used to control the degree of font blur and control the visual difference between the blurred font and the original font. Specifically, the position, color, transparency and other properties of the light and shadow effects such as projection, reflection and shadow of the font can be determined according to the light and shadow effect parameters, the blur degree of the blurred font can be determined according to the blur intensity parameters, the original font can be blurred by a blur algorithm, and the generated light and shadow effects and blur effects can be merged into the original font to form a final blurred font effect. Through the above steps, a font with a three-dimensional sense and a blurred effect can be generated to make it more vivid and attractive. By adjusting the light and shadow effect parameters and the blur intensity parameters, blurred font effects of different styles can be generated according to different design requirements and styles.
[0054] In at least some embodiments of the present disclosure, an editing interface corresponding to the modified shader is displayed on a graphical user interface; in response to a first operation instruction triggered by the editing interface, the original font is obtained; in response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined; based on the light and shadow effect parameters and blur intensity parameters, a blurred font effect corresponding to the original font is generated. It is easy to notice that the present disclosure allows users to set light and shadow effect parameters and blur intensity parameters directly on the editing interface by adding blur intensity parameters to the shader, allowing users to customize the light and shadow effects and blur degree of the font, thereby increasing flexibility, and based on the light and shadow effect parameters and blur intensity parameters, not only can unnecessary blur effects be avoided and unnecessary computing processing can be reduced, but also blurred font effects that better meet the needs can be generated to achieve more diverse effects, while reducing the storage space required to generate font blur effects, thereby solving the technical problem in the related art that it is difficult to achieve a balance between blur effects and resource consumption when generating blurred font effects.
[0055] According to the above-mentioned embodiment of the present disclosure, a blurred font effect corresponding to the original font is generated based on light and shadow effect parameters and blur intensity parameters, including: constructing a target font corresponding to the original font, wherein the clarity of the target font is less than a preset threshold, and the color of the original font is the same as the color of the target font; generating an original effect corresponding to the original font based on the original font and light and shadow effect parameters; generating a target effect corresponding to the target font based on the target font and light and shadow effect parameters; and mixing the original effect and the target effect based on the blur intensity parameters to generate a blurred font effect.
[0056] The target font mentioned above may refer to an original blurred font corresponding to the original font. The target font may be represented by a blurred transparency parameter (Blur Alpha). The method for representing the target font is not limited here.
[0057] The above-mentioned original effect may refer to the effect obtained after performing light and shadow processing on the original font, and in the present disclosure, it may be represented by parameters such as color parameter (color), transparency effect parameter (effect_alpha), etc., and the method for representing the original effect is not limited here.
[0058] The target effect mentioned above may refer to the effect obtained after performing light and shadow processing on the target font, and in the present disclosure, it may be represented by parameters such as blur color parameter (Blurcolor) and blur transparency parameter (BlurAlpha), and the method for representing the target effect is not limited here.
[0059] In an optional embodiment, during the font blurring process, a target font corresponding to the original font can be constructed, the clarity of the target font is less than a preset threshold, and the color of the original font is the same as the color of the target font, that is, the original font can be blurred to a certain extent to achieve the clarity requirement of the target font. Based on the original font and light and shadow effect parameters, an original effect corresponding to the original font is generated, which can include adding shadows, halos or other special effects to enhance the visual effect of the original font. Based on the target font and light and shadow effect parameters, a target effect corresponding to the target font is generated. The original effect and the target effect can be mixed based on the blur intensity parameter to generate a blurred font effect. The degree of blur effect can be controlled by adjusting the blur intensity parameter to ultimately present an expected blurred font effect. The above steps are to construct a target font corresponding to the original font during the font blurring process, and combine the light and shadow effect parameters and the blur intensity parameter to ultimately generate a blurred font effect that meets the requirements. By adjusting the blur intensity parameter, the blur degree of the generated font can be accurately controlled to achieve fine adjustment and control. The original effect and the target effect are mixed to achieve a richer and more unique blurred font effect.
[0060] According to the above embodiment of the present disclosure, constructing a target font corresponding to an original font includes: determining sampling coordinates based on texture coordinates of the original font; determining a sampling mode of the original font; and sampling the original font based on the sampling coordinates and the sampling mode to obtain a target font.
[0061] The above-mentioned sampling coordinates may refer to sampling coordinate information, which may be used to describe how to sample. The sampling coordinates may be represented by texture coordinate parameters (UV parameters) or sampling coordinate parameters (sdf_uv). For example, the sampling coordinates may be a two-dimensional coordinate axis that provides two-dimensional position information to tell the texture how to sample. The sampling coordinates may also be determined according to actual needs, which is not limited here.
[0062] The above-mentioned sampling mode may refer to the sampler state of the sampler, that is, the method by which the sampler obtains the pixel color. The sampling mode may include bilinear sampling, point sampling, trilinear sampling, etc., wherein bilinear sampling may refer to the sampler calculating the output color by weighted averaging the colors of the surrounding four pixels, which can reduce jagged edges and distortion, but the processing speed is slightly slower; point sampling may refer to the sampler directly obtaining the nearest pixel color as the output color, which is simple and fast, but jagged edges and distortion may occur; trilinear sampling may refer to considering textures of different resolution levels on the basis of bilinear sampling, and obtaining smoother output colors by interpolating different resolution levels, which has better effects but larger calculation amount. Different sampling modes will produce different effects in font blurring. Selecting a suitable sampling mode can improve the quality and performance of font blurring. The sampling mode can be determined by the user according to actual needs, and the sampling mode is not limited here.
[0063] In an optional embodiment, during the font blurring process, the sampling coordinates can be determined based on the texture coordinates of the original font. The texture coordinates can refer to the coordinate position in the font texture image. The specific pixel point can be located through the texture coordinates. The sampling coordinates can be determined according to the area that needs to be blurred, which can be a rectangular area or a circular area, etc., and there is no limitation here. After determining the sampling coordinates, the sampling mode of the original font can be determined. The sampling mode can be linear sampling, bilinear sampling or trilinear sampling, etc. Different sampling modes will affect the final blurring effect and can be selected according to actual needs. The original font can be sampled according to the sampling coordinates and the sampling mode to obtain the target font. The sampling operation can obtain the color value of the corresponding pixel point in the texture image and obtain the final color value by interpolation calculation according to the sampling mode.
[0064] For example, it can be implemented through the sampling function SDFMap.Sample(DefaultSampler,sdf_uv).a. In the sampling function, two parameters, the sampling mode parameter (sampler state) and the texture coordinate parameter (UV parameter), can be input. The sampling mode parameter (sampler state) can represent the sampling mode, and the bilinear sampling parameter (DefaultSampler) can represent the default bilinear sampling used. There is no limitation on the sampling mode here. The texture coordinate parameter (UV parameter) can be used as a two-dimensional coordinate axis to provide two-dimensional position information to tell the texture how to sample. The sampling coordinate parameter (sdf_uv) here can represent a texture coordinate information, and the texture coordinate 1 (TEXTURECOORD1) of the extensible text resource (Xtext resource) can be used to provide position data for the sampling coordinate parameter (sdf_uv). The Xtext resource can carry multiple texture coordinate information such as texture coordinate 0 (TEXTURECOORD0) and texture coordinate 1 (TEXTURECOORD1). The texture coordinate 1 (TEXTURECOORD1) can be directly obtained in the shader. EXTURECOORD1), the setting of the sampling function can also be determined according to actual needs and is not limited here. In this way, the original font can be blurred to make it look softer and more natural. The sampling coordinates are determined based on the texture coordinates of the original font, the sampling mode of the original font is determined, and then the original font is sampled according to the sampling coordinates and the sampling mode, and finally the target font is obtained, thereby realizing the font blurring. The present disclosure can simulate the blurring effect of the font to a certain extent by sampling the original font, so that the generated target font looks softer and more blurred. By reasonably selecting the sampling coordinates and the sampling mode, different degrees of blurring effects can be achieved, thereby meeting the different needs of users for font effects. At the same time, the precision and accuracy of the sampling coordinates and the sampling mode will also affect the quality and effect of the target font finally generated.
[0065] According to the above-mentioned embodiment of the present disclosure, based on the original font and light and shadow effect parameters, an original effect corresponding to the original font is generated, including: based on the light and shadow effect parameters, determining the light and shadow effect color and the light and shadow effect shape; based on the font shape of the original font, mixing the light and shadow effect color and the color of the original font to obtain a first color; based on the font shape of the original font, mixing the light and shadow effect shape and the transparency of the original font to obtain a first font shape; determining the first color and the first font shape as the original effect.
[0066] The above-mentioned light and shadow effect color may refer to the initial color of light and shadow effects such as stroke, shadow, and glow. In the present disclosure, it may be expressed by parameters such as stroke color parameters (outline.color), shadow color parameters (NXGUIConvertColorSpace(UITextFontShadowColor).rgb), and glow color parameters (glowing_color). There is no limitation on the light and shadow effect color here.
[0067] The above-mentioned light and shadow effect shape may refer to the initial shape of light and shadow effects such as stroke, shadow, glow, etc., and may be represented by parameters such as transparency effect parameter (effect_alpha) in the present disclosure.
[0068] The above-mentioned first color can represent the color of light and shadow effects such as font stroke, shadow, glow, etc. The first color can refer to at least one or more of the colors of light and shadow effects such as font stroke, shadow, glow, etc., which can be determined by the user according to actual needs and is not limited here.
[0069] The above-mentioned first font shape may refer to the shape of light and shadow effects such as stroke, shadow, glow, etc. The first font shape may refer to at least one or more of the shapes of light and shadow effects such as font stroke, shadow, glow, etc., which can be determined by the user according to actual needs and is not limited here.
[0070] In an optional embodiment, when the light and shadow effects of the font include a font stroke effect, in the process of blurring the stroke of the font light and shadow effects, the color and shape of the light and shadow effects can be determined by setting a stroke color parameter (outline_color) and a stroke transparency parameter (outline_alpha), wherein the stroke color parameter (outline_color) can represent the color of the stroke effect in the light and shadow effects, and the stroke transparency parameter (outline_alpha) can represent the transparency of the stroke effect in the light and shadow effects; the color of the light and shadow effects and the color of the original font can be mixed to obtain a first color (color), which can be achieved by interpolating the color (); and the shape of the light and shadow effects and the transparency of the original font can be mixed to obtain a first font shape (effect_alpha), which can be achieved by interpolating the transparency (); determine the first color and the first font shape as the original effect, that is, the first color can be output as the final color, and the first font shape can be output as the final font shape, thereby completing the blurring of the font stroke in the light and shadow effects of the font.
[0071] In the case where the light and shadow effects of the font include the font shadow effect, in the shadow blurring process of the light and shadow effects of the font, the color and shape of the light and shadow effects can be determined, and the color of the light and shadow effects can be mixed with the color of the original font to obtain a first color (color), which can be achieved by interpolating the color; and the shape of the light and shadow effects can be mixed with the transparency of the original font to obtain a first font shape (effect_alpha), which can be achieved by interpolating the transparency; the first color and the first font shape are determined to be the original effects, that is, the first color can be output as the final color, and the first font shape can be output as the final font shape, thereby completing the blurring of the font shadow in the light and shadow effects of the font.
[0072] In the case where the light and shadow effects of the font include the font glowing effect, in the glowing blurring process of the light and shadow effects of the font, the color and shape of the light and shadow effects can be determined, by setting the glowing color parameter (glowing_color) and the glowing transparency parameter (glowing_alpha), wherein the glowing color parameter (glowing_color) can represent the color of the glowing effect in the light and shadow effects, and the glowing transparency parameter (glowing_alpha) can represent the transparency of the glowing effect in the light and shadow effects, so that the color of the light and shadow effects and the color of the original font can be mixed to obtain a first color (color), which can be achieved by interpolating the color; and the shape of the light and shadow effects and the transparency of the original font can be mixed to obtain a first font shape (effect_alpha), which can be achieved by interpolating the transparency; determine the first color and the first font shape as the original effect, that is, the first color can be output as the final color, and the first font shape can be output as the final font shape, thereby completing the blurring of the font glow in the light and shadow effects of the font.
[0073] The light and shadow effects proposed in the present disclosure may include one or more of a stroke effect, a shadow effect, and a glow effect. Specifically, it can be implemented through a stroke macro definition (SDF_OUTLINE_ENABLE), a shadow macro definition (FONT_SHADOW_ENABLE), and a glow macro definition (SDF_GLOWING_ENABLE). In the original effect calculation of the original font, the stroke, shadow, and glow effects controlled by the macro definition are optional. For example, when a stroke is required, the stroke macro definition can be turned on, and the calculation in the stroke macro definition will take effect. The stroke, shadow, and glow can all output a transparency effect parameter (effect_alpha). For example, if the stroke macro definition is turned on, the obtained transparency effect parameter (effect_alpha) can be the transparency parameter (alpha) of the stroked shape. If the shadow macro definition is also turned on, the obtained What you get may be a transparency effect parameter (effect_alpha) with a stroke and shadow shape. For example, if the glowing macro is not turned on, the transparency effect parameter (effect_alpha) obtained is without a glowing shape), so the transparency effect parameter (effect_alpha) will be multiplied by the transparency parameter (alpha), which can be achieved by alpha=alpha*effect_alpha; the final output transparency parameter (alpha) is a clear font shape with a stroke, shadow and glowing shape. By determining the light and shadow effect color and shape of the font, you can effectively add a three-dimensional sense and visual effect to the font, making it look more vivid and three-dimensional, and can provide a good foundation for the subsequent blur effect generation and processing, making the final generated font effect more realistic and visually attractive.
[0074] According to the above-mentioned embodiment of the present disclosure, based on the font shape of the original font, the light and shadow effect shape and the transparency of the original font are mixed to obtain a first font shape, including: obtaining the transparency of the light and shadow effect color, the dot product of the transparency of the light and shadow effect color and the vertex color of the original font to obtain a color multiplication result; based on the font shape of the original font, the color product result and the transparency of the original font are mixed to obtain the first font shape.
[0075] The transparency of the vertex color of the above-mentioned original font can be represented by the vertex color parameter (frag.vertex_color.a). The vertex color parameter (frag.vertex_color.a) can refer to the vertex color A channel of the Xtext resource. The vertex color A channel of the Xtext resource is used by default to represent the transparency of the Xtext font resource. The transparency of the vertex color of the original font can also be determined according to actual needs and is not limited here.
[0076] In an optional embodiment, taking the light and shadow effects of a font including a font stroke effect as an example, during the font blurring process, the product of the transparency of the light and shadow effect color (outline_color_alpha), the light and shadow effect color (outline_alpha) and the transparency of the vertex color of the original font (frag.vertex_color.a) can be obtained to obtain a color multiplication result. A new transparency value can be obtained by multiplying the transparency of the light and shadow effect color, the light and shadow effect color and the transparency of the vertex color of the original font. Based on the font shape of the original font, the color multiplication result and the transparency of the original font can be mixed to obtain a first font shape. The color multiplication result and the transparency of the original font can be interpolated through the lerp function to obtain a new transparency value. The new transparency value can be used as the transparency of the final font shape, that is, effect_alpha=lerp(outline_color_alpha*outline_alpha*frag.vertex_color.a,alpha,effect_alpha). Implementation, similarly, when the light and shadow effects of the font include the font shadow effect, it can be implemented by effect_alpha = lerp(UITextFontShadowColor.a*shadow_alpha*frag.vertex_color.a,alpha,effect_alpha); when the light and shadow effects of the font include the font glowing effect, it can be implemented by effect_alpha = lerp(glowing_color_alpha*glowing_alpha*frag.vertex_color.a,alpha,effect_alpha); the first font shape may refer to at least one or more of the blurred shapes of the light and shadow effects such as font stroke, shadow, and glow, which can be determined by the user according to actual needs and are not limited here. The above steps can obtain a mixed value of the light and shadow effect color and the transparency of the original font, thereby realizing the processing of the font blur effect; by adjusting the color product result and the transparency parameters, light and shadow effects of different degrees and shapes can be achieved, thereby enhancing the three-dimensional sense and visual effect of the font.
[0077] According to the above-mentioned embodiment of the present disclosure, the light and shadow effect parameters include: shadow effect parameters, which are used to generate the shadow effect of the original font; based on the font shape of the original font, the light and shadow effect color and the color of the original font are mixed to obtain a first color, including: converting the light and shadow effect color from the original color space corresponding to the light and shadow effect color to the target color space to obtain a converted color result, wherein the target color space is used to represent the color space that matches the modified shader; based on the font shape of the original font, the converted color result and the color of the original font are mixed to obtain the first color.
[0078] In an optional embodiment, the light and shadow effect parameters may include shadow effect parameters, and the shadow effect parameters may be used to generate a shadow effect of the original font. During the font blurring process, the light and shadow effect color may be converted from the original color space corresponding to the light and shadow effect color to a target color space to obtain a converted color result, wherein the target color space may be used to characterize a color space that matches the modified shader. The converted color result and the color of the original font may be mixed based on the font shape of the original font to obtain a first color. For example, the color of the shadow effect in the light and shadow effect may be represented by a shadow color parameter (NXGUIConvertColorSpace(UITextFontShadowColor).rgb), wherein a conversion function (NXGUIConvertColorSpace) may be used to convert color information obtained by the UI editor into color information that can be used in a shader (shader), and a preset font shadow color parameter (UITextFontShadowColor) may be directly obtained from the UI editor. A linear interpolation function (lerp) may be used to mix the original color and the converted color according to a transparency effect parameter (effect_alpha) to obtain a final color. Light and shadow effects may be added while retaining the original font color to make the font look more three-dimensional and vivid.
[0079] When the lighting and shadow effects of the font include the font shadow effect, in the shadow blurring process of the font lighting and shadow effect, the color and shape of the lighting and shadow effect can be determined, and the transparency of the shadow effect in the lighting and shadow effect can be represented by setting the shadow color parameter (NXGUIConvertColorSpace(UITextFontShadowColor).rgb) and the shadow transparency parameter (UITextFontShadowColor.a*shadow_alpha*frag.vertex_color.a), wherein the preset color transparency parameter (UITextFontShadowColor) can be directly obtained from the UI editor, and the color transparency expression (UITextFontShadowColor.a) can represent the transparency of the specified color, and the color of the lighting and shadow effect can be mixed with the color of the original font to obtain the first color (color), which can be obtained by performing an interpolation operation on the color. Implementation, that is, it can be implemented by color = lerp(NXGUIConvertColorSpace(UITextFontShadowColor).rgb, color, effect_alpha); and the shape of the light and shadow effect and the transparency of the original font can be mixed to obtain the first font shape (effect_alpha), which can be implemented by interpolating the transparency, that is, it can be implemented by effect_alpha = lerp(UITextFontShadowColor.a*shadow_alpha*frag.vertex_color.a, alpha, effect_alpha); determine the first color and the first font shape as the original effect, that is, the first color can be output as the final color, and the first font shape can be output as the final font shape, so that the font shadow in the light and shadow effect of the font can be blurred.
[0080] In the case where the light and shadow effects of the font include a glowing effect of the font, in the glow blur processing process of the light and shadow effects of the font, the color and shape of the light and shadow effects can be determined, and the glowing color parameter (glowing_color) and the glowing transparency parameter (glowing_alpha) can be set, wherein the glowing color parameter (glowing_color) can represent the color of the glowing effect in the light and shadow effects, and the glowing transparency parameter (glowing_alpha) can represent the transparency of the glowing effect in the light and shadow effects, so that the color of the light and shadow effects and the color of the original font can be mixed to obtain a first color (color), which can be achieved by performing an interpolation operation on the color, that is, it can be achieved by color=lerp(glowing_color,color,BlurAlpha); and The shape of the light and shadow effect and the transparency of the original font can be mixed to obtain the first font shape (effect_alpha), which can be achieved by interpolating the transparency, that is, it can be achieved by effect_alpha = lerp (glowing_color_alpha*glowing_alpha*frag.vertex_color.a, alpha, effect_alpha); determine the first color and the first font shape as the original effect, that is, the first color can be output as the final color, and the first font shape can be output as the final font shape, so that the font glow in the light and shadow effect of the font can be blurred, which can make the generated font light and shadow effect more realistic and three-dimensional, enhance the visual effect, and make the font look more three-dimensional and layered.
[0081] According to the above-mentioned embodiment of the present disclosure, a target effect corresponding to the target font is generated based on the target font and light and shadow effect parameters, including: determining the light and shadow effect color and the light and shadow effect shape based on the light and shadow effect parameters; mixing the light and shadow effect color and the color of the target font based on the font shape of the target font to obtain a second color; mixing the light and shadow effect shape and the transparency of the target font based on the font shape of the target font to obtain a second font shape; and determining the second color and the second font shape as the target effect.
[0082] In an optional embodiment, during the font blurring process, the light and shadow effect color and shape can be determined according to the light and shadow effect parameters, the preset color transparency parameter (UITextFontShadowColor) can be used to represent the shadow color of the font, the shadow color of the font is converted into a red green blue (Red Green Blue, referred to as RGB) color mode through a preset color conversion (NXGUIConvertColorSpace) function, and interpolated with the current color parameter (color) to obtain a blurred color parameter (BlurColor) of the blurred color, and interpolated according to the transparency of the preset color transparency parameter (UITextFontShadowColor), the shadow transparency parameter (shadow_alpha) and the transparency of the fragment vertex color (frag.vertex_color.a) to obtain a blurred transparency parameter (BlurAlpha) after blurring, thereby ensuring that the blur effect has a certain correlation with the transparency of the original font; after determining the blurred color and transparency, the blurred color and transparency are mixed according to the shape of the target font to obtain a second color and a second font shape. This ensures that the blur effect matches the shape of the original font to form the final target effect. By mixing the color, transparency and shape of the original font, as well as the color and shape of the light and shadow effects, the final blur effect can be obtained, making the font have a more three-dimensional and vivid visual effect when displayed.
[0083] According to the above-mentioned embodiment of the present disclosure, the original effect and the target effect are mixed based on the blur strength parameter to generate a blurred font effect, including: mixing the first color in the original effect and the second color in the target effect based on the blur strength parameter to obtain the target color; mixing the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain the target font shape; generating the blurred font effect based on the target color and the target font shape.
[0084] In an optional embodiment, during the font blurring process, the first color (Basecolor) and the first font shape (effect_alpha) in the original effect, as well as the second color (BlurColor) and the second font shape (BaseBlurAlpha) in the target effect can be defined, the mixing ratio can be controlled according to the blur intensity parameter (BlurInten), and the color and the font shape can be interpolated using the interpolation (lerp) function to obtain the target color and the target font shape. For the color part, the interpolation (lerp) function can be used to mix the first color (Basecolor) and the second color (BlurColor) to obtain the target color (mtl.albedo), that is, mtl.albedo = lerp (Basecolor, BlurColor, BaseBlurAlpha) can be used. lurInten); for the font shape, the interpolation (lerp) function can be used to mix the first font shape (BaseBlurAlpha) and the second font shape (effect_alpha) to obtain the target font shape (mtl.opacity), that is, it can be achieved by mtl.opacity = lerp (effect_alpha, BaseBlurAlpha, BlurInten) * frag.vertex_color.a. Finally, according to the target color and target font shape, a blurred font effect can be generated, that is, the mixing ratio of the original effect and the target effect can be controlled by the blur intensity parameter to achieve the effect of font blurring. The light and shadow effect color can be achieved by gradient, overlay, transparency and other methods, so as to simulate the color change of the font surface when it is illuminated by light. The light and shadow effect shape can be achieved by shadow, blur, glow and other effects, making the font look more three-dimensional and vivid. By fine-tuning the light and shadow effect color and light and shadow effect shape of the font, the generated blurred font effect can be more in line with the design requirements and achieve better visual effects.
[0085] According to the above-mentioned embodiment of the present disclosure, a first color in the original effect and a second color in the target effect are mixed based on a blur intensity parameter to obtain a target color, including: decolorizing the first color to obtain a first processed color, and decolorizing the second color to obtain a second processed color; weighting the first processed color and the first color to obtain a first weighted result, and weighting the second processed color and the second color to obtain a second weighted result; mixing the first weighted result and the second weighted result based on the blur intensity parameter to obtain the target color.
[0086] In an optional embodiment, during the font blurring process, the first color (color) may be decolorized, and a grayscale conversion matrix with weight values of (0.3, 0.59, 0.11) may be used. The weight values may be determined according to actual needs and are not limited here. The color is converted into a grayscale value to obtain a first processing color (Basecolor), and the second color (BlurColor) is decolorized to obtain a second processing color. The first processing color (Basecolor) and the first color (color) are weighted, that is, they may be multiplied by a color intensity parameter (Grayscale) and the first color (color) multiplied by (1-color intensity parameter (Grayscale)). le)) to obtain a first weighted result; the second processed color and the second color can be weighted to obtain a second weighted result, the first weighted result and the second weighted result can be mixed based on a blur intensity parameter (BlurInten), and a linear interpolation (lerp) function can be used to obtain a target color (mtl.albedo), which can be achieved by mtl.albedo = lerp (Basecolor, BlurColor, BlurInten), through the above steps, the two colors can be decolorized and mixed to achieve a blur effect, and the first weighted result and the second weighted result can be mixed based on the blur intensity parameter to achieve a smooth transition effect. By adjusting the blur intensity parameter, the ratio of the two colors in the mixing process can be controlled to achieve different degrees of blur effects.
[0087] According to the above-mentioned embodiment of the present disclosure, the first color is decolorized to obtain a first processed color, and the second color is processed to obtain a second processed color, including: obtaining the dot product of the first color and a preset value to obtain the first processed color; obtaining the dot product of the second color and the preset value to obtain the second processed color.
[0088] The above-mentioned preset value may refer to a color intensity parameter (Grayscale). The color intensity parameter (Grayscale) may provide an operation for calculating the color intensity after decolorization. The color intensity parameter (Grayscale) may be a default value in the engine. The color intensity parameter (Grayscale) may be 1 or 1.5, etc. There is no limitation on the color intensity parameter (Grayscale) here.
[0089] In an optional embodiment, during the font blurring process, the first color (BlurColor) can be dot-producted with a preset float3 (0.3, 0.59, 0.11), where the weight value can be determined according to actual needs and is not limited here, so that the first processed color can be obtained, the float3 value can be used to represent the weight of the grayscale value, and the original color can be converted into a grayscale color through the dot product operation, and the second color (BlurColor) can be multiplied with (1-Grayscale) to obtain the second processed color, that is, float3Basecolor=dot(color, float3( 0.3,0.59,0.11))*Grayscale+color*(1-Grayscale) can be implemented, the second processed color and the second color can be weighted to obtain the second weighted result, that is, it can be implemented by BlurColor=dot(BlurColor,float3(0.3,0.59,0.11))*Grayscale+BlurColor*(1-Grayscale), and the first processed color and the second processed color can be added to complete the color conversion and mixing in the blurring process, so that a certain grayscale information can be retained in the blurring effect, while enhancing the color contrast and clarity.
[0090] According to the above-mentioned embodiment of the present disclosure, the first font shape in the original effect and the second font shape in the target effect are mixed based on the blur strength parameter to obtain the target font shape, including: mixing the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain the initial font shape; obtaining the dot product of the initial font shape and the transparency of the vertex color of the original font to obtain the target font shape.
[0091] In an optional embodiment, during the font blurring process, the first font shape (BaseBlurAlpha) and the second font shape (effect_alpha) can be interpolated using an interpolation (lerp) function to obtain a mixed transparency value. The mixed transparency value can be multiplied by the transparency of the vertex color of the original font (frag.vertex_color.a) to obtain a final transparency value (mtl.opacity), which can be achieved by mtl.opacity = lerp (effect_alpha, BaseBlurAlpha, BlurInten) * frag.vertex_color.a. The final transparency value can be applied to the mixing process of the first font shape and the second font shape, thereby achieving the processing of the font blurring effect. Through the above steps, a mixed font shape based on the blur intensity parameter can be obtained, while retaining the color and transparency information of the original font, thereby achieving the processing of the font blurring effect.
[0092] According to the above-mentioned embodiments of the present disclosure, the blur intensity parameter includes: multiple parameter values within a preset time period; based on the light and shadow effect parameters and the blur intensity parameter, a blurred font effect corresponding to the original font is generated, including: based on the light and shadow effect parameters and multiple parameter values within a preset time period, multiple blurred font effects within a preset time period are generated; the multiple blurred font effects within the preset time period are merged to obtain a blurred font animation of the original font.
[0093] In an optional embodiment, during the font blurring process, a blur intensity parameter can be set. The blur intensity parameter can include multiple parameter values within a preset time period. The blur intensity parameter can be adjusted by directly dragging the blur intensity parameter (BlurInten), or K frames can be performed in conjunction with the timeline of the UI editor to achieve font blurring changes and fade-in and fade-out effects. The blur intensity parameter can be set and based on the light and shadow effect parameters and multiple parameter values within the preset time period, multiple blurred font effects within the preset time period can be generated. The blurred font effect can be a process in which the font gradually blurs, or it can be a process in which the font suddenly blurs and then gradually becomes clear. It can be adjusted according to design requirements. Multiple blurred font effects within the preset time period can be merged to obtain a blurred font animation of the original font, thereby achieving the effect of font blurring changes, making the text visually more vivid and interesting. By adjusting the blur intensity parameter and the key frames on the timeline, various different font blurring effects can be achieved, bringing more possibilities for design.
[0094] Figure 3 FIG. 1 is a schematic diagram of a font blur effect generated based on a blur font effect generation method according to one embodiment of the present disclosure, such as Figure 3As shown, it shows the font blur effect implemented by the method for generating the blurred font effect proposed based on the present disclosure, from Figure 3 Figure (a) in Figure 3 to Figure (b) in Figure 3 and then to Figure (c) in
[0095]
[0096] In this embodiment, a device for generating a blurred font effect is also provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the terms "unit" and "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0097] Figure 4 Figure 4
[0098]
[0099] A display module 42, configured to display an editing interface corresponding to the modified shader on the graphical user interface, where the modified shader is used to represent the shader obtained by adding a blur intensity parameter to the shader corresponding to the original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0100] An obtaining module 44, configured to obtain the original font in response to a first operation instruction triggered by the editing interface.
[0101] A determination module 46, configured to respond to a second operation instruction triggered by the editing interface and determine a light and shadow effect parameter and a blur intensity parameter, wherein the light and shadow effect parameter is used to generate the light and shadow effect of the original font, and the blur intensity parameter is used to generate the blur font effect of the original font;
[0101] The generating module 48 is used to generate a blurred font effect corresponding to the original font based on the light and shadow effect parameters and the blur intensity parameters.
[0102] According to the above-mentioned embodiment of the present disclosure, the generation module includes: a first construction unit, used to construct a target font corresponding to an original font, wherein the clarity of the target font is less than a preset threshold, and the color of the original font is the same as the color of the target font; a first generation unit, used to generate an original effect corresponding to the original font based on the original font and light and shadow effect parameters; a second generation unit, used to generate a target effect corresponding to the target font based on the target font and light and shadow effect parameters; a first mixing unit, used to mix the original effect and the target effect based on a blur intensity parameter to generate a blurred font effect.
[0103] According to the above embodiment of the present disclosure, the first construction unit is further used to determine sampling coordinates based on the texture coordinates of the original font; determine the sampling mode of the original font; and sample the original font based on the sampling coordinates and the sampling mode to obtain the target font.
[0104] According to the above-mentioned embodiment of the present disclosure, the first generating unit is also used to determine the light and shadow effect color and the light and shadow effect shape based on the light and shadow effect parameters; based on the font shape of the original font, the light and shadow effect color and the color of the original font are mixed to obtain a first color; based on the font shape of the original font, the light and shadow effect shape and the transparency of the original font are mixed to obtain a first font shape; and the first color and the first font shape are determined to be the original effects.
[0105] According to the above-mentioned embodiment of the present disclosure, the first generating unit is also used to obtain the transparency of the light and shadow effect color, the dot product of the transparency of the light and shadow effect color and the vertex color of the original font to obtain a color multiplication result; based on the font shape of the original font, the color product result and the transparency of the original font are mixed to obtain a first font shape.
[0106] According to the above-mentioned embodiment of the present disclosure, the light and shadow effect parameters include: shadow effect parameters, which are used to generate the shadow effect of the original font; a first generation unit, which is also used to convert the light and shadow effect color from the original color space corresponding to the light and shadow effect color to the target color space to obtain a converted color result, wherein the target color space is used to characterize the color space that matches the modified shader; based on the font shape of the original font, the converted color result and the color of the original font are mixed to obtain a first color.
[0107] According to the above-mentioned embodiment of the present disclosure, the second generation unit is also used to determine the light and shadow effect color and the light and shadow effect shape based on the light and shadow effect parameters; based on the font shape of the target font, the light and shadow effect color and the color of the target font are mixed to obtain a second color; based on the font shape of the target font, the light and shadow effect shape and the transparency of the target font are mixed to obtain a second font shape; and the second color and the second font shape are determined as the target effect.
[0108] According to the above-mentioned embodiments of the present disclosure, the first mixing unit is further used to mix the first color in the original effect and the second color in the target effect based on the blur intensity parameter to obtain the target color; to mix the first font shape in the original effect and the second font shape in the target effect based on the blur intensity parameter to obtain the target font shape; and to generate a blurred font effect based on the target color and the target font shape.
[0109] According to the above-mentioned embodiment of the present disclosure, the first mixing unit is also used to decolorize the first color to obtain a first processed color, and to decolorize the second color to obtain a second processed color; to weight the first processed color and the first color to obtain a first weighted result, and to weight the second processed color and the second color to obtain a second weighted result; and to mix the first weighted result and the second weighted result based on a blur intensity parameter to obtain a target color.
[0110] According to the above embodiment of the present disclosure, the first mixing unit is further used to obtain the dot product of the first color and the preset value to obtain the first processed color; and obtain the dot product of the second color and the preset value to obtain the second processed color.
[0111] According to the above embodiment of the present disclosure, the first mixing unit is also used to mix the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain an initial font shape; obtain the dot product of the initial font shape and the transparency of the vertex color of the original font to obtain the target font shape.
[0112] According to the above-mentioned embodiment of the present disclosure, the blur intensity parameter includes: multiple parameter values within a preset time period; the first mixing unit is also used to generate multiple blurred font effects within a preset time period based on the light and shadow effect parameters and the multiple parameter values within the preset time period; the multiple blurred font effects within the preset time period are merged to obtain a blurred font animation of the original font.
[0113] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units and modules are all located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.
[0114] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0115] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0116] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0117] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0118] An editing interface corresponding to the modified shader is displayed on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0119] In response to a first operation instruction triggered by the editing interface, an original font is obtained.
[0120] In response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0121] Based on the light and shadow effect parameters and the blur intensity parameters, a blurred font effect corresponding to the original font is generated.
[0122] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: constructing a target font corresponding to the original font, wherein the clarity of the target font is less than a preset threshold, and the color of the original font is the same as the color of the target font; generating an original effect corresponding to the original font based on the original font and light and shadow effect parameters; generating a target effect corresponding to the target font based on the target font and light and shadow effect parameters; and mixing the original effect and the target effect based on a blur intensity parameter to generate a blurred font effect.
[0123] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: determining sampling coordinates based on the texture coordinates of the original font; determining a sampling mode of the original font; and sampling the original font based on the sampling coordinates and the sampling mode to obtain a target font.
[0124] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: determining the light and shadow effect color and the light and shadow effect shape based on the light and shadow effect parameters; mixing the light and shadow effect color and the color of the original font based on the font shape of the original font to obtain a first color; mixing the light and shadow effect shape and the transparency of the original font based on the font shape of the original font to obtain a first font shape; determining the first color and the first font shape as the original effects.
[0125] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: obtaining the transparency of the light and shadow effect color, the dot product of the light and shadow effect color and the transparency of the vertex color of the original font to obtain a color multiplication result; based on the font shape of the original font, mixing the color product result and the transparency of the original font to obtain a first font shape.
[0126] Optionally, the light and shadow effect parameters include: shadow effect parameters, used to generate the shadow effect of the original font, and the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: converting the light and shadow effect color from the original color space corresponding to the light and shadow effect color to the target color space to obtain a converted color result, wherein the target color space is used to characterize the color space that matches the modified shader; based on the font shape of the original font, mixing the converted color result and the color of the original font to obtain a first color.
[0127] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: determining the light and shadow effect color and the light and shadow effect shape based on the light and shadow effect parameters; mixing the light and shadow effect color and the color of the target font based on the font shape of the target font to obtain a second color; mixing the light and shadow effect shape and the transparency of the target font based on the font shape of the target font to obtain a second font shape; determining the second color and the second font shape as the target effect.
[0128] Optionally, the computer-readable storage medium is also configured to store program codes for performing the following steps: mixing a first color in an original effect and a second color in a target effect based on a blur intensity parameter to obtain a target color; mixing a first font shape in the original effect and a second font shape in the target effect based on a blur intensity parameter to obtain a target font shape; and generating a blurred font effect based on the target color and the target font shape.
[0129] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: decolorizing the first color to obtain a first processed color, and decolorizing the second color to obtain a second processed color; weighting the first processed color and the first color to obtain a first weighted result, and weighting the second processed color and the second color to obtain a second weighted result; mixing the first weighted result and the second weighted result based on a blur intensity parameter to obtain a target color.
[0130] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: obtaining a dot product of a first color and a preset value to obtain a first processed color; obtaining a dot product of a second color and a preset value to obtain a second processed color.
[0131] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: mixing the first font shape in the original effect and the second font shape in the target effect based on a blur strength parameter to obtain an initial font shape; obtaining the dot product of the initial font shape and the transparency of the vertex color of the original font to obtain a target font shape.
[0132] Optionally, the blur intensity parameter includes: multiple parameter values within a preset time period, and the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: based on the light and shadow effect parameters and the multiple parameter values within the preset time period, generating multiple blurred font effects within the preset time period; merging the multiple blurred font effects within the preset time period to obtain a blurred font animation of the original font.
[0133] In at least some embodiments of the present disclosure, an editing interface corresponding to the modified shader is displayed on a graphical user interface; in response to a first operation instruction triggered by the editing interface, the original font is obtained; in response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined; based on the light and shadow effect parameters and blur intensity parameters, a blurred font effect corresponding to the original font is generated. It is easy to notice that the present disclosure allows users to set light and shadow effect parameters and blur intensity parameters directly on the editing interface by adding blur intensity parameters to the shader, allowing users to customize the light and shadow effects and blur degree of the font, thereby increasing flexibility, and based on the light and shadow effect parameters and blur intensity parameters, not only can unnecessary blur effects be avoided and unnecessary computing processing can be reduced, but also blurred font effects that better meet the needs can be generated to achieve more diverse effects, while reducing the storage space required to generate font blur effects, thereby solving the technical problem in the related art that it is difficult to achieve a balance between blur effects and resource consumption when generating blurred font effects.
[0134] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0135] In an exemplary embodiment of the present disclosure, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of the present embodiment.
[0136] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present disclosure is not limited to this. In the embodiment of the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0137] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable 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 thereof.
[0138] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0139] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0140] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0141] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0142] An editing interface corresponding to the modified shader is displayed on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0143] In response to a first operation instruction triggered by the editing interface, an original font is obtained.
[0144] In response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0145] Based on the light and shadow effect parameters and the blur intensity parameters, a blurred font effect corresponding to the original font is generated.
[0146] Optionally, the processor may also be configured to perform the following steps through a computer program: construct a target font corresponding to the original font, wherein the clarity of the target font is less than a preset threshold, and the color of the original font is the same as the color of the target font; based on the original font and light and shadow effect parameters, generate an original effect corresponding to the original font; based on the target font and light and shadow effect parameters, generate a target effect corresponding to the target font; based on the blur intensity parameter, mix the original effect and the target effect to generate a blurred font effect.
[0147] Optionally, the processor may also be configured to perform the following steps through a computer program: determine sampling coordinates based on the texture coordinates of the original font; determine a sampling mode of the original font; and sample the original font based on the sampling coordinates and the sampling mode to obtain a target font.
[0148] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: based on the light and shadow effect parameters, determine the light and shadow effect color and the light and shadow effect shape; based on the font shape of the original font, mix the light and shadow effect color and the color of the original font to obtain a first color; based on the font shape of the original font, mix the light and shadow effect shape and the transparency of the original font to obtain a first font shape; determine the first color and the first font shape as the original effect.
[0149] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: obtain the transparency of the light and shadow effect color, the dot product of the light and shadow effect color and the transparency of the vertex color of the original font to obtain a color multiplication result; based on the font shape of the original font, mix the color product result and the transparency of the original font to obtain a first font shape.
[0150] Optionally, the light and shadow effect parameters include: shadow effect parameters, used to generate the shadow effect of the original font. The above-mentioned processor can also be configured to perform the following steps through a computer program: converting the light and shadow effect color from the original color space corresponding to the light and shadow effect color to a target color space to obtain a converted color result, wherein the target color space is used to characterize the color space that matches the modified shader; based on the font shape of the original font, mixing the converted color result and the color of the original font to obtain a first color.
[0151] Optionally, the processor may also be configured to perform the following steps through a computer program: based on light and shadow effect parameters, determine the light and shadow effect color and the light and shadow effect shape; based on the font shape of the target font, mix the light and shadow effect color and the color of the target font to obtain a second color; based on the font shape of the target font, mix the light and shadow effect shape and the transparency of the target font to obtain a second font shape; determine the second color and the second font shape as the target effect.
[0152] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: mixing the first color in the original effect and the second color in the target effect based on the blur intensity parameter to obtain the target color; mixing the first font shape in the original effect and the second font shape in the target effect based on the blur intensity parameter to obtain the target font shape; generating a blurred font effect based on the target color and the target font shape.
[0153] Optionally, the processor can also be configured to perform the following steps through a computer program: decolorize the first color to obtain a first processed color, and decolorize the second color to obtain a second processed color; weight the first processed color and the first color to obtain a first weighted result, and weight the second processed color and the second color to obtain a second weighted result; mix the first weighted result and the second weighted result based on a blur intensity parameter to obtain a target color.
[0154] Optionally, the processor may also be configured to perform the following steps through a computer program: obtaining a dot product of a first color and a preset value to obtain a first processed color; and obtaining a dot product of a second color and a preset value to obtain a second processed color.
[0155] Optionally, the processor may also be configured to perform the following steps through a computer program: mixing the first font shape in the original effect and the second font shape in the target effect based on a blur strength parameter to obtain an initial font shape; obtaining the dot product of the initial font shape and the transparency of the vertex color of the original font to obtain a target font shape.
[0156] Optionally, the blur intensity parameter includes: multiple parameter values within a preset time period, and the above-mentioned processor can also be configured to perform the following steps through a computer program: based on the light and shadow effect parameters and the multiple parameter values within the preset time period, generate multiple blurred font effects within the preset time period; merge the multiple blurred font effects within the preset time period to obtain a blurred font animation of the original font.
[0157] In at least some embodiments of the present disclosure, an editing interface corresponding to the modified shader is displayed on a graphical user interface; in response to a first operation instruction triggered by the editing interface, the original font is obtained; in response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined; based on the light and shadow effect parameters and blur intensity parameters, a blurred font effect corresponding to the original font is generated. It is easy to notice that the present disclosure allows users to set light and shadow effect parameters and blur intensity parameters directly on the editing interface by adding blur intensity parameters to the shader, allowing users to customize the light and shadow effects and blur degree of the font, thereby increasing flexibility, and based on the light and shadow effect parameters and blur intensity parameters, not only can unnecessary blur effects be avoided and unnecessary computing processing can be reduced, but also blurred font effects that better meet the needs can be generated to achieve more diverse effects, while reducing the storage space required to generate font blur effects, thereby solving the technical problem in the related art that it is difficult to achieve a balance between blur effects and resource consumption when generating blurred font effects.
[0158] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0159] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: at least one processor 510, at least one memory 520, a bus 530 connecting different system components (including the memory 520 and the processor 510), and a display 540.
[0160] The memory 520 stores program codes, which can be executed by the processor 510, so that the processor 510 executes the steps described in the method part of the embodiment of the present disclosure according to various exemplary embodiments of the present disclosure.
[0161] The memory 520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 5201 and / or a cache memory unit 5202, and may further include a read-only memory unit (ROM) 5203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0162] In some examples, the memory 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including but 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. The memory 520 may further include a memory remotely disposed relative to the processor 510, and these remote memories may be connected to the electronic device 500 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.
[0163] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of processor 510, or a bus using any of a variety of bus architectures.
[0164] The display 540 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 500 .
[0165] Optionally, the electronic device 500 may also communicate with one or more external devices 1400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 550. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 560. Figure 5 As shown, the network adapter 560 communicates with other modules of the electronic device 500 via the bus 530. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0166] The electronic device 500 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.
[0167] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 5 More or fewer components as shown, or with Figure 1 The memory 520 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the method for generating a blurred font effect in the embodiment of the present disclosure. The processor 510 executes various functional applications and data processing by running the computer programs stored in the memory 520, that is, implementing the method for generating a blurred font effect.
[0168] The embodiment of the present disclosure further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.
[0169] Optionally, the computer program included in the above computer program product is executed by a processor to perform the following steps:
[0170] An editing interface corresponding to the modified shader is displayed on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0171] In response to a first operation instruction triggered by the editing interface, an original font is obtained.
[0172] In response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0173] Based on the light and shadow effect parameters and the blur intensity parameters, a blurred font effect corresponding to the original font is generated.
[0174] The embodiments of the present disclosure also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.
[0175] Optionally, the computer program stored in the non-volatile computer-readable storage medium is used by the processor to execute the following steps:
[0176] An editing interface corresponding to the modified shader is displayed on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0177] In response to a first operation instruction triggered by the editing interface, an original font is obtained.
[0178] In response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0179] Based on the light and shadow effect parameters and the blur intensity parameters, a blurred font effect corresponding to the original font is generated.
[0180] The embodiment of the present disclosure further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.
[0181] Optionally, the computer program is executed by a processor to perform the following steps:
[0182] An editing interface corresponding to the modified shader is displayed on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold.
[0183] In response to a first operation instruction triggered by the editing interface, an original font is obtained.
[0184] In response to a second operation instruction triggered by the editing interface, light and shadow effect parameters and blur intensity parameters are determined, wherein the light and shadow effect parameters are used to generate the light and shadow effect of the original font, and the blur intensity parameters are used to generate the blurred font effect of the original font.
[0185] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0186] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0187] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0188] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0190] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A method for generating a fuzzy font effect, It is characterized in that include: Displaying an editing interface corresponding to the modified shader on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold; In response to a first operation instruction triggered by the editing interface, acquiring the original font; In response to a second operation instruction triggered by the editing interface, determining a light and shadow effect parameter and a blur intensity parameter, wherein the light and shadow effect parameter is used to generate the light and shadow effect of the original font, and the blur intensity parameter is used to generate a blurred font effect of the original font; A blurred font effect corresponding to the original font is generated based on the light and shadow effect parameter and the blur intensity parameter.
2. The method according to claim 1, It is characterized in that The generating, based on the light and shadow effect parameter and the blur intensity parameter, a blurred font effect corresponding to the original font comprises: Constructing a target font corresponding to the original font, wherein the clarity of the target font is less than the preset threshold, and the color of the original font is the same as the color of the target font; Based on the original font and the light and shadow effect parameters, generating an original effect corresponding to the original font; Based on the target font and the light and shadow effect parameters, generating a target effect corresponding to the target font; The original effect and the target effect are mixed based on the blur strength parameter to generate the blurred font effect.
3. The method according to claim 2, It is characterized in that The step of constructing a target font corresponding to the original font includes: Determining sampling coordinates based on the texture coordinates of the original font; Determining a sampling mode of the original font; The original font is sampled based on the sampling coordinates and the sampling mode to obtain the target font.
4. The method according to claim 2, It is characterized in that The generating the original effect corresponding to the original font based on the original font and the light and shadow effect parameters includes: Based on the light and shadow effect parameters, determining the light and shadow effect color and the light and shadow effect shape; Based on the font shape of the original font, the light and shadow effect color and the color of the original font are mixed to obtain a first color; Based on the font shape of the original font, the light and shadow effect shape and the transparency of the original font are mixed to obtain a first font shape; The first color and the first font shape are determined as the original effect.
5. The method according to claim 4, It is characterized in that The step of mixing the light and shadow effect shape and the transparency of the original font based on the font shape of the original font to obtain a first font shape includes: Obtaining the transparency of the light and shadow effect color, the dot product of the light and shadow effect color and the transparency of the vertex color of the original font, to obtain a color product result; Based on the font shape of the original font, the color product result and the transparency of the original font are mixed to obtain the first font shape.
6. The method according to claim 4, It is characterized in that The light and shadow effect parameters include: shadow effect parameters for generating the shadow effect of the original font; the light and shadow effect color and the color of the original font are mixed based on the font shape of the original font to obtain a first color, including: Converting the light and shadow effect color from an original color space corresponding to the light and shadow effect color to a target color space to obtain a converted color result, wherein the target color space is used to represent a color space that matches the modified shader; Based on the font shape of the original font, the converted color result and the color of the original font are mixed to obtain the first color.
7. The method according to claim 2, It is characterized in that The generating a target effect corresponding to the target font based on the target font and the light and shadow effect parameters includes: Based on the light and shadow effect parameters, determining the light and shadow effect color and the light and shadow effect shape; Based on the font shape of the target font, the light and shadow effect color and the color of the target font are mixed to obtain a second color; Based on the font shape of the target font, the light and shadow effect shape and the transparency of the target font are mixed to obtain a second font shape; The second color and the second font shape are determined as the target effect.
8. The method according to any one of claims 2 to 7, It is characterized in that The mixing the original effect and the target effect based on the blur strength parameter to generate the blurred font effect includes: Mixing the first color in the original effect and the second color in the target effect based on the blur intensity parameter to obtain a target color; Mixing the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain a target font shape; The blurred font effect is generated based on the target color and the target font shape.
9. The method according to claim 8, It is characterized in that The step of mixing the first color in the original effect and the second color in the target effect based on the blur intensity parameter to obtain the target color includes: Performing a decolorization process on the first color to obtain a first processed color, and performing a decolorization process on the second color to obtain a second processed color; Performing weighted processing on the first processed color and the first color to obtain a first weighted result, and performing weighted processing on the second processed color and the second color to obtain a second weighted result; The first weighted result and the second weighted result are mixed based on the blur strength parameter to obtain the target color.
10. The method according to claim 9, It is characterized in that performing decolorization processing on the first color, Obtaining a first processed color and processing the second color to obtain a second processed color, comprising: Obtaining a dot product of the first color and a preset value to obtain the first processed color; Obtain a dot product of the second color and the preset value to obtain the second processed color.
11. The method according to claim 8, It is characterized in that The step of mixing the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain a target font shape comprises: Mixing the first font shape in the original effect and the second font shape in the target effect based on the blur strength parameter to obtain an initial font shape; The target font shape is obtained by obtaining a dot product of the initial font shape and the transparency of the vertex color of the original font.
12. The method according to claim 1, It is characterized in that The blur intensity parameter includes: a plurality of parameter values within a preset time period; and generating a blurred font effect corresponding to the original font based on the light and shadow effect parameter and the blur intensity parameter includes: Based on the light and shadow effect parameter and a plurality of parameter values within the preset time period, generating a plurality of blurred font effects within the preset time period; The multiple blurred font effects within the preset time period are combined to obtain the blurred font animation of the original font.
13. A device for generating a fuzzy font effect, It is characterized in that include: A display module, configured to display an editing interface corresponding to the modified shader on a graphical user interface, wherein the modified shader is used to represent a shader obtained by adding a blur strength parameter to a shader corresponding to an original font, the original font is represented by a distance field, and the clarity of the original font is greater than a preset threshold; An acquisition module, configured to respond to a first operation instruction triggered by the editing interface and acquire the original font; a determination module, configured to respond to a second operation instruction triggered by the editing interface and determine a light and shadow effect parameter and a blur intensity parameter, wherein the light and shadow effect parameter is used to generate the light and shadow effect of the original font, and the blur intensity parameter is used to generate a blur font effect of the original font; A generating module is used to generate a blurred font effect corresponding to the original font based on the light and shadow effect parameter and the blur intensity parameter.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 12.
16. A computer program product, It is characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 12.
