Liquid material dissolving method, device, electronic device and storage medium

By correlating the transparency of the liquid material with the grayscale value of the noise map, using the smooth step function and offset recombination to generate the dissolution effect normal map, the problem of the thickness dissolution effect of the liquid material belt thickness has been solved, and smooth dissolution under the influence of low performance is achieved.

CN114359081BActive Publication Date: 2025-08-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111599759.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-08-15
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

When the prior art realizes the dissolution effect of liquid material strip thickness, more intermediate frames are required, resulting in a greater impact on performance, and reducing intermediate frames will affect the smoothness of the dissolution effect.

Method used

By obtaining the grayscale values of the target liquid material and noise map, the noise map is processed using the smooth step function and offset recombination to generate the dissolution effect normal map, and fuse it with the original normal map to control the smooth step function to achieve the dissolution of the liquid material.

Benefits of technology

The dissolution of liquid material is achieved under the influence of less performance, and the dissolution effect of liquid material with thickness is achieved by constructing the fusion of the dissolution effect normal map and the original normal map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359081B_ABST
    Figure CN114359081B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device, and storage medium for dissolving a liquid material, including: obtaining a liquid material and a noise map, and associating the transparency of the liquid material with the grayscale value of the noise map; performing smooth transition processing on the noise map using a smooth step function, and extracting the grayscale value as the initial grayscale value; performing offset reorganization on the noise map after the smooth transition, extracting the grayscale value of the offset reorganized noise map as the offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain offset grayscale information; inputting the offset grayscale information into a texture sampler to obtain an output dissolution effect normal map; fusing the dissolution effect normal map with the original normal map of the liquid material; and achieving dissolution of the liquid material by controlling the smooth step function. The present disclosure can achieve dissolution of liquid materials with thickness while minimizing the impact on performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer animation technology, and in particular to a liquid material dissolving method, device, electronic device, and storage medium. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] In the field of computer animation, especially in game development, creating dissolving effects for liquid materials requires managing the thickness of the dissolving edge. The existing approach is to render the intrinsic color and normals into separate frames, then play those frames through the material to create a dissolving effect with thickness. However, this approach requires a large number of intermediate frames, significantly impacting performance. If there are too few intermediate frames, the dissolving effect will be unsmooth. Summary of the Invention

[0004] In response to the above technical problems, an improved solution is needed that can achieve the dissolution of liquid material with a certain thickness while having little impact on performance.

[0005] Based on the above objectives, the exemplary embodiments of the present disclosure provide a method for dissolving a liquid material, comprising:

[0006] Obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map;

[0007] Performing a smooth transition process on the noise map using a smooth step function, and extracting a grayscale value of the noise map after the smooth transition as an initial grayscale value;

[0008] Performing offset reorganization on the noise map after the smooth transition, extracting the grayscale value of the noise map after the offset reorganization as an offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain offset grayscale information;

[0009] Inputting the offset grayscale information into a texture sampler to obtain a dissolving effect normal map output by the texture sampler;

[0010] Merging the dissolve effect normal map with the original normal map of the target liquid material;

[0011] The dissolution of the target liquid material is achieved by controlling the smooth step function.

[0012] In some exemplary embodiments, the transparency of the target liquid material is the transparency of the pixels in the target liquid material; the grayscale value of the noise map is the grayscale value of the pixels in the noise map;

[0013] The associating the transparency of the target liquid material with the grayscale value of the noise map specifically includes:

[0014] For a pixel point in the target liquid material, the transparency value of the pixel point is set to the grayscale value of the pixel point corresponding to the position coordinate of the pixel point in the noise map.

[0015] In some exemplary embodiments, the smooth step function includes a maximum parameter and a minimum parameter;

[0016] The smooth transition processing of the noise map by using a smooth step function specifically includes:

[0017] For a pixel point in the noise map, in response to determining that the grayscale value of the pixel point is greater than the maximum value parameter, the grayscale value of the pixel point is set to the maximum grayscale value; in response to determining that the grayscale value of the pixel point is less than the minimum value parameter, the grayscale value of the pixel point is set to the minimum grayscale value.

[0018] In some exemplary embodiments, the offset grayscale information includes first offset grayscale information and second offset grayscale information;

[0019] The offset reorganization of the noise map after the smooth transition, extracting the grayscale value of the noise map after the offset reorganization as the offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain the offset grayscale information specifically includes:

[0020] offsetting the noise map after the smooth transition by a first preset distance along the horizontal axis, moving the portion of the noise map that exceeds the original boundary after the offset to the other side of the noise map to obtain a first offset noise map, extracting a grayscale value of the first offset noise map as a first offset grayscale value, and subtracting the initial grayscale value from the first offset grayscale value to obtain the first offset grayscale information;

[0021] The noise map after the smooth transition is offset by a second preset distance along the vertical axis direction, and the portion that exceeds the original boundary of the noise map after the offset is moved to the other side of the noise map to obtain a second offset noise map, and the grayscale value of the second offset noise map is extracted as the second offset grayscale value. The initial grayscale value is subtracted from the second offset grayscale value to obtain the second offset grayscale information.

[0022] In some exemplary embodiments, the first preset distance is equal to the second preset distance.

[0023] In some exemplary embodiments, the texture sampler includes an r channel, a g channel, and a b channel;

[0024] Inputting the offset grayscale information into a texture sampler to obtain a dissolving effect normal map output by the texture sampler specifically includes:

[0025] Inputting the first offset grayscale information into the r channel of the texture sampler;

[0026] Inputting the second offset grayscale information into the g channel of the texture sampler;

[0027] The first offset grayscale information and the second offset grayscale information are respectively multiplied by a thickness parameter and input into the b channel of the texture sampler, and then cross-multiplied.

[0028] In some exemplary embodiments, by controlling the thickness parameter, the thickness of the dissolving edge of the target liquid material can be controlled.

[0029] In some exemplary embodiments, the step of fusing the dissolving effect normal map with the original normal map of the target liquid material specifically includes:

[0030] Add one to the value of the r channel, the value of the g channel, and the value of the b channel of the original normal map as a first three-dimensional vector;

[0031] Multiply the value of the r channel of the dissolve effect normal map by negative one, the value of the g channel by negative one, and the value of the b channel as the second three-dimensional vector;

[0032] Performing a dot product of the first three-dimensional vector and the second three-dimensional vector to obtain a dot product value;

[0033] Multiplying the dot product value by the first three-dimensional vector to obtain a first RGB value;

[0034] Add one to the value of the b channel of the original normal map and multiply the result by the second three-dimensional vector to obtain a second RGB value;

[0035] The second RGB value is subtracted from the first RGB value to achieve fusion of the dissolve effect normal map and the original normal map.

[0036] In some exemplary embodiments, controlling the smooth step function to achieve dissolution of the target liquid material specifically includes:

[0037] The dissolution of the target liquid material is achieved by controlling the minimum parameter of the smooth step function to gradually increase.

[0038] Based on the same inventive concept, the exemplary embodiments of the present disclosure further provide a liquid material dissolving device, comprising:

[0039] a noise map associating module configured to obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map;

[0040] an initial grayscale value acquisition module configured to perform a smooth transition process on the noise map using a smooth step function, and extract the grayscale value of the noise map after the smooth transition as the initial grayscale value;

[0041] an offset grayscale information acquisition module configured to perform offset reorganization on the noise map after the smooth transition, extract the grayscale value of the noise map after the offset reorganization as an offset grayscale value, and subtract the initial grayscale value from the offset grayscale value to obtain offset grayscale information;

[0042] a dissolve effect normal map acquisition module, configured to input the offset grayscale information into a texture sampler to obtain a dissolve effect normal map output by the texture sampler;

[0043] a normal map fusion module configured to fuse the dissolve effect normal map with the original normal map of the target liquid material;

[0044] The dissolution effect generating module is configured to achieve the dissolution of the target liquid material by controlling the smooth step function.

[0045] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods when executing the program.

[0046] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above methods.

[0047] From the above description, it can be seen that the liquid material dissolution method, device, electronic device and storage medium provided by the embodiments of the present disclosure include: obtaining a target liquid material and a noise map of the same size as the target liquid material, and associating the transparency of the target liquid material with the grayscale value of the noise map; performing smooth transition processing on the noise map through a smooth step function, and extracting the grayscale value of the noise map after the smooth transition as the initial grayscale value; performing offset reorganization on the noise map after the smooth transition, extracting the grayscale value of the noise map after the offset reorganization as the offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain the offset grayscale information; inputting the offset grayscale information into the texture sampler to obtain the dissolution effect normal map output by the texture sampler; fusing the dissolution effect normal map with the original normal map of the target liquid material; and achieving the dissolution of the target liquid material by controlling the smooth step function. The present disclosure achieves the liquid dissolution effect by controlling the noise map, without considering the influence of the frame rate, and can achieve the dissolution of the liquid material under the premise of having little impact on performance. Furthermore, by fusing the constructed dissolving effect normal map with the original normal map, dissolving of liquid material with thickness can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 A schematic diagram of an application scenario provided according to an embodiment of the present disclosure;

[0050] Figure 2 A schematic flow chart of a method for dissolving a liquid material according to an embodiment of the present disclosure;

[0051] Figure 3 A schematic diagram of a liquid material provided according to an embodiment of the present disclosure;

[0052] Figure 4 A schematic diagram of a noise map provided according to an embodiment of the present disclosure;

[0053] Figure 5 A schematic diagram of a liquid material dissolving without thickness according to an embodiment of the present disclosure;

[0054] Figure 6 A schematic diagram of offset grayscale information provided according to an embodiment of the present disclosure;

[0055] Figure 7 A schematic diagram of a texture sampler for inputting offset grayscale information according to an embodiment of the present disclosure;

[0056] Figure 8 A schematic diagram of the dissolution of a liquid material with thickness according to an embodiment of the present disclosure;

[0057] Figure 9 A schematic structural diagram of a liquid material dissolving device provided in an embodiment of the present disclosure;

[0058] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0059] To make the objectives, technical solutions, and advantages of the present disclosure more clearly understood, the principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0060] According to an embodiment of the present disclosure, a method, device, electronic device, and storage medium for dissolving a liquid material are proposed.

[0061] It should be understood herein that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.

[0062] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.

[0063] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application.

[0064] In related technologies, when achieving a dissolving effect with a liquid material having a certain thickness, the performance is greatly affected.

[0065] The inventors of this disclosure discovered that the significant performance impact of the aforementioned related techniques is due to the fact that, in these techniques, intrinsic colors and normals are rendered separately as sequential frames (sequential frames: a moving video is represented by image files frame by frame), and then the sequential frames are played through a material to achieve a thick dissolving effect of a liquid material. To make the dissolving effect appear smooth and realistic, this implementation requires a large number of intermediate frames. However, the more intermediate frames, the larger the image, and the larger the image, the greater the performance impact. Reducing the number of intermediate frames affects the smoothness of the dissolving effect.

[0066] In order to solve the above problems, this application provides a liquid material dissolution solution, which specifically includes:

[0067] Obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map; perform a smooth transition on the noise map through a smooth step function, and extract the grayscale value of the noise map after the smooth transition as the initial grayscale value; perform an offset reorganization on the noise map after the smooth transition, extract the grayscale value of the noise map after the offset reorganization as the offset grayscale value, and subtract the initial grayscale value from the offset grayscale value to obtain offset grayscale information; input the offset grayscale information into a texture sampler to obtain a dissolution effect normal map output by the texture sampler; merge the dissolution effect normal map with the original normal map of the target liquid material; and achieve dissolution of the target liquid material by controlling the smooth step function. The present disclosure does not require an intermediate frame, and thus can achieve dissolution of liquid material with thickness with minimal impact on performance.

[0068] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.

[0069] refer to Figure 1, which is a schematic diagram of an application scenario of the liquid material dissolution method provided in an embodiment of the present disclosure. The application scenario includes a terminal device 101, a server 102 and a data storage system 103. Among them, the terminal device 101, the server 102 and the data storage system 103 can be connected through a wired or wireless communication network. The terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices that can realize the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0070] The server 102 is used to provide liquid material dissolution service to the user of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102. The user can input the liquid material and thickness parameters to be dissolved through the client. After clicking the OK button, the client sends the liquid material and thickness parameters to the server 102. The server 102 uses the liquid material to be dissolved as the target liquid material, obtains a noise map with the same size as the target liquid material, and associates the transparency of the target liquid material with the grayscale value of the noise map; the noise map is smoothed by a step function. The image is smoothed, and the grayscale value of the noise map after the smooth transition is extracted as the initial grayscale value; the noise map after the smooth transition is offset and reorganized, and the grayscale value of the noise map after the offset and reorganization is extracted as the offset grayscale value, and the initial grayscale value is subtracted from the offset grayscale value to obtain the offset grayscale information; the offset grayscale information is input into the texture sampler (the thickness parameter acts on this) to obtain the dissolution effect normal map output by the texture sampler; the dissolution effect normal map is merged with the original normal map of the target liquid material; and the dissolution of the target liquid material is achieved by controlling the smooth step function.

[0071] The data storage system 103 is used to store data.

[0072] The following combination Figure 1 The liquid material dissolution scheme according to the exemplary embodiment of the present disclosure is described with reference to the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0073] refer to Figure 2, which is a flow chart of the liquid material dissolution method provided in an embodiment of the present disclosure.

[0074] The method for dissolving a liquid material comprises the following steps:

[0075] Step S210 : Obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map.

[0076] Among them, liquid material is a material and noise map is a map.

[0077] In computer graphics (CG), materials contain maps, which in turn contain textures. Textures are the most basic unit of data input, used to map textures onto 3D surfaces using UV coordinates. Maps also contain other information beyond textures, such as UV coordinates and texture input and output controls. U and V represent the horizontal and vertical axes of 2D space, as X, Y, and Z are already used in 3D space. A material is a data set whose primary function is to provide data and lighting algorithms to the renderer. Textures are part of this data set, and depending on their purpose, they are categorized into different types, such as diffuse, specular, normal, and gloss maps.

[0078] refer to Figure 3 , which is a schematic diagram of a liquid material provided according to an embodiment of the present disclosure. The light-colored portion is the liquid portion, and the dark-colored portion is the background. As the liquid dissolves, the light-colored portion gradually disappears. The essence of this is to make some pixels appear while others disappear.

[0079] refer to Figure 4 , which is a schematic diagram of a noise map provided according to an embodiment of the present disclosure. A noise map is a black-and-white map, consisting of only two colors: black and white. The degree of blackness or whiteness of each pixel in the noise map can be represented by a value between 0 and 1, which can be called a grayscale value.

[0080] In some exemplary embodiments, the noise map may be randomly generated, wherein the grayscale value of each pixel is a random number between 0 and 1, and each random number is discrete and has no relationship with each other.

[0081] In some exemplary embodiments, a noise map can be generated by setting a continuous process, i.e., interpolation, to fill gaps between discrete data using interpolation functions to create a natural continuity. Interpolation functions can include trigonometric functions, normal distributions, spline curves, and the like.

[0082] refer to Figure 5 , which is a schematic diagram of the liquid material being dissolved without thickness according to an embodiment of the present disclosure.

[0083] In some exemplary embodiments, associating the transparency of the target liquid material with the grayscale value of the noise map includes:

[0084] For a pixel point in the target liquid material, the transparency value of the pixel point is set to the grayscale value of the pixel point corresponding to the position coordinate of the pixel point in the noise map.

[0085] Liquid materials have a transparency property. When the transparency is 0, it is completely transparent and invisible (dissolved), and when the transparency is 1, it is completely opaque (not dissolved). The grayscale value of the noise map is associated with the transparency of the liquid material, so that the transparency value of each pixel in the liquid material is the grayscale value of the pixel corresponding to the position coordinate of the pixel in the noise map, and the connection between the liquid material and the noise map is established. The transparency of the liquid material is controlled by controlling the grayscale value of the noise map, and the dissolution effect of the liquid material is achieved. Specifically, the grayscale value is gradually reduced, and the transparency gradually becomes 0, and each pixel gradually becomes transparent and invisible, until the transparency is 0, each pixel is completely transparent and invisible, showing the effect of complete liquid dissolution.

[0086] Different dissolving effects can be achieved by using different noise maps. The liquid can be dissolved randomly according to the randomly generated noise map, or it can be dissolved according to the set rules based on the noise map generated by the setting.

[0087] By controlling the noise map to achieve the liquid dissolving effect, the frame rate does not need to be considered, and the dissolving of liquid materials can be achieved with minimal impact on performance. However, it lacks the representation of liquid thickness, and the effect is flat and not three-dimensional, and the effect of liquid thickness cannot be reflected in the performance.

[0088] Step S220 : performing smooth transition processing on the noise map using a smooth step function, and extracting the grayscale value of the noise map after the smooth transition as the initial grayscale value.

[0089] In some exemplary embodiments, the smooth step function includes a maximum parameter and a minimum parameter;

[0090] The noise map is smoothly transitioned by a smooth step function, including:

[0091] For a pixel point in the noise map, in response to determining that the grayscale value of the pixel point is greater than the maximum value parameter, the grayscale value of the pixel point is set to the maximum grayscale value; in response to determining that the grayscale value of the pixel point is less than the minimum value parameter, the grayscale value of the pixel point is set to the minimum grayscale value.

[0092] As an example, the maximum grayscale value is 1 and the minimum grayscale value is 0.

[0093] In specific implementation, by controlling the minimum value parameter of the smooth step function to gradually increase and the grayscale value to gradually decrease, the transparency gradually becomes 0, and each pixel gradually becomes transparent and invisible, until the transparency reaches 0, each pixel is completely transparent and invisible, presenting the effect of complete dissolution of the liquid.

[0094] In some exemplary embodiments, the grayscale values of the noise map are extracted by a texture sampler.

[0095] The texture sampler can split the texture and obtain the grayscale value of the four RGBA channels, as well as the UV information of the texture. Among them, RGBA is a color space representing Red (red), Green (green), Blue (blue) and Alpha (opacity).

[0096] Step S230 , performing offset reorganization on the noise map after smooth transition, extracting the grayscale value of the noise map after offset reorganization as the offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain offset grayscale information.

[0097] refer to Figure 6 , which is a schematic diagram of offset grayscale information provided according to an embodiment of the present disclosure.

[0098] In some exemplary embodiments, the offset grayscale information includes first offset grayscale information and second offset grayscale information;

[0099] The noise map after smooth transition is offset and reorganized, and the grayscale value of the noise map after offset and reorganization is extracted as the offset grayscale value. The initial grayscale value is subtracted from the offset grayscale value to obtain the offset grayscale information, which specifically includes:

[0100] The noise map after the smooth transition is offset by a first preset distance along the horizontal axis, and the portion of the noise map that exceeds the original boundary after the offset is moved to the other side of the noise map to obtain a first offset noise map, and the grayscale value of the first offset noise map is extracted as a first offset grayscale value, and the initial grayscale value is subtracted from the first offset grayscale value to obtain first offset grayscale information;

[0101] The noise map after the smooth transition is offset by a second preset distance along the vertical axis direction, and the portion that exceeds the original boundary of the noise map after the offset is moved to the other side of the noise map to obtain a second offset noise map. The grayscale value of the second offset noise map is extracted as the second offset grayscale value, and the initial grayscale value is subtracted from the second offset grayscale value to obtain the second offset grayscale information.

[0102] In some exemplary embodiments, the first preset distance is equal to the second preset distance.

[0103] Among them, offset reconstruction refers to shifting the image by a defined number of pixels, moving any pixels outside the original image boundary to the other side of the image to fill the gaps created by the shifted image, so that no part of the image is lost.

[0104] Step S240: Input the offset grayscale information into the texture sampler to obtain a dissolve effect normal map output by the texture sampler.

[0105] refer to Figure 7 , which is a schematic diagram of an offset grayscale information input texture sampler provided according to an embodiment of the present disclosure.

[0106] In some exemplary embodiments, the texture sampler includes an r channel, a g channel, and a b channel;

[0107] Input the offset grayscale information into the texture sampler to obtain the dissolve effect normal map output by the texture sampler, specifically including:

[0108] Input the first offset grayscale information into the r channel of the texture sampler;

[0109] Input the second offset grayscale information into the g channel of the texture sampler;

[0110] The first offset grayscale information and the second offset grayscale information are multiplied by the thickness parameter respectively and then input into the b channel of the texture sampler, and then cross-producted.

[0111] In some exemplary embodiments, by controlling the thickness parameter, the thickness of the dissolving edge of the target liquid material can be controlled.

[0112] In practice, the thickness parameter matches the thickness of the liquid material.

[0113] Step S250: Merge the dissolve effect normal map with the original normal map of the target liquid material.

[0114] In some exemplary embodiments, merging the dissolve effect normal map with the original normal map of the target liquid material includes:

[0115] Add one to the value of the r channel, the value of the g channel, and the value of the b channel of the original normal map as the first three-dimensional vector;

[0116] Multiply the value of the r channel of the dissolve effect normal map by negative one, the value of the g channel by negative one, and the value of the b channel as the second three-dimensional vector;

[0117] Perform a dot product of the first three-dimensional vector and the second three-dimensional vector to obtain a dot product value;

[0118] Multiply the dot product value by the first three-dimensional vector to obtain the first RGB value;

[0119] Add one to the value of the b channel of the original normal map and multiply it by the second three-dimensional vector to obtain the second RGB value;

[0120] Subtract the second RGB value from the first RGB value to achieve the fusion of the dissolve effect normal map and the original normal map.

[0121] Step S260 : dissolving the target liquid material by controlling the smooth step function.

[0122] In some exemplary embodiments, dissolution of the target liquid material is achieved by controlling a smooth step function, specifically including:

[0123] The dissolution of the target liquid material is achieved by gradually increasing the minimum value parameter of the smooth step function.

[0124] refer to Figure 8 , which is a schematic diagram of the dissolution of a liquid material band with thickness provided according to an embodiment of the present disclosure.

[0125] During specific implementation, the thickness of the dissolving edge of the target liquid material is controlled by controlling the thickness parameter; by gradually increasing the minimum value parameter of the smooth step function and gradually reducing the grayscale value, the transparency gradually becomes 0, and each pixel gradually becomes transparent and invisible, until the transparency reaches 0, each pixel is completely transparent and invisible, presenting the effect of complete dissolution of the liquid.

[0126] As can be seen from the foregoing, the liquid material dissolution method, device, electronic device, and storage medium provided by the embodiments of the present disclosure achieve a liquid dissolution effect by controlling the noise map, without considering the impact of frame rate, and can achieve liquid material dissolution with minimal impact on performance. Furthermore, by fusing the constructed dissolution effect normal map with the original normal map, it is possible to achieve liquid material dissolution with thickness.

[0127] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0128] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0129] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a liquid material dissolving device.

[0130] refer to Figure 9 , the liquid material dissolving device comprises:

[0131] The noise map association module 910 is configured to obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map.

[0132] The initial grayscale value acquisition module 920 is configured to perform a smooth transition process on the noise map using a smooth step function, and extract the grayscale value of the noise map after the smooth transition as the initial grayscale value.

[0133] The offset grayscale information acquisition module 930 is configured to perform offset reorganization on the noise map after the smooth transition, extract the grayscale value of the noise map after the offset reorganization as the offset grayscale value, and subtract the initial grayscale value from the offset grayscale value to obtain the offset grayscale information.

[0134] The dissolve effect normal map acquisition module 940 is configured to input the offset grayscale information into a texture sampler to obtain a dissolve effect normal map output by the texture sampler.

[0135] The normal map fusion module 950 is configured to fuse the dissolve effect normal map with the original normal map of the target liquid material.

[0136] The dissolution effect generating module 960 is configured to achieve the dissolution of the target liquid material by controlling the smooth step function.

[0137] In some exemplary embodiments, the noise map association module 910 is specifically configured to:

[0138] For a pixel point in the target liquid material, the transparency value of the pixel point is set to the grayscale value of the pixel point corresponding to the position coordinate of the pixel point in the noise map.

[0139] In some exemplary embodiments, the smooth step function includes a maximum value parameter and a minimum value parameter; the initial gray value acquisition module 920 is specifically configured to:

[0140] For a pixel point in the noise map, in response to determining that the grayscale value of the pixel point is greater than the maximum value parameter, the grayscale value of the pixel point is set to the maximum grayscale value; in response to determining that the grayscale value of the pixel point is less than the minimum value parameter, the grayscale value of the pixel point is set to the minimum grayscale value.

[0141] In some exemplary embodiments, the offset grayscale information includes first offset grayscale information and second offset grayscale information; the offset grayscale information acquisition module 930 is specifically configured to:

[0142] offsetting the noise map after the smooth transition by a first preset distance along the horizontal axis, moving the portion of the noise map that exceeds the original boundary after the offset to the other side of the noise map to obtain a first offset noise map, extracting a grayscale value of the first offset noise map as a first offset grayscale value, and subtracting the initial grayscale value from the first offset grayscale value to obtain the first offset grayscale information;

[0143] The noise map after the smooth transition is offset by a second preset distance along the vertical axis direction, and the portion that exceeds the original boundary of the noise map after the offset is moved to the other side of the noise map to obtain a second offset noise map, and the grayscale value of the second offset noise map is extracted as the second offset grayscale value. The initial grayscale value is subtracted from the second offset grayscale value to obtain the second offset grayscale information.

[0144] In some exemplary embodiments, the first preset distance is equal to the second preset distance.

[0145] In some exemplary embodiments, the texture sampler includes an r channel, a g channel, and a b channel; the dissolve effect normal map acquisition module 940 is specifically configured to:

[0146] Inputting the first offset grayscale information into the r channel of the texture sampler;

[0147] Inputting the second offset grayscale information into the g channel of the texture sampler;

[0148] The first offset grayscale information and the second offset grayscale information are respectively multiplied by a thickness parameter and input into the b channel of the texture sampler, and then cross-multiplied.

[0149] In some exemplary embodiments, by controlling the thickness parameter, the thickness of the dissolving edge of the target liquid material can be controlled.

[0150] In some exemplary embodiments, the normal map fusion module 950 is specifically configured to:

[0151] Add one to the value of the r channel, the value of the g channel, and the value of the b channel of the original normal map as a first three-dimensional vector;

[0152] Multiply the value of the r channel of the dissolve effect normal map by negative one, the value of the g channel by negative one, and the value of the b channel as the second three-dimensional vector;

[0153] Performing a dot product of the first three-dimensional vector and the second three-dimensional vector to obtain a dot product value;

[0154] Multiplying the dot product value by the first three-dimensional vector to obtain a first RGB value;

[0155] Add one to the value of the b channel of the original normal map and multiply the result by the second three-dimensional vector to obtain a second RGB value;

[0156] The second RGB value is subtracted from the first RGB value to achieve fusion of the dissolve effect normal map and the original normal map.

[0157] In some exemplary embodiments, the dissolve effect generation module 960 is specifically configured to:

[0158] The dissolution of the target liquid material is achieved by gradually increasing the minimum value parameter of the smooth step function.

[0159] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0160] The device of the above embodiment is used to implement the corresponding liquid material dissolution method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0161] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the liquid material dissolving method described in any of the above embodiments is implemented.

[0162] Figure 10 10 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.

[0163] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0164] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0165] The input / output interface 1030 is used to connect an input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0166] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).

[0167] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0168] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0169] The electronic device of the above embodiment is used to implement the corresponding liquid material dissolving method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0170] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the liquid material dissolution method described in any of the above embodiments.

[0171] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid-state drives (SSDs)), etc.

[0172] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the liquid material dissolution method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0173] Those skilled in the art will appreciate that embodiments of the present invention may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present invention may also be implemented in the form of a computer program product in one or more computer-readable media containing computer-readable program code.

[0174] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive examples) of computer-readable storage media can include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0175] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0176] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

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

[0178] It should be understood that each block in the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine. These computer program instructions are executed by the computer or other programmable data processing device to produce a device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0179] These computer program instructions can also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner. In this way, the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0180] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0181] Furthermore, although the operations of the present method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the operations shown must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.

[0182] The use of the verbs "comprise", "include" and their conjugations in the application documents does not exclude the presence of elements or steps other than those stated in the application documents. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.

[0183] Although the spirit and principles of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined to benefit. Such division is merely for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims

1. A method for dissolving a liquid material, comprising: Obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map; Performing a smooth transition process on the noise map using a smooth step function, and extracting a grayscale value of the noise map after the smooth transition as an initial grayscale value; Performing offset reorganization on the noise map after the smooth transition, extracting the grayscale value of the noise map after the offset reorganization as an offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain offset grayscale information; Inputting the offset grayscale information into a texture sampler to obtain a dissolve effect normal map output by the texture sampler; wherein the offset grayscale information includes first offset grayscale information and second offset grayscale information, and the texture sampler includes an r channel, a g channel, and a b channel. Then, inputting the offset grayscale information into the texture sampler to obtain the dissolve effect normal map output by the texture sampler specifically includes: inputting the first offset grayscale information into the r channel of the texture sampler; inputting the second offset grayscale information into the g channel of the texture sampler; multiplying the first offset grayscale information and the second offset grayscale information by a thickness parameter respectively, and then inputting the resultant information into the b channel of the texture sampler, and performing a cross product. Merging the dissolve effect normal map with the original normal map of the target liquid material; The dissolution of the target liquid material is achieved by controlling the smooth step function.

2. The method according to claim 1, wherein The transparency of the target liquid material is the transparency of the pixels in the target liquid material; the grayscale value of the noise map is the grayscale value of the pixels in the noise map; The associating the transparency of the target liquid material with the grayscale value of the noise map specifically includes: For a pixel point in the target liquid material, the transparency value of the pixel point is set to the grayscale value of the pixel point corresponding to the position coordinate of the pixel point in the noise map.

3. The method according to claim 1, wherein The smooth step function includes a maximum value parameter and a minimum value parameter; The smooth transition processing of the noise map by using a smooth step function specifically includes: For a pixel point in the noise map, in response to determining that the grayscale value of the pixel point is greater than the maximum value parameter, the grayscale value of the pixel point is set to the maximum grayscale value; in response to determining that the grayscale value of the pixel point is less than the minimum value parameter, the grayscale value of the pixel point is set to the minimum grayscale value.

4. The method according to claim 1, wherein The offset reorganization of the noise map after the smooth transition, extracting the grayscale value of the noise map after the offset reorganization as the offset grayscale value, and subtracting the initial grayscale value from the offset grayscale value to obtain the offset grayscale information specifically includes: offsetting the noise map after the smooth transition by a first preset distance along the horizontal axis, moving the portion of the noise map that exceeds the original boundary after the offset to the other side of the noise map to obtain a first offset noise map, extracting a grayscale value of the first offset noise map as a first offset grayscale value, and subtracting the initial grayscale value from the first offset grayscale value to obtain the first offset grayscale information; The noise map after the smooth transition is offset by a second preset distance along the vertical axis direction, and the portion that exceeds the original boundary of the noise map after the offset is moved to the other side of the noise map to obtain a second offset noise map, and the grayscale value of the second offset noise map is extracted as the second offset grayscale value. The initial grayscale value is subtracted from the second offset grayscale value to obtain the second offset grayscale information.

5. The method according to claim 4, wherein The first preset distance is equal to the second preset distance.

6. The method according to claim 1, wherein By controlling the thickness parameter, the thickness of the dissolving edge of the target liquid material can be controlled.

7. The method according to claim 1, wherein The fusing of the dissolving effect normal map with the original normal map of the target liquid material specifically includes: Add one to the value of the r channel, the value of the g channel, and the value of the b channel of the original normal map as a first three-dimensional vector; Multiply the value of the r channel of the dissolve effect normal map by negative one, the value of the g channel by negative one, and the value of the b channel as the second three-dimensional vector; Performing a dot product of the first three-dimensional vector and the second three-dimensional vector to obtain a dot product value; Multiplying the dot product value by the first three-dimensional vector to obtain a first RGB value; Add one to the value of the b channel of the original normal map and multiply the result by the second three-dimensional vector to obtain a second RGB value; The second RGB value is subtracted from the first RGB value to achieve fusion of the dissolve effect normal map and the original normal map.

8. The method according to claim 3, wherein: The dissolution of the target liquid material is achieved by controlling the smooth step function, specifically including: The dissolution of the target liquid material is achieved by controlling the minimum parameter of the smooth step function to gradually increase.

9. A liquid material dissolving device, comprising: a noise map associating module configured to obtain a target liquid material and a noise map of the same size as the target liquid material, and associate the transparency of the target liquid material with the grayscale value of the noise map; an initial grayscale value acquisition module configured to perform a smooth transition process on the noise map using a smooth step function, and extract the grayscale value of the noise map after the smooth transition as the initial grayscale value; an offset grayscale information acquisition module configured to perform offset reorganization on the noise map after the smooth transition, extract the grayscale value of the noise map after the offset reorganization as an offset grayscale value, and subtract the initial grayscale value from the offset grayscale value to obtain offset grayscale information; A dissolve effect normal map acquisition module is configured to input the offset grayscale information into a texture sampler to obtain a dissolve effect normal map output by the texture sampler; wherein the offset grayscale information includes first offset grayscale information and second offset grayscale information, and the texture sampler includes an r channel, a g channel, and a b channel. Then, the dissolve effect normal map acquisition module is specifically configured to: input the first offset grayscale information into the r channel of the texture sampler; input the second offset grayscale information into the g channel of the texture sampler; multiply the first offset grayscale information and the second offset grayscale information by a thickness parameter respectively, and then input them into the b channel of the texture sampler, and perform a cross product; a normal map fusion module configured to fuse the dissolve effect normal map with the original normal map of the target liquid material; The dissolution effect generating module is configured to achieve the dissolution of the target liquid material by controlling the smooth step function.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program. 11 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to cause a computer to execute the method according to claim 1 .

Citation Information

Patent Citations

  • Water body interactive mapping method and system

    CN112435304A