Texture rendering method, device, terminal device and computer-readable storage medium
By pre-storing the target map and rendering files on the server, and only rendering one target map after the terminal device updates to achieve ablation effect, solving the problem of time-consuming processing and waste of resources in three-dimensional games and improving the user experience.
Patent Information
- Application Number
- CN202111640552.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, the processing time is high and resources are wasted when implementing ablation special effects in three-dimensional games. The traditional method uses a separate mask map to interpolate with the model map to increase the processing time and reduces the user experience.
By pre-storing the target map and rendering files on the server, the terminal device obtains and updates the map and rendering files in response to user operations, and renders them according to the preset overlay algorithm and ablation parameters. Only one target map needs to be rendered to achieve ablation special effects, reducing processing time and resource consumption.
It reduces processing time, improves user experience, and reduces resource consumption. Users can render after the terminal device is updated, and the processing time is not borne by the user.
Smart Images

Figure CN114377392B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a texture rendering method, apparatus, terminal device and computer-readable storage medium. Background Art
[0002] In the existing technology, the traditional method of achieving ablation effects in three-dimensional games is to make the three-dimensional model transparent through a mask map. However, when implementing the ablation effect for large models, the use of a separate mask map and the model map for interpolation will increase the processing time, and the processing time is borne by the user, which reduces the user experience; and the ablation effect requires two maps to be achieved, which increases resource waste. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a texture rendering method, apparatus, terminal device and computer-readable storage medium to solve the problems of high processing time and high resource waste when realizing ablation special effects in the prior art.
[0004] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0005] In a first aspect, the present invention provides a texture rendering method, applied to a terminal device, wherein the terminal device is communicatively connected to a server, and a target texture and a target rendering file are pre-stored on the server. The target texture is obtained by overlaying an initial ablation texture on an initial model texture according to a preset overlay algorithm. The target rendering file includes an ablation trigger condition and ablation parameters. The method includes:
[0006] In response to a user operation on the terminal device, obtaining the target map and the target rendering file on the server;
[0007] Updating the model map and the ablation map on the terminal device to the target map, and updating the rendering file on the terminal device to the target rendering file;
[0008] When the terminal device meets the ablation trigger condition in the target rendering file, the target map is rendered according to the ablation parameters in the target rendering file.
[0009] In an optional embodiment, the target map is obtained by the following steps:
[0010] An initial model map and an initial ablation map corresponding to the solid model are obtained according to the solid model that requires ablation effects, and according to a preset covering algorithm, the values of different positions of the initial ablation map are covered with the values of the A channel of the corresponding positions of the initial model map to obtain the target map.
[0011] In an optional embodiment, the target rendering file is obtained by the following steps:
[0012] The ablation trigger condition and the ablation parameter are added to the initial rendering file to obtain a target rendering file.
[0013] In an optional embodiment, the ablation parameters include an ablation time and an ablation coefficient, and when the terminal device satisfies the ablation trigger condition in the target rendering file, rendering the target map according to the ablation parameters in the target rendering file includes:
[0014] When the terminal device meets the ablation trigger condition in the target rendering file, the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file are multiplied to adjust the value of the A channel of the target map, thereby rendering the target map.
[0015] In an optional embodiment, the target rendering file further includes a preset value, and the method further includes:
[0016] When the terminal device does not meet the ablation trigger condition, the value of the A channel of the target map is set to the preset value according to the target rendering file, so that the target map presents an opaque effect.
[0017] In a second aspect, the present invention provides a map rendering device, which is applied to a terminal device, wherein the terminal device is communicatively connected to a server, and a target map and a target rendering file are pre-stored on the server. The target map is obtained by overlaying an initial ablation map on an initial model map according to a preset overlay algorithm. The target rendering file includes an ablation trigger condition and ablation parameters. The device includes:
[0018] An acquisition module, configured to respond to a user's operation on the terminal device and acquire the target map and the target rendering file on the server;
[0019] An updating module, configured to update the model map and the ablation map on the terminal device to the target map, and update the rendering file on the terminal device to the target rendering file;
[0020] A rendering module is used to render the target map according to the ablation parameters in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file.
[0021] In an optional embodiment, the ablation parameters include ablation time and ablation coefficient, and the rendering module is used to multiply the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file, so as to adjust the value of the A channel of the target map, thereby rendering the target map.
[0022] In an optional embodiment, the target rendering file also includes a preset value, and the rendering module is further used to set the value of the A channel of the target map to the preset value according to the target rendering file when the terminal device does not meet the ablation trigger condition, so as to make the target map present an opaque effect.
[0023] In a third aspect, the present invention provides a terminal device comprising a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the method described in any one of the aforementioned embodiments.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any one of the aforementioned embodiments.
[0025] The texture rendering method, apparatus, terminal device, and computer-readable storage medium provided by the embodiments of the present invention obtain a target texture and a target rendering file from a server in response to a user's operation on a terminal device, then update the model texture and ablation texture on the terminal device to the target texture, and update the rendering file on the terminal device to the target rendering file. Furthermore, when the terminal device meets the ablation trigger condition in the target rendering file, the target texture is rendered according to the ablation parameters in the target rendering file. Since the target texture required for rendering is obtained by overlaying the model texture with the ablation texture, after the terminal device updates the original model texture and ablation texture according to the target texture, only the target texture needs to be rendered, thereby reducing processing time. Furthermore, when the terminal device meets the ablation trigger condition in the target rendering file, only the target texture needs to be rendered to achieve the ablation effect, thereby reducing resource consumption. Furthermore, the target texture is pre-stored on the server and is pre-produced. After the user updates the terminal device, the target texture can be rendered, eliminating the processing time and improving the user experience.
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A schematic diagram showing an application environment of the texture rendering method provided by an embodiment of the present invention is shown;
[0029] Figure 2 A block diagram of a terminal device provided by an embodiment of the present invention is shown;
[0030] Figure 3 A schematic diagram of a process of a texture rendering method provided by an embodiment of the present invention is shown;
[0031] Figure 4 Another schematic diagram of the flowchart of the texture rendering method provided by an embodiment of the present invention is shown;
[0032] Figure 5 A functional module diagram of a texture rendering device provided by an embodiment of the present invention is shown.
[0033] Icons: 10 - terminal device; 20 - server; 210 - memory; 220 - processor; 230 - communication module; 401 - acquisition module; 402 - update module; 403 - rendering module. DETAILED DESCRIPTION
[0034] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0035] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but is merely intended to represent selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.
[0036] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0037] Please refer to Figure 1 , Figure 1 Schematic diagram of an application environment of the texture rendering method provided by an embodiment of the present invention. Figure 1 As shown, the terminal device 10 is in communication connection with the server 20 , wherein there are one or more terminal devices 10 , which is not limited in the embodiment of the present invention.
[0038] In this embodiment, the server 20 stores textures and rendering files that can be used by the terminal device 10 to achieve ablation effects. When the user performs an update operation on the terminal device 10, the terminal device 10 can obtain the textures and rendering files stored on the server 20, and update the original textures and rendering files in the terminal device 10, so that the terminal device 10 renders the textures according to the updated textures and rendering files to achieve ablation effects.
[0039] In this embodiment, the terminal device 10 may be a personal computer (PC), a laptop computer, a tablet computer, a mobile phone, etc., and the embodiment of the present invention does not limit this.
[0040] Please refer to Figure 2 is a block diagram of a terminal device 10 provided in an embodiment of the present invention. The terminal device 10 includes a memory 210, a processor 220, and a communication module 230. The memory 210, processor 220, and communication module 230 are electrically connected to each other, directly or indirectly, to enable data transmission or exchange. For example, these components may be electrically connected via one or more communication buses or signal lines.
[0041] The memory 210 is used to store programs or data. The memory 210 can be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0042] The processor 220 may be an integrated circuit chip with signal processing capabilities. The processor 220 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor.
[0043] The processor 220 is used to read and write data or programs stored in the memory 210 and execute corresponding functions. For example, when the processor 220 executes the computer program stored in the memory 210, the texture rendering method disclosed in various embodiments of the present invention can be implemented.
[0044] The communication module 230 is used to establish a communication connection between the terminal device 10 and the server 20 through the network, and to send and receive data through the network.
[0045] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the terminal device 10. The terminal device 10 may also include Figure 2 More or fewer components than shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0046] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the texture rendering method disclosed in each embodiment of the present invention can be implemented.
[0047] In the existing technology, the traditional method of achieving ablation effects in three-dimensional games is to make the three-dimensional model transparent through a mask map. However, when implementing the ablation effect for large models, the use of a separate mask map and the model map for interpolation will increase the processing time, and the processing time is borne by the user, which reduces the user experience; and the ablation effect requires two maps to be achieved, which increases resource waste.
[0048] Based on the above problems, in order to solve the problems of high processing time and high resource waste when realizing ablation special effects in the prior art, the embodiment of the present invention provides a texture rendering method, please refer to Figure 3 , Figure 3 A flowchart of a texture rendering method provided by an embodiment of the present invention. The method includes:
[0049] Step S301: In response to the user's operation on the terminal device, a target map and a target rendering file are obtained from the server.
[0050] Optionally, the operations of the responding user on the terminal device are not limited and can be selected according to actual needs. For example, taking a three-dimensional game as an example, when the user opens the three-dimensional game through the terminal device 10, the terminal device 10 will send version query information to the server 20. When there is a difference between the version on the terminal device 10 and the version on the server, the user can perform an update operation on the terminal device 10 to obtain the target map and target rendering file on the server.
[0051] In this embodiment, a target map and a target rendering file are pre-stored on the server. The target map is obtained by overlaying the initial model map with the initial ablation map according to a preset overlay algorithm; the target rendering file includes ablation trigger conditions and ablation parameters.
[0052] Step S302: updating the model map and the ablation map on the terminal device to the target map, and updating the rendering file on the terminal device to the target rendering file.
[0053] Optionally, when the terminal device 10 obtains the target map, the original model map and ablation map on the terminal device 10 are deleted and replaced with the target map to update the map.
[0054] Similarly, when the terminal device 10 obtains the target rendering file, the original rendering file on the terminal device 10 is deleted and replaced with the target rendering file to achieve the update of the rendering file.
[0055] Step S303: When the terminal device meets the ablation triggering condition in the target rendering file, the target map is rendered according to the ablation parameters in the target rendering file.
[0056] Optionally, the setting of the ablation trigger condition is not limited and can be selected according to actual needs. For example, continuing with the three-dimensional game as an example, the ablation trigger condition is set to the death of the BOSS in the game. When the BOSS in the game dies, it is considered that the terminal device 10 meets the ablation trigger condition in the target rendering file. At this time, the terminal device 10 renders the target map according to the ablation parameters in the target rendering file to achieve the ablation special effect after the death of the BOSS.
[0057] The texture rendering method provided by the embodiment of the present invention obtains the target texture and target rendering file on the server by responding to the user's operation on the terminal device, and then updates the model texture and ablation texture on the terminal device to the target texture, and updates the rendering file on the terminal device to the target rendering file. Then, when the terminal device meets the ablation trigger condition in the target rendering file, the target texture is rendered according to the ablation parameters in the target rendering file. Since the target texture required for rendering is obtained by covering the model texture with the ablation texture, after the terminal device updates the original model texture and ablation texture according to the target texture, it only needs to render the target texture, which reduces processing time. Moreover, when the terminal device meets the ablation trigger condition in the target rendering file, it only needs to render the target texture to achieve the ablation effect, which reduces resource consumption. Furthermore, the target texture is pre-stored on the server and is pre-made. After the user updates the terminal device, the target texture can be rendered. The processing time is not borne by the user, which improves the user experience.
[0058] In this embodiment, the target map is obtained by the following steps:
[0059] According to the solid model that requires ablation effects, an initial model map and an initial ablation map corresponding to the solid model are obtained, and according to a preset covering algorithm, the values of different positions of the initial ablation map are covered with the values of the A channel of the corresponding positions of the initial model map to obtain the target map.
[0060] Optionally, in the local production layer of the terminal device 10, a solid model requiring ablation effects is obtained, an initial model map is obtained from the solid model, and an initial ablation map corresponding to the solid model is obtained, wherein the production layer represents the local storage (Local Storage) on the terminal device 10. It should be noted that only the value of the A channel in the initial ablation map is adjustable; the initial model map has the values of the four channels RGBA, but the value of the A channel in the initial model map is not adjustable. That is to say, when realizing the ablation effect of the map, it can be realized by adjusting the value of the A channel in the map. Therefore, the values of different positions of the initial ablation map are overwritten with the value of the A channel of the corresponding same pixel position on the initial model map to obtain the target map.
[0061] Specifically, the covering algorithm can be expressed as follows:
[0062] (Model Map).A = (Ablation Map).A
[0063] In one example, a developer uses a terminal such as a personal computer (PC) to obtain a solid model that requires ablation effects in a local production layer, obtains an initial model map from the solid model, and obtains an initial ablation map corresponding to the solid model. According to the above-mentioned overlay algorithm, the values of the A channel at the corresponding positions of the initial model map are overwritten with the values of different positions of the initial ablation map to obtain a target map. The developer then uploads the target map to the server for storage through a terminal such as a PC.
[0064] In this embodiment, the target rendering file is obtained through the following steps:
[0065] Add ablation trigger conditions and ablation parameters to the initial rendering file to obtain the target rendering file.
[0066] Optionally, since the initial rendering file does not contain ablation trigger conditions and ablation parameters, in order to achieve rendering of the target map, it is necessary to add ablation trigger conditions and ablation parameters to the initial rendering file to obtain the target rendering file.
[0067] In one example, the developer obtains ablation trigger conditions and ablation parameters as needed, and uses a terminal such as a PC to add the ablation trigger conditions and ablation parameters to the initial rendering file in the local production layer to obtain the target rendering file. The developer then uploads the target rendering file to the server for storage through a terminal such as a PC.
[0068] In order to achieve the ablation effect by rendering the target map, the above step S303 includes:
[0069] When the terminal device meets the ablation trigger condition in the target rendering file, the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file are multiplied to adjust the value of the A channel of the target map, thereby rendering the target map.
[0070] Optionally, the ablation parameters include ablation time and ablation coefficient. In this embodiment, the value of the A channel of the target map is adjusted, which can be expressed by the following formula:
[0071] Ablation time × ablation coefficient × the value of channel A of the target map
[0072] The ablation time represents the time when the target map starts to be rendered; the ablation coefficient represents the speed at which the target map is rendered; and the value of the A channel of the target map represents the position at which the target map starts to be rendered.
[0073] It should be noted that when the terminal device meets the ablation trigger conditions in the target rendering file, the ablation time is used to determine the time when the target map starts rendering, the ablation coefficient is used to determine the speed at which the target map is rendered, and the value of the A channel of the target map is used to determine the position at which the target map starts rendering. The value of the A channel of the target map is adjusted to render the target map, so that the target map gradually becomes transparent, thereby achieving the ablation effect.
[0074] In some scenarios, after the user performs an operation on the terminal device 10, there is a need to make the terminal device 10 set the value of the A channel of the target map accordingly. Based on this, please refer to Figure 4 , Figure 4 Another flowchart of a texture rendering method provided by an embodiment of the present invention. The method further includes:
[0075] Step S304: When the terminal device does not meet the ablation triggering condition, the value of the A channel of the target map is set to a preset value according to the target rendering file, so that the target map presents an opaque effect.
[0076] Optionally, continuing with the example of a three-dimensional game, in some embodiments, when a user uses the terminal device 10 to enter a virtual scene in the game, the terminal device 10 will begin rendering to present the characters, objects, etc. in the virtual scene to the user. In order to allow the user to clearly see the characters, objects, etc. in the virtual scene, the terminal device 10 needs to set the value of the A channel of the target map so that the target map presents an opaque effect. The preset value is not limited and can be set according to actual needs. It is understood that the value of the A channel can be set to a value between 0 and 1. For example, in this embodiment, in order to achieve a better opaque effect, the preset value can be set to 1.
[0077] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a texture rendering device is given below. Figure 5 , Figure 5 This is a functional block diagram of a texture rendering device provided in an embodiment of the present invention. It should be noted that the basic principles and technical effects of the texture rendering device provided in this embodiment are the same as those in the aforementioned embodiments. For the sake of brevity, any details not mentioned in this embodiment are referred to the corresponding content in the aforementioned embodiments. The texture rendering device includes an acquisition module 401, an update module 402, and a rendering module 403.
[0078] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory shown in FIG. 1 or the operating system (OS) of the terminal device 10 may be fixed therein and may be Figure 2 Meanwhile, the data and program codes required to execute the above modules may be stored in the memory.
[0079] The acquisition module 401 is used to respond to the user's operation on the terminal device and acquire the target map and target rendering file on the server.
[0080] It can be understood that the acquisition module 401 can execute the above step S301.
[0081] The updating module 402 is configured to update the model map and the ablation map on the terminal device to the target map, and update the rendering file on the terminal device to the target rendering file.
[0082] It can be understood that the updating module 402 can execute the above step S302.
[0083] The rendering module 403 is configured to render the target map according to the ablation parameters in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file.
[0084] Optionally, the rendering module 403 is used to multiply the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file to adjust the value of the A channel of the target map, thereby rendering the target map when the terminal device meets the ablation trigger condition in the target rendering file.
[0085] It can be understood that the rendering module 403 can execute the above step S303.
[0086] Optionally, the rendering module 403 is further configured to set the value of the A channel of the target map to a preset value according to the target rendering file when the terminal device does not meet the ablation trigger condition, so as to make the target map present an opaque effect.
[0087] It can be understood that the rendering module 403 can execute the above step S304.
[0088] In the texture rendering device provided by an embodiment of the present invention, the acquisition module obtains the target texture and target rendering file from the server in response to the user's operation on the terminal device. The update module then updates the model texture and ablation texture on the terminal device to the target texture, and updates the rendering file on the terminal device to the target rendering file. The rendering module then renders the target texture according to the ablation parameters in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file. Since the target texture required for rendering is obtained by overlaying the model texture with the ablation texture, after the terminal device updates the original model texture and ablation texture according to the target texture, it only needs to render the target texture, which reduces processing time. Moreover, when the terminal device meets the ablation trigger condition in the target rendering file, it only needs to render the target texture to achieve the ablation effect, which reduces resource consumption. Furthermore, the target texture is pre-stored on the server and is pre-made. After the user updates the terminal device, the target texture can be rendered, and the processing time is not borne by the user, thereby improving the user experience.
[0089] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or actions, or can be implemented using a combination of dedicated hardware and computer instructions.
[0090] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0091] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0092] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A texture rendering method, characterized in that: The method is applied to a terminal device, wherein the terminal device is communicatively connected to a server, and a target map and a target rendering file are pre-stored on the server. The target map is obtained by covering the initial model map with the initial ablation map according to a preset covering algorithm. The target map is obtained by: obtaining an initial model map and an initial ablation map corresponding to the solid model according to a solid model requiring ablation special effects, and covering the values of the A channel of the corresponding position of the initial model map with the values of different positions of the initial ablation map according to a preset covering algorithm to obtain the target map; wherein, the initial ablation map contains only the value of the A channel and is adjustable; the initial model map contains the values of the four channels RGBA, and the value of the A channel in the initial model map is not adjustable; the target rendering file includes an ablation trigger condition and ablation parameters, and the method includes: In response to a user operation on the terminal device, obtaining the target map and the target rendering file on the server; Updating the model map and the ablation map on the terminal device to the target map, and updating the rendering file on the terminal device to the target rendering file; When the terminal device meets the ablation trigger condition in the target rendering file, the target map is rendered according to the ablation parameters in the target rendering file.
2. The method according to claim 1, characterized in that The target rendering file is obtained by the following steps: The ablation trigger condition and the ablation parameter are added to the initial rendering file to obtain a target rendering file.
3. The method according to claim 1, characterized in that The ablation parameters include an ablation time and an ablation coefficient. When the terminal device satisfies the ablation trigger condition in the target rendering file, rendering the target map according to the ablation parameters in the target rendering file includes: When the terminal device meets the ablation trigger condition in the target rendering file, the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file are multiplied to adjust the value of the A channel of the target map, thereby rendering the target map.
4. The method according to claim 1, wherein The target rendering file further includes a preset value, and the method further includes: When the terminal device does not meet the ablation trigger condition, the value of the A channel of the target map is set to the preset value according to the target rendering file, so that the target map presents an opaque effect.
5. A texture rendering device, characterized in that: The invention is applied to a terminal device, wherein the terminal device is communicatively connected with a server, and a target map and a target rendering file are pre-stored on the server. The target map is obtained by covering the initial model map with the initial ablation map according to a preset covering algorithm. The target map is obtained by: obtaining an initial model map and an initial ablation map corresponding to the solid model according to a solid model requiring ablation special effects, and covering the values of the A channel of the corresponding position of the initial model map with the values of different positions of the initial ablation map according to a preset covering algorithm to obtain the target map; wherein, the initial ablation map contains only the value of the A channel and is adjustable; the initial model map contains the values of the four channels RGBA, and the value of the A channel in the initial model map is not adjustable; the target rendering file includes the ablation trigger condition and the ablation parameter, and the device includes: An acquisition module, configured to respond to a user's operation on the terminal device and acquire the target map and the target rendering file on the server; An updating module, configured to update the model map and the ablation map on the terminal device to the target map, and update the rendering file on the terminal device to the target rendering file; A rendering module is used to render the target map according to the ablation parameters in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file.
6. The device according to claim 5, characterized in that The ablation parameters include ablation time and ablation coefficient. The rendering module is used to multiply the ablation time, ablation coefficient and the value of the A channel of the target map in the target rendering file when the terminal device meets the ablation trigger condition in the target rendering file, so as to adjust the value of the A channel of the target map and render the target map.
7. The device according to claim 5, characterized in that The target rendering file also includes a preset value, and the rendering module is also used to set the value of the A channel of the target map to the preset value according to the target rendering file when the terminal device does not meet the ablation trigger condition, so that the target map presents an opaque effect.
8. A terminal device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Information processing method and device
CN110599396A
Document storage method and device, electronic equipment and storage medium
CN112783839A