Spraying effect rendering method and device, equipment and storage medium
Patent Information
- Application Number
- CN202211530581.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-11-30
AI Technical Summary
[0003]本发明的主要目的在于解决现有对虚拟对象的喷涂方法存在喷涂过程较为复杂的技术问题
[0008]本发明提供的技术方案中,通过自定义可着色的指向性的喷涂粒子,可以根据设置的颜色和运动信息,来设置喷涂粒子的着色颜色和指向性运动,然后按照属性变化策略来实时调整颜色设置信息和运动设置信息的变化过程,以此配置喷涂粒子随着变化过程的喷涂动画效果,简化了模拟喷涂粒子喷涂到目标对象上的流程制作,提升计算性能,并且能够方便的控制喷涂末端的指向和位置。通过颜色与目标对象的纹理混方式合来实现喷涂在目标对象上时的颜色过渡效果,显得喷涂效果更为自然,最终通过自动抽样覆盖检测来确定是否完成对目标对象的喷涂,以执行对目标对象的喷涂效果渲染,降低由美术和策划进行检测引起的检测繁琐程度。
Smart Images

Figure CN116385573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game technology, and in particular to a method, apparatus, device, and storage medium for rendering spray painting effects. Background Technology
[0002] With the development of image processing technology, the gaming industry has also implemented display effects for spraying virtual objects. The implementation of this type of image processing technology includes particle effects, spraying, and coverage detection. Particle features are often achieved by simulating gravity fields and radial motion. The spraying process directly uses grayscale images and player-modified colors for fusion. Coverage detection after spraying is based on point set coverage detection algorithms. Specifically, within the effective pixels of the original texture, points of a pre-set reasonable density are selected; when the spraying operation covers all points, the spraying is considered complete. However, in the above implementation, the position of the particle ends is difficult to control, making it inconvenient to achieve spraying effects like a spray bottle. The spraying process only involves mixing grayscale images and colors, resulting in a relatively simple form of expression. The most tedious and crucial step in the point set coverage detection algorithm is marking the point set, a step mostly done by artists and designers, requiring manual marking and making the workload quite cumbersome. In summary, existing methods for spraying virtual objects suffer from a complex spraying process. Summary of the Invention
[0003] The main objective of this invention is to solve the technical problem that existing methods for spraying virtual objects have a relatively complex spraying process.
[0004] The first aspect of the present invention provides a method for rendering a spraying effect, comprising: acquiring color setting information and motion setting information of spraying particles; configuring a spraying animation effect of the spraying particles according to the color setting information and the motion setting information and a preset attribute change strategy; performing texture blending of the color setting information and a target object according to the motion setting information to obtain rendering information of the target object; performing coverage detection on the rendering information and the target object to obtain a detection result, and performing a rendering operation on the target object using the spraying animation effect and the rendering information based on the detection result to obtain a spraying rendering result.
[0005] A second aspect of the present invention provides a rendering apparatus for spray painting effects, comprising: an acquisition module for acquiring color setting information and motion setting information of spray painting particles; a configuration module for configuring a spray painting animation effect of the spray painting particles according to the color setting information and the motion setting information and a preset attribute change strategy; a mixing module for performing texture mixing of the color setting information and a target object according to the motion setting information to obtain rendering information of the target object; and a rendering module for performing coverage detection on the rendering information and the target object, obtaining a detection result, and performing a rendering operation on the target object using the spray painting animation effect and the rendering information based on the detection result to obtain a spray painting rendering result.
[0006] A third aspect of the present invention provides a rendering device for spray painting effects, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the rendering device for spray painting effects to execute the above-described rendering method for spray painting effects.
[0007] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described method for rendering spraying effects.
[0008] The technical solution provided by this invention uses customizable, colorable, directional spray particles. Based on set color and motion information, the color and directional movement of the spray particles can be configured. Then, according to an attribute change strategy, the color and motion settings are adjusted in real time to configure the spray animation effect as the particles change. This simplifies the process of simulating spray particles being sprayed onto a target object, improves computational performance, and allows for convenient control of the direction and position of the spray tip. A color transition effect is achieved by blending the color with the texture of the target object, resulting in a more natural spray effect. Finally, automatic sampling and coverage detection determines whether the spraying of the target object is complete, and the spray effect rendering is performed, reducing the tediousness of detection caused by art and design personnel. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the first embodiment of the rendering method for spraying effect in the present invention;
[0010] Figure 2 This is a schematic diagram of a second embodiment of the method for rendering the spraying effect in this invention.
[0011] Figure 3 This is a schematic diagram of one embodiment of the rendering device for spraying effect in the present invention;
[0012] Figure 4 This is a schematic diagram of another embodiment of the rendering device for spraying effect in the present invention;
[0013] Figure 5 This is a schematic diagram of an embodiment of a rendering device for spraying effects in this invention. Detailed Implementation
[0014] This invention provides a method, apparatus, device, and storage medium for rendering spray painting effects. The method involves acquiring color and motion settings information for sprayed particles; configuring spray painting animation effects for the particles according to a preset attribute change strategy based on the color and motion settings information; blending the color settings information with the target object's texture based on the motion settings information to obtain the target object's rendering information; performing coverage detection on the rendering information and the target object to obtain detection results; and based on the detection results, performing rendering operations on the target object using the spray painting animation effects and the rendering information to obtain the spray painting rendering result. This invention simplifies the production process of particle spray painting animations and the detection process of spray painting coverage objects, reducing the difficulty of creating object spray painting effects.
[0015] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the method for rendering the spraying effect in this invention includes:
[0017] 101. Obtain the color setting information and motion setting information of the sprayed particles;
[0018] It is understood that the executing entity of this invention can be a rendering device for spraying effects, or it can be a terminal or a server; no specific limitation is made here. This embodiment of the invention will be described using a terminal device as an example.
[0019] In this embodiment, the sprayed particles are colorable. The terminal device retrieves the color that needs to be adjusted for the target object and blends it with the initial texture setting of the sprayed particles to obtain the color displayed when the particles are sprayed. Specifically, the adjusted color `blenColor.rgb` is blended with the Alpha value of the initial texture setting of the sprayed particles to obtain the color `Color.rgb` displayed when the particles are sprayed: `Color.rgb = blenColor.rgb * color.a`. Here, the color setting information refers to the custom / initial color settings for different motion states of the sprayed particles, including at least the color displayed when the particles are sprayed and the colors that change subsequently according to the settings.
[0020] In this embodiment, the sprayed particles also have directionality. The terminal device sets the spraying direction and position of the sprayed particles according to the spraying direction and end position of the spraying tool, so that the sprayed particles can move according to the spraying direction and position, ultimately causing the sprayed particles to adhere to the end position to be sprayed. Here, the motion setting information refers to the custom / initial settings of the motion state of the sprayed particles, including at least the spraying direction and position, and the initial position of the spraying tool.
[0021] 102. Based on the color setting information and the motion setting information, configure the spraying animation effect of the spraying particles according to the preset attribute change strategy;
[0022] In this embodiment, to simulate the effect of a spraying tool applying spray particles to a target object, a pre-set attribute change strategy is used to process the color and motion settings. This simulates the color and motion changes of the spray particles during the overall display effect of the spraying process, and then displays the simulation. Furthermore, the spraying animation effect configured here refers to the process of spray particles being ejected from the spraying tool, adhering to the target object, and disappearing from view.
[0023] Specifically, for example, when the spray particles are close to the end of the spraying tool (the front of the spraying process), the spray particles are more concentrated, and the overall effect of the spray particles is that the pigment is more concentrated, resulting in a darker spray color, a smaller spray volume, and a movement trajectory that is closer to the line connecting to the target object. However, when the spray particles are close to the end of the spray particles (the back of the spraying process), the overall effect of the spray particles is that the pigment is more dispersed, resulting in a lighter spray color, a larger spray volume, and a movement trajectory that is further away from the line connecting to the target object.
[0024] Specifically, this can be achieved by distinguishing the different motion states of the sprayed particles during the spraying process and setting the attribute changes of the sprayed particles for each motion state. In one example, the process of the sprayed particles leaving the spraying tool and contacting the target object can be defined as the active state, while the static process of the spraying process attaching to the target object and disappearing can be defined as the disappearing state. In the active state, the color transparency of the sprayed particles can be configured to gradually increase to simulate a gradual lightening of the color, and the scaling factor of the sprayed particles can be configured to gradually decrease to simulate a gradual shrinking of the volume. The movement curve of the sprayed particles from the spraying tool and the target object can also be configured. In the static state, since the sprayed particles are no longer active and are attached to the target object, it is only necessary to gradually increase the color transparency until it reaches 0 to simulate the gradual disappearance of the sprayed particles, and gradually increase the scaling factor to simulate the diffusion effect of the sprayed particles in the target object.
[0025] 103. Based on the motion settings information, the color settings information is mixed with the target object to obtain the rendering information of the target object;
[0026] In this embodiment, the preceding spraying animation simulated the dynamic process of spray particles being applied to the target object and disappearing. Here, rendering information is used to simulate the process of the target object receiving the spray particles, the color of which mixes with the color of the spray particles to achieve a color transition, and the final color used to display the spray. Here, motion settings determine the range of the spray particles on the target object, and color settings determine the color sprayed on the target object. The combination of these two determines the effect after spraying the target object.
[0027] Specifically, by using motion settings information, the spraying position of the sprayed particles is determined to define the spraying area. The spraying area and the target object area may differ, but they are usually completely covered. The color settings information is then blended with the target object's texture to change the display color of the target object and obtain its rendering information.
[0028] 104. Perform coverage detection on the rendering information and the target object to obtain the detection result, and based on the detection result, perform a rendering operation on the target object using the spraying animation effect and the rendering information to obtain the spraying rendering result.
[0029] In this embodiment, after configuring the spraying animation effect of the sprayed particles and the rendering information of the target object, it is necessary to determine whether the sprayed area in the rendering information completely covers the target object. If it does not completely cover the target object, the rendering effect will not be realistic enough. Therefore, here the coverage detection is used to determine whether the rendering information completely covers the target object, then the rendering operation on the target object is performed, and the spraying rendering result is displayed on the display interface.
[0030] Specifically, to reduce the difficulty of coverage detection, the manual annotation of the pixels of the sprayed area and the target object is replaced by an automated method to identify the pixels of the sprayed area and the target object. At the same time, to improve the efficiency of coverage detection, instead of comparing the sprayed area and the target object pixel by pixel in each frame, a portion of pixels are randomly selected to compare the sprayed area and the target object to determine whether the sprayed area approximately covers the entire area of the target object, thus confirming that the spraying of the target object is complete in the rendering information.
[0031] In this embodiment of the invention, by using customizable colorable directional spray particles, the color and directional movement of the spray particles can be set according to the set color and motion information. Then, the color and motion settings are adjusted in real time according to the attribute change strategy, thereby configuring the spray animation effect of the spray particles as they change. This simplifies the process of simulating the spray particles spraying onto the target object, improves computing performance, and allows for convenient control of the direction and position of the spray tip. The color transition effect when spraying onto the target object is achieved by blending the color with the texture of the target object, making the spray effect appear more natural. Finally, automatic sampling coverage detection is used to determine whether the spraying of the target object is complete, and the spray effect rendering of the target object is performed, reducing the tediousness of detection caused by art and design personnel.
[0032] Please see Figure 2 A second embodiment of the rendering method for spraying effects in this invention includes:
[0033] 201. Obtain the color setting information and motion setting information of the sprayed particles;
[0034] 202. Based on the motion setting information, calculate the various time intervals of the sprayed particles in different motion states;
[0035] In this embodiment, by using motion setting information, the motion states of the sprayed particles during the spraying process can be determined, that is, the various motion states of the sprayed particles as they are ejected from the nozzle of the spraying tool, adhere to the target object, and gradually disappear from the target object. Then, the time interval with time sequence in which they are located can be calculated based on the activity process of different motion states.
[0036] In one example, the initial position, spraying position, and spraying direction of the sprayed particles are extracted from the motion setting information; the movement time of the sprayed particles from the initial position to the spraying position is calculated according to the spraying direction to obtain a first time interval of the sprayed particles in the active state; the first time interval is superimposed according to a preset disappearance time to obtain a second time interval of the sprayed particles in the disappearance state, and the time interval includes the first time interval and the second time interval.
[0037] Specifically, based on the initial position (startPos), spraying position (endPos), and spraying direction V of the sprayed particles in the motion settings information, the trajectory of the sprayed particles from the initial position to the spraying position is simulated according to the spraying direction. Based on the trajectory length and the set motion speed, the time t1 required for the sprayed particles to move from the initial position to the spraying position is calculated, and then [0, t1] is used as the first time interval.
[0038] Meanwhile, the disappearance time t0 of the sprayed particles is preset. The sprayed particles remain unchanged after adhering to the spraying position at time t1. The hourly duration t0 of the "flower-scattering girl" is superimposed on t1 to obtain the time sequence t2 = t1 + t0 of the sprayed particles in the hourly state. Then, [t1, t2] is used as the second time interval.
[0039] 203. Based on the color setting information and the motion setting information, and according to the preset attribute change strategy, configure the state parameter change information of the sprayed particles in each time interval;
[0040] 204. Based on the state parameter change information, generate the spraying animation effect of the sprayed particles;
[0041] In this embodiment, during the process from when the sprayed particles are sprayed out of the spraying tool until they disappear, the state parameter change information is configured by adjusting the color setting information and motion setting information of the sprayed particles according to the attribute change strategy, so as to generate a spraying animation effect and simulate the dynamic display of the state of the sprayed particles in different motion states within the time interval.
[0042] In one embodiment, by identifying the color parameters of the sprayed particles in different motion states in the color setting information, and identifying the position parameters of the sprayed particles in different motion states in the motion setting information; according to a preset attribute change strategy, gradient interpolation processing is performed between each color parameter and between each position parameter to obtain the state parameter change information of the sprayed particles in the corresponding time interval.
[0043] Specifically, the color settings information can include the starting color parameter MColor in the active state and the starting color parameter QColor in the static state. Position parameters include the starting position startPos of the sprayed particles in the active state and the starting position endPos in the static state. It also includes the starting scaling factor startScale of the sprayed particles in the active state at different positions, and the starting scaling factor endScale and ending scaling factor DisScale in the static state. Specifically, the parameter change curve of ease can be used as the attribute change strategy to perform gradient interpolation processing for each color and position parameter separately.
[0044] For example, MColor and QColor can be used as the starting and ending values of the ease parameter change curve, respectively, for interpolation to obtain the color change curve of the sprayed particles in the active state; QColor and 0 can be used as the starting and ending values of the ease parameter change curve, respectively, for interpolation to obtain the color change curve of the sprayed particles in the inactive state. Specifically, MColor and QColor use alpha values, that is, interpolating the transparency value of the sprayed particles to obtain the transparency change curve of the sprayed particles.
[0045] Simultaneously, startPos and endPos can be used as the starting and ending values of the ease parameter change curve, respectively, for interpolation to obtain the position change curve of the sprayed particles in the active state. Similarly, startScale and endScale can be used as the starting and ending values of the ease parameter change curve, respectively, for interpolation to obtain the size change curve of the sprayed particles in the active state. Furthermore, endScale and DisScale can be used as the starting and ending values of the ease parameter change curve, respectively, for interpolation to obtain the size change curve of the sprayed particles in the stationary state.
[0046] In addition, by setting Scale1≥startScale to limit the maximum size of the spray particles sprayed from the spraying tool; by setting scale2≤endScale to limit the minimum size of the spray particles that finally attach to the target object; and by setting Scale3≥DisScale to limit the maximum visible size when the spray particles disappear, the final spraying animation effect is more realistic.
[0047] In addition, the rate of change of the properties of the ease parameter change curve can be specifically set through different functions as needed, such as easeInOutSine, easeInOutCubic, easeInOutQuad, easeInOutQuart, etc., and the state parameter change information can be configured according to the rate of change of properties.
[0048] 205. Extract the original color information of the target object, and determine the spraying range of the spraying particles in the rendering scene where the target object is located based on the motion setting information;
[0049] 206. The color setting information is mixed with the rendering scene within the spraying range to obtain the first rendering color of the target object, and the transparent and non-transparent textures within the spraying range are identified;
[0050] 207. Set the first rendering color to the color of the non-transparent texture and set the original color information to the color of the transparent texture to obtain the second rendering color for the target object;
[0051] 208. Perform color transition processing between the first rendering color and the second rendering color, and generate rendering information for the target object based on the processing result;
[0052] In this embodiment, the original color information color1 of the target object is extracted to determine the original displayed color of the target object. At the same time, based on the motion setting information of the sprayed particles, the spraying position of the sprayed particles in the rendering scene where the target object is located is determined, and the spraying range can be determined based on the spraying positions of all sprayed particles.
[0053] The specific color settings include the set color 'color2' for the sprayed particles. This set color is then blended (e.g., using an overlay method) with the scene texture of the spraying area to overlay the set color of the sprayed particles onto the spraying area. Within the spraying area, for non-transparent textures (pixel alpha value > 0), the set color of the sprayed particles is directly blended with the alpha value of that pixel to obtain the spray color 'targetColor' for that non-transparent texture; for transparent textures (pixel alpha value = 0), the color of that pixel is simply set to the original color 'color1'; the two are combined to form the second rendering color for the entire spraying area.
[0054] Specifically, by performing transition processing on the first and second rendering colors (such as linear interpolation), rendering information is obtained, making the color changes of the target object more smooth and less abrupt after rendering using the rendering information.
[0055] Additionally, for the original color information extracted from the target object, the grayscale color 'color1' can be extracted from this original color information. Then, linear light blending is performed on this grayscale color 'color1', and the resulting grayscale color is used as the new original color information 'boardColor'. Pre-configured color palettes can be used to perform linear light blending on this grayscale color, altering the original color display effect of the target object and simulating effects such as aging, further transitioning the color changes of the target object. Simultaneously, a noise texture is generated and added to the rendering range after the rendering information is processed, ensuring that the noise texture is not affected during the preceding rendering information processing.
[0056] 209. According to the preset distribution strategy, randomly select multiple sampling points from the target object, and determine in turn whether each sampling point is within the spraying range corresponding to the rendering information;
[0057] 210. If all the sampling points are within the spraying range, it is determined that the rendering information has covered the target object, and a detection result of the completion of spraying the target object is obtained. Based on the detection result, the spraying animation effect and the rendering information are used to perform a rendering operation on the target object to obtain a spraying rendering result.
[0058] In this embodiment, the entire spraying process is complete once the sprayed area D in the rendering information covers the visible pixel area E of the target object. However, determining whether the sprayed area D covers all visible pixels of the target object E is inefficient if the sprayed area and the visible pixel area of the target object are compared pixel-by-pixel per frame. The visible area F of the target object can be marked using a finite set of points. There must exist f∈E. When the point set is suitable, if the spraying range D contains a finite point set F, it can be approximately considered that the spraying is complete. Based on this principle, multiple pixels are randomly selected from the area where the target object is located to determine whether each selected pixel is within the spraying range of the rendering information, thereby determining whether the rendering information has covered the target object.
[0059] To improve the accuracy of the judgment, for the selection of each pixel in a limited set of points, each pixel can be defined to meet the following conditions: a. Each pixel is evenly distributed; b. The selected density is reasonable (too high a density will result in low judgment efficiency, and too low a density will result in low accuracy); c. The pixel is located at the edge of the visible pixel range of the target object (players are more sensitive to the spraying edge position. If there are unsprayed areas at the edge position, the presentation effect is not realistic enough).
[0060] Based on the above conditions, in one embodiment, the rendering scene where the target object is located can be divided into multiple grids with uniformly distributed density according to a preset distribution strategy; the edge grid where the target object is located is searched in each of the grids according to a preset orientation, and each searched edge spraying grid is used as a corresponding sampling point.
[0061] Specifically, after meshing the visible pixel area of the target object, the sampling density and uniform distribution of the sampled pixels can be set by adjusting the sampling step size (step). During implementation, the entire texture of the target object is first divided into n*m small square grids, each with a width of step. For each grid, the pixel coordinates of the edge positions are searched in a left-to-right, top-to-bottom (preset first orientation) order to represent the entire grid, and so on. Following the preset first orientation search order prioritizes the top-left points, resulting in uncovered pixels on the right and bottom edges. Therefore, separate point set coverage processing is added for the bottom and right edges (preset second orientation) to finally obtain all sampled points. The preset orientation includes the preset first orientation and the preset second orientation.
[0062] The rendering method for the spraying effect in the embodiments of the present invention has been described above. The rendering apparatus for the spraying effect in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 3 One embodiment of the rendering device for spraying effect in this invention includes:
[0063] The acquisition module 301 is used to acquire the color setting information and motion setting information of the sprayed particles;
[0064] Configuration module 302 is used to configure the spraying animation effect of the spraying particles according to the color setting information and the motion setting information and in accordance with a preset attribute change strategy.
[0065] The blending module 303 is used to blend the color setting information with the target object according to the motion setting information to obtain the rendering information of the target object;
[0066] The rendering module 304 is used to perform coverage detection on the rendering information and the target object, obtain the detection result, and perform a rendering operation on the target object based on the detection result using the spraying animation effect and the rendering information to obtain the spraying rendering result.
[0067] In this embodiment of the invention, by using customizable colorable directional spray particles, the color and directional movement of the spray particles can be set according to the set color and motion information. Then, the color and motion settings are adjusted in real time according to the attribute change strategy, thereby configuring the spray animation effect of the spray particles as they change. This simplifies the process of simulating the spray particles spraying onto the target object, improves computing performance, and allows for convenient control of the direction and position of the spray tip. The color transition effect when spraying onto the target object is achieved by blending the color with the texture of the target object, making the spray effect appear more natural. Finally, automatic sampling coverage detection is used to determine whether the spraying of the target object is complete, and the spray effect rendering of the target object is performed, reducing the tediousness of detection caused by art and design personnel.
[0068] Please see Figure 4 Another embodiment of the rendering device for spraying effect in this invention includes:
[0069] The acquisition module 301 is used to acquire the color setting information and motion setting information of the sprayed particles;
[0070] Configuration module 302 is used to configure the spraying animation effect of the spraying particles according to the color setting information and the motion setting information and in accordance with a preset attribute change strategy.
[0071] The blending module 303 is used to blend the color setting information with the target object according to the motion setting information to obtain the rendering information of the target object;
[0072] The rendering module 304 is used to perform coverage detection on the rendering information and the target object, obtain the detection result, and perform a rendering operation on the target object based on the detection result using the spraying animation effect and the rendering information to obtain the spraying rendering result.
[0073] Specifically, the configuration module 302 includes:
[0074] The calculation unit 3021 is used to calculate the time intervals of the sprayed particles in different motion states based on the motion setting information.
[0075] Configuration unit 3022 is used to configure the state parameter change information of the sprayed particles in each time interval according to the color setting information and the motion setting information and a preset attribute change strategy.
[0076] The generation unit 3023 is used to generate the spraying animation effect of the sprayed particles based on the state parameter change information.
[0077] Specifically, the configuration unit 3022 is further used for:
[0078] Identify the color parameters of the sprayed particles in different motion states in the color setting information, and identify the position parameters of the sprayed particles in different motion states in the motion setting information;
[0079] According to the preset attribute change strategy, gradient interpolation is performed between various color parameters and between various position parameters to obtain the state parameter change information of the sprayed particles in the corresponding time interval.
[0080] Specifically, the computing unit 3021 is also used for:
[0081] Extract the initial position, spraying position, and spraying direction of the sprayed particles from the motion setting information;
[0082] According to the spraying direction, the movement time of the sprayed particles from the initial position to the spraying position is calculated to obtain the first time interval of the sprayed particles in the active state;
[0083] The sprayed particles are superimposed on the first time interval according to a preset disappearance time to obtain a second time interval in the disappearance state, and the time interval includes the first time interval and the second time interval.
[0084] Specifically, the hybrid module 303 includes:
[0085] Extraction unit 3031 is used to extract the original color information of the target object, and to determine the spraying range of the spraying particles in the rendering scene where the target object is located based on the motion setting information;
[0086] The texture blending unit 3032 is used to blend the color setting information with the rendering scene within the spraying range to obtain a first rendering color for the target object, and to identify transparent and non-transparent textures within the spraying range.
[0087] Setting unit 3033 is used to set the first rendering color to the color of the non-transparent texture and the original color information to the color of the transparent texture to obtain a second rendering color for the target object;
[0088] The transition processing unit 3034 is used to perform color transition processing between the first rendering color and the second rendering color, and generate rendering information of the target object based on the processing result.
[0089] Specifically, the mixing module 303 further includes an optical mixing unit 3035, used for:
[0090] The original color information is linearly mixed, and the mixed original color information is used as the new original color information.
[0091] Specifically, the rendering module 304 includes:
[0092] The extraction unit 3041 is used to randomly extract multiple sampling points from the target object according to a preset distribution strategy, and sequentially determine whether each sampling point is within the spraying range corresponding to the rendering information.
[0093] The determining unit 3042 is used to determine that the rendering information has covered the target object if all the sampling points are within the spraying range, and to obtain a detection result that the spraying of the target object is completed.
[0094] Specifically, the extraction unit 3041 is also used for:
[0095] According to the preset distribution strategy, the rendering scene where the target object is located is divided into multiple grids with a uniform distribution of corresponding density.
[0096] The edge grid where the target object is located is searched in each of the grids according to the preset orientation, and each searched edge spraying grid is used as the corresponding sampling point.
[0097] above Figure 3 and Figure 4 The rendering device for spraying effect in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The rendering device for spraying effect in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0098] Figure 5 This is a schematic diagram of a spray painting effect rendering device 500 provided in an embodiment of the present invention. The spray painting effect rendering device 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the spray painting effect rendering device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the spray painting effect rendering device 500.
[0099] The rendering device 500 for spray painting effects may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The illustrated rendering device structure for the spraying effect does not constitute a limitation on the rendering device for the spraying effect. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0100] The present invention also provides a rendering device for spray painting effects. The computer device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the rendering method for spray painting effects described in the above embodiments.
[0101] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the rendering method for the spraying effect.
[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0103] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for rendering a spray painting effect, characterized in that, The rendering method for the spraying effect includes: Obtain the color setting information and motion setting information of the sprayed particles; Based on the color setting information and the motion setting information, and according to the preset attribute change strategy, configure the spraying animation effect of the spraying particles; Based on the motion settings information, the color settings information is blended with the target object to obtain the rendering information of the target object; The coverage detection of the rendering information and the target object is performed to obtain the detection result. Based on the detection result, the rendering operation is performed on the target object using the spraying animation effect and the rendering information to obtain the spraying rendering result. The step of configuring the spraying animation effect of the spraying particles according to the color setting information and the motion setting information, and in accordance with a preset attribute change strategy, includes: Extract the initial position, spraying position, and spraying direction of the sprayed particles from the motion setting information; calculate the movement time of the sprayed particles from the initial position to the spraying position according to the spraying direction to obtain the first time interval of the sprayed particles in the active state; The sprayed particles are superimposed on the first time interval according to a preset disappearance time to obtain a second time interval in the disappearance state, wherein the time interval includes the first time interval and the second time interval; the sprayed particles are attached to the target object during the second time interval.
2. The method for rendering spray coating effects according to claim 1, characterized in that, The step of configuring the state parameter change information of the sprayed particles in each time interval according to the color setting information and the motion setting information and in accordance with the preset attribute change strategy includes: Identify the color parameters of the sprayed particles in different motion states in the color setting information, and identify the position parameters of the sprayed particles in different motion states in the motion setting information; According to the preset attribute change strategy, gradient interpolation is performed between various color parameters and between various position parameters to obtain the state parameter change information of the sprayed particles in the corresponding time interval.
3. The method for rendering spray coating effects according to claim 1, characterized in that, The step of blending the color settings with the target object based on the motion settings to obtain the rendering information of the target object includes: Extract the original color information of the target object, and determine the spraying range of the spraying particles in the rendering scene where the target object is located based on the motion setting information; The color setting information is mixed with the rendering scene within the spraying range to obtain the first rendering color of the target object, and transparent and non-transparent textures within the spraying range are identified. The first rendering color is set to the color of the non-transparent texture, and the original color information is set to the color of the transparent texture to obtain the second rendering color for the target object; Perform color transition processing between the first rendering color and the second rendering color, and generate rendering information for the target object based on the processing result.
4. The method for rendering spray coating effects according to claim 3, characterized in that, After extracting the original color information of the target object, the method further includes: The original color information is linearly mixed, and the mixed original color information is used as the new original color information.
5. The method for rendering the spraying effect according to any one of claims 1-4, characterized in that, The detection results obtained by the overlay detection of the rendering information and the target object include: According to a preset distribution strategy, multiple sampling points are randomly selected from the target object, and it is determined in turn whether each sampling point is within the spraying range corresponding to the rendering information. If all the sampling points are within the spraying range, it is determined that the rendering information has covered the target object, and a detection result indicating that the spraying of the target object is complete is obtained.
6. The method for rendering spray coating effects according to claim 5, characterized in that, The step of randomly selecting multiple sampling points from the target object according to a preset distribution strategy includes: According to the preset distribution strategy, the rendering scene where the target object is located is divided into multiple grids with a uniform distribution of corresponding density. The edge grid where the target object is located is searched in each of the grids according to the preset orientation, and each searched edge spraying grid is used as the corresponding sampling point.
7. A rendering device for spray painting effects, characterized in that, The rendering device for the spraying effect includes: The acquisition module is used to acquire the color setting information and motion setting information of the sprayed particles; The configuration module is used to configure the spraying animation effect of the sprayed particles according to the color setting information and the motion setting information, and according to a preset attribute change strategy. The blending module is used to blend the color settings with the target object based on the motion settings information to obtain the rendering information of the target object; The rendering module is used to perform coverage detection on the rendering information and the target object, obtain the detection result, and perform a rendering operation on the target object based on the detection result using the spraying animation effect and the rendering information to obtain the spraying rendering result; The configuration module is used to extract the initial position, spraying position, and spraying direction of the sprayed particles from the motion setting information; calculate the movement time of the sprayed particles from the initial position to the spraying position according to the spraying direction to obtain a first time interval of the sprayed particles in the active state; superimpose a preset disappearance time on the first time interval to obtain a second time interval of the sprayed particles in the disappearance state, wherein the time interval includes the first time interval and the second time interval; the sprayed particles are attached to the target object during the second time interval.
8. A rendering device for spray painting effects, characterized in that, The rendering device for the spraying effect includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the spraying effect rendering device to perform the steps of the spraying effect rendering method as described in any one of claims 1-6.
9. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the various steps of the rendering method for the spraying effect as described in any one of claims 1-6.
Citation Information
Patent Citations
Implementation method, medium and device for particle jet animation and computing equipment
CN110007983A