Object surface water flow rendering method and device, equipment and storage medium
Patent Information
- Application Number
- CN202211364813.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-11-02
AI Technical Summary
[0004]本发明的主要目的在于解决现有的游戏制作过程中雨天效果不真实的技术问题
[0017]上述物体表面流水渲染方法、装置、设备及存储介质,通过获取预设的雨点遮罩图和目标模型;根据游戏开发引擎中世界坐标空间的世界坐标法线生成基于世界坐标空间的六面体;根据所述六面体计算所述世界坐标空间下所述雨点遮罩图的UV;根据所述雨点遮罩图的UV对所述目标模型进行渲染。本方式中,通过世界坐标法线生成的六面体使用不同方向的雨点遮罩图的纹理世界坐标UV,无论模型造型、UV排布,视角如何,水滴都能够自上而下流动,能使游戏在雨天的时候观察物体时有较好的雨滴流下效果,提高游戏的真实度,提升代入感。
Smart Images

Figure CN115738247B_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 water flow on the surface of an object. Background Technology
[0002] With the development of the gaming industry and the advancement of technology, the emergence of various AAA games, with their rich scene details and effects, blurs the line between game and reality. Modern games demand increasingly higher levels of realism in their visual details. For example, rain effects are one such environment brimming with detail; different games have their own solutions for rain effects, maximizing the humid and noisy atmosphere of a rainy day. In games with diverse weather environments, rain is an indispensable element.
[0003] Currently, rain effects in mainstream games are achieved in several ways. For example, raindrops on the screen can be made to appear in the camera lens, or raindrops can be generated using physics-based particle voxel meshes to simulate flowing water. However, the raindrop effect only exists on the camera (screen) and lacks the effect of raindrops on the surfaces of objects in the scene. Therefore, the scene still looks unrealistic. Furthermore, the particle voxel mesh generation method is too resource-intensive and cannot be used on mobile devices. Summary of the Invention
[0004] The main objective of this invention is to solve the technical problem of unrealistic rain effects in existing game development processes.
[0005] The first aspect of this invention provides a method for rendering flowing water on the surface of an object, the method comprising:
[0006] Obtain the preset raindrop masking image and target model;
[0007] Generate a hexahedron based on the world coordinate space normal in the game development engine's world coordinate space;
[0008] Calculate the UV of the raindrop masking map in the world coordinate space based on the hexahedron;
[0009] The target model is rendered based on the UVs of the raindrop masking map.
[0010] A second aspect of the present invention provides a device for rendering flowing water on the surface of an object, comprising:
[0011] The acquisition module is used to acquire the preset raindrop masking image and the target model;
[0012] The hexahedron generation module is used to generate hexahedrons based on the world coordinate space normal in the game development engine.
[0013] A coordinate calculation module is used to calculate the UV of the raindrop masking map in the world coordinate space based on the hexahedron.
[0014] The rendering module is used to render the target model based on the UVs of the raindrop mask map.
[0015] A third aspect of the present invention provides an object surface water rendering apparatus, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the object surface water rendering apparatus to perform the steps of the above-described object surface water rendering method.
[0016] 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 steps of the above-described object surface water rendering method.
[0017] The aforementioned method, apparatus, device, and storage medium for rendering flowing water on object surfaces involves: acquiring a preset raindrop mask map and a target model; generating a hexahedron based on the world coordinate space normal in the game development engine's world coordinate space; calculating the UV coordinates of the raindrop mask map in the world coordinate space based on the hexahedron; and rendering the target model based on the UV coordinates of the raindrop mask map. In this method, the hexahedron generated by the world coordinate normal uses texture world coordinate UV coordinates of the raindrop mask map in different directions. Regardless of the model's shape, UV arrangement, or viewing angle, water droplets can flow from top to bottom, providing a better raindrop effect when observing objects in rainy weather, improving the game's realism and enhancing immersion.
[0018] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the first embodiment of the object surface water rendering method in the present invention;
[0021] Figure 2 This is a schematic diagram of a second embodiment of the water flow rendering method for object surfaces in this invention;
[0022] Figure 3 This is a schematic diagram of one embodiment of the object surface water rendering device in the present invention;
[0023] Figure 4 This is a schematic diagram of another embodiment of the object surface water rendering device in the present invention;
[0024] Figure 5 This is a schematic diagram of one embodiment of the object surface water rendering device in the present invention. Detailed Implementation
[0025] This invention provides a method, apparatus, device, and storage medium for rendering water flow on an object surface. The method involves acquiring a preset raindrop mask image and a target model; generating a hexahedron based on the world coordinate space normals in the game engine's world coordinate space; calculating the UV coordinates of the raindrop mask image in the world coordinate space based on the hexahedron; and rendering the target model based on the UV coordinates of the raindrop mask image. In this method, the hexahedron generated by the world coordinate normals uses texture world coordinate UV coordinates of the raindrop mask image in different directions. Regardless of the model's shape, UV arrangement, or viewing angle, water droplets can flow from top to bottom, providing a better raindrop effect when observing objects in rainy weather, improving the game's realism and immersion.
[0026] 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.
[0027] 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 object surface water rendering method in this invention includes:
[0028] 101. Obtain the preset raindrop masking image and target model;
[0029] It is understood that the executing entity of this invention can be a surface water rendering device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.
[0030] In this embodiment, the target model needs to be rendered to achieve the effect of flowing water on the object's surface. Rendering refers to the visual processing of the model during game development. For example, by setting relevant parameters such as the model's lighting, materials, textures, colors, and environment, the effect of simulating the model in a three-dimensional environment can be achieved, thus obtaining the virtual object in the game. First, the model of the object to be rendered, i.e., the target model, needs to be obtained. For example, if we need to build a flowing water effect on the surface of a rock in a game scene, we first need to obtain the rock model, and then render the rock model.
[0031] In practical applications, mask maps are used to mask the simulated water flow effect of a 3D model. In other words, not the entire 3D model needs to simulate a texture effect. Therefore, the water flow effect of parts of the 3D model that do not need to be simulated can be masked using mask maps.
[0032] 102. Generate a hexahedron based on the world coordinate space normal in the game development engine's world coordinate space;
[0033] In this embodiment, the game development engine is the NeoX game engine. However, the solution can be applied to other game development engines, such as Unreal Engine and Unity. This application does not limit the game development engine.
[0034] In this embodiment, subtracting a preset value from the absolute value of the world coordinate normal can generate different shapes. In this embodiment, the result of subtracting 0.5 from the absolute value of the world coordinate normal can approximate a hexahedron based on the world coordinate direction.
[0035] 103. Calculate the UV of the raindrop masking map in world coordinate space based on the hexahedron.
[0036] In practical applications, since the UV of the raindrop mask texture is controlled by two directions, and the world is a three-dimensional space, setting only two directions will cause errors in the other direction. In this embodiment, the front left and top left of the hexahedron are used as the mask of the raindrop mask in these three directions. The correct results of the raindrop mask texture in different directions are extracted and added together. Specifically, the xy and zy coordinates of the world position are used as the raindrop UV of the front and side, and the UV of the two directions are merged to form the UV of the raindrop in the world space.
[0037] In this embodiment, after calculating the UV of the raindrop masking map in the world coordinate space based on the hexahedron, the method further includes: creating a Panner node in the Y direction in the world coordinate space of the game development engine, wherein the Panner node is used to translate the UV of the raindrop masking map in the Y direction.
[0038] Specifically, in practical applications, the Panner (translation) material expression node allows the UV coordinates of a texture to be moved along the U or V direction, or both simultaneously. This node has two inputs: Coordinates and Time, with Speed as the final output. The Time value is used to determine the current translation position; this is typically used to provide a time expression for a constant translation effect. However, constant or scalar parameters can also be used to set specific offsets, or the translation can be controlled via Matinee or Blueprints.
[0039] In this embodiment, after calculating the UV of the raindrop masking image in the world coordinate space based on the hexahedron, the method further includes: adding a noise generator node to the UV of the raindrop masking image, wherein the noise generator node is used to cause UV distortion of the raindrop masking image.
[0040] Specifically, in practical applications, the noise generator node can generate 3D noise based on the world position. It processes the input parameters to create UV distortion to produce the twisting and flowing effect of water droplets.
[0041] In this embodiment, after calculating the UV of the raindrop masking image in the world coordinate space based on the hexahedron, the method further includes: adjusting the position material roughness and metallicity of the raindrop masking image to preset values respectively.
[0042] Specifically, adjusting the position material roughness and metallicity of the raindrop masking image to preset values can achieve a reflection effect. In this embodiment, the position material roughness of the raindrop masking image is reduced to 0.1, and the metallicity is increased to 0.5.
[0043] In this embodiment, after calculating the UV of the raindrop mask map in the world coordinate space based on the hexahedron, the method further includes: using the raindrop mask map as a height map in the shader, and converting it into a normal map using the height-to-normal function in the shader.
[0044] Specifically, normal maps can be used to indicate the lighting information of a model. A normal map is a map that stores normal information. Normals determine the basic lighting and shadow display of a model in a simulated 3D environment. In this embodiment, the raindrop mask map is converted into a normal map in the shader as a height map to increase the thickness effect of the water droplet lighting.
[0045] 104. Render the target model based on the UVs of the raindrop masking map.
[0046] In this embodiment, the target model needs to be rendered to achieve the effect of flowing water on the surface of the object. Rendering refers to the processing of the model's visual effects during the game production process. For example, by setting relevant parameters such as the model's lighting, materials, textures, colors, and environment, the effect of simulating the model in a three-dimensional environment can be achieved, thereby obtaining the virtual object in the game.
[0047] In this embodiment, a preset raindrop mask image and a target model are obtained; a hexahedron based on the world coordinate space normal in the game development engine is generated; the UV coordinates of the raindrop mask image in the world coordinate space are calculated based on the hexahedron; and the target model is rendered based on the UV coordinates of the raindrop mask image. In this method, the hexahedron generated by the world coordinate normal uses the texture world coordinate UV coordinates of the raindrop mask image in different directions. Regardless of the model shape, UV arrangement, or viewing angle, the water droplets can flow from top to bottom, enabling the game to have a better raindrop effect when observing objects in rainy weather, improving the realism of the game and enhancing the sense of immersion.
[0048] Please see Figure 2 The second embodiment of the object surface water rendering method in this invention includes:
[0049] 201. Obtain the preset raindrop masking image and target model;
[0050] 202. Subtract the preset value from the absolute value of the world coordinate normal in the world coordinate space of the game development engine to obtain the adjusted world coordinate normal;
[0051] 203. Based on the adjusted world coordinate normal, form a hexahedron based on world coordinate space;
[0052] 204. Create a disconnected component node for the hexahedron, and obtain the registered local variables of the hexahedron based on the disconnected component node. The registered local variables include the RGB mask image of the hexahedron.
[0053] 205. Use different orientations of the hexahedron as the masking of the raindrop masking image at the corresponding positions;
[0054] In this embodiment, using different directions of the hexahedron as masks for the raindrop masking pattern at corresponding positions includes using the front, left, and top of the hexahedron as masks for the raindrop masking pattern at corresponding positions.
[0055] 206. Extract the UVs of the hexahedron in different directions, and merge the UVs of the hexahedron in different directions using a mask image to obtain the UVs of the raindrop mask image in world coordinate space.
[0056] In this embodiment, the step of extracting the UV values of the hexahedron in different directions and merging the UV values of the hexahedron in different directions using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space includes: obtaining the xy and zy values of the hexahedron in the world coordinate space and using them as the UV values of the corresponding positions of the raindrop mask image in the world coordinate space; merging the UV values of the hexahedron in different directions to obtain the UV values of the raindrop mask image in the world coordinate space.
[0057] 207. Render the target model based on the UVs of the raindrop masking map.
[0058] This embodiment, based on the previous embodiment, details the process of calculating the UV of the raindrop mask map in the world coordinate space based on the hexahedron. It involves creating a disconnected component node for the hexahedron, obtaining registered local variables of the hexahedron based on the disconnected component node, including the RGB mask image of the hexahedron; using different directions of the hexahedron as masks for the raindrop mask map at corresponding positions; extracting the UVs of the hexahedron in different directions, and merging the UVs of the hexahedron in different directions using the mask image to obtain the UV of the raindrop mask map in the world coordinate space. In this method, the hexahedron generated by the world coordinate normal uses the texture world coordinate UVs of the raindrop mask map in different directions. Regardless of the model shape, UV arrangement, or viewing angle, water droplets can flow from top to bottom, providing a better raindrop effect when observing objects in rainy weather, improving the realism of the game and enhancing immersion.
[0059] The above describes the method for rendering flowing water on the surface of an object in the embodiments of the present invention. The following describes the apparatus for rendering flowing water on the surface of an object in the embodiments of the present invention. Please refer to [link / reference]. Figure 3 One embodiment of the object surface water rendering device in this invention includes:
[0060] The acquisition module 301 is used to acquire a preset raindrop mask image and a target model;
[0061] The hexahedron generation module 302 is used to generate a hexahedron based on the world coordinate space according to the world coordinate normal in the world coordinate space of the game development engine;
[0062] Coordinate calculation module 303 is used to calculate the UV of the raindrop masking map in the world coordinate space based on the hexahedron;
[0063] The rendering module 304 is used to render the target model based on the UV of the raindrop mask map.
[0064] In this embodiment of the invention, the object surface water rendering device operates the aforementioned object surface water rendering method. The object surface water rendering device acquires a preset raindrop mask map and a target model; generates a hexahedron based on the world coordinate space normal in the game development engine's world coordinate space; calculates the UVs of the raindrop mask map in the world coordinate space based on the hexahedron; and renders the target model based on the UVs of the raindrop mask map. In this method, the hexahedron generated by the world coordinate normal uses texture world coordinate UVs of the raindrop mask map in different directions. Regardless of the model's shape, UV arrangement, or viewing angle, water droplets can flow from top to bottom, enabling the game to have a better raindrop effect when observing objects in rainy weather, improving the game's realism and enhancing immersion.
[0065] Please see Figure 4 A second embodiment of the object surface water rendering device in this invention includes:
[0066] The acquisition module 301 is used to acquire a preset raindrop mask image and a target model;
[0067] The hexahedron generation module 302 is used to generate a hexahedron based on the world coordinate space according to the world coordinate normal in the world coordinate space of the game development engine;
[0068] Coordinate calculation module 303 is used to calculate the UV of the raindrop masking map in the world coordinate space based on the hexahedron;
[0069] The rendering module 304 is used to render the target model based on the UV of the raindrop mask map.
[0070] In this embodiment, the hexahedron generation module 302 is specifically used for:
[0071] Subtract the preset value from the absolute value of the world coordinate normal in the world coordinate space of the game development engine to obtain the adjusted world coordinate normal.
[0072] Based on the adjusted world coordinate normal, a hexahedron is formed in world coordinate space.
[0073] In this embodiment, the coordinate calculation module 303 is specifically used for:
[0074] Create a disconnected component node for the hexahedron, and obtain the registered local variables of the hexahedron based on the disconnected component node. The registered local variables include the RGB mask image of the hexahedron.
[0075] Different orientations of the hexahedron are used as masks for the raindrop masking pattern at corresponding positions.
[0076] The UV values of the hexahedron in different directions are extracted separately, and the UV values of the hexahedron in different directions are merged using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space.
[0077] In this embodiment, using different orientations of the hexahedron as masks for the raindrop masking pattern at corresponding positions includes:
[0078] The front, left, and top of the hexahedron are used as masks for the raindrop masking pattern at the corresponding positions.
[0079] In this embodiment, the step of extracting the UV values of the hexahedron in different directions and merging the UV values of the hexahedron in different directions using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space includes:
[0080] Obtain the xy and zy coordinates of the hexahedron in the world coordinate space, and use them as the UV coordinates of the corresponding positions of the raindrop masking map in the world coordinate space.
[0081] By merging the UVs of the hexahedron in different directions, the UVs of the raindrop masking map in the world coordinate space are obtained.
[0082] The object surface water rendering device further includes a falling module 305, which is specifically used for:
[0083] Create a Panner node in the Y direction of the world coordinate space of the game development engine, wherein the Panner node is used to translate the UVs of the raindrop mask map in the Y direction.
[0084] The object surface water rendering device also includes a noise module 306, which is specifically used for:
[0085] A noise generator node is added to the UV of the raindrop masking image, wherein the noise generator node is used to cause UV distortion of the raindrop masking image.
[0086] The object surface water rendering device further includes the module specifically used for:
[0087] Adjust the position, material roughness, and metallicity of the raindrop masking image to preset values respectively.
[0088] The object surface water rendering device further includes a normal mapping module 307, which is specifically used for:
[0089] The raindrop mask image is used as a height map in the shader, and then converted into a normal map using the height-to-normal function in the shader.
[0090] Based on the previous embodiment, this embodiment describes in detail the specific functions of each module and the unit composition of some modules. The hexahedron generated by the world coordinate normal uses the texture world coordinate UV of the raindrop mask map in different directions. Regardless of the model shape, UV arrangement, or viewing angle, the water droplets can flow from top to bottom, which can make the game have a better raindrop effect when observing objects in the rain, improve the realism of the game, and enhance the sense of immersion.
[0091] above Figure 3 and Figure 4 The object surface water rendering device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The object surface water rendering device in this embodiment of the invention is described in detail from the perspective of hardware processing.
[0092] Figure 5 This is a schematic diagram of the structure of an object surface water flow rendering device 500 provided in an embodiment of the present invention. The object surface water flow 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) for 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 object surface water flow 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 object surface water flow rendering device 500 to implement the steps of the above-described object surface water flow rendering method.
[0093] The surface water rendering device 500 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 structure of the object surface water flow rendering device does not constitute a limitation on the object surface water flow rendering device provided by the present invention. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0094] The present invention also provides a computer-readable storage medium, which can 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 object surface water rendering method.
[0095] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0096] 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.
[0097] 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 flowing water on the surface of an object, characterized in that, The method for rendering flowing water on the object surface includes: Obtain the preset raindrop masking image and target model; Generate a hexahedron based on the world coordinate space normal in the game development engine's world coordinate space; Calculating the UV of the raindrop masking image in the world coordinate space based on the hexahedron, including: obtaining the UV of the raindrop masking image in the corresponding direction based on different directions of the hexahedron; The target model is rendered based on the UVs of the raindrop masking map; The calculation of the UV of the raindrop masking map in the world coordinate space based on the hexahedron includes: Create a disconnected component node for the hexahedron, and obtain the registered local variables of the hexahedron based on the disconnected component node. The registered local variables include the RGB mask image of the hexahedron. Different orientations of the hexahedron are used as masks for the raindrop masking pattern at corresponding positions. The UV values of the hexahedron in different directions are extracted separately, and the UV values of the hexahedron in different directions are merged using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space.
2. The method for rendering flowing water on the surface of an object according to claim 1, characterized in that, The process of generating a hexahedron based on the world coordinate space normal in the game development engine includes: Subtract the preset value from the absolute value of the world coordinate normal in the world coordinate space of the game development engine to obtain the adjusted world coordinate normal. Based on the adjusted world coordinate normal, a hexahedron is formed in world coordinate space.
3. The method for rendering flowing water on the surface of an object according to claim 1, characterized in that, The step of using different orientations of the hexahedron as the masking of the raindrop masking map at corresponding positions includes: The front, left, and top of the hexahedron are used as masks for the raindrop masking pattern at the corresponding positions.
4. The method for rendering flowing water on the surface of an object according to claim 3, characterized in that, The step of extracting the UV values of the hexahedron in different directions and merging the UV values of the hexahedron in different directions using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space includes: Obtain the xy and zy coordinates of the hexahedron in the world coordinate space, and use them as the UV coordinates of the corresponding positions of the raindrop masking map in the world coordinate space. By merging the UVs of the hexahedron in different directions, the UVs of the raindrop masking map in the world coordinate space are obtained.
5. The method for rendering flowing water on the surface of an object according to claim 1, characterized in that, After calculating the UV of the raindrop masking map in the world coordinate space based on the hexahedron, the method further includes: Create a Panner node in the Y direction of the world coordinate space of the game development engine, wherein the Panner node is used to translate the UVs of the raindrop mask map in the Y direction.
6. The method for rendering flowing water on an object surface according to claim 1, characterized in that, After calculating the UV of the raindrop masking map in the world coordinate space based on the hexahedron, the method further includes: A noise generator node is added to the UV of the raindrop masking image, wherein the noise generator node is used to cause UV distortion of the raindrop masking image.
7. The method for rendering flowing water on an object surface according to claim 1, characterized in that, After calculating the UV of the raindrop masking map in the world coordinate space based on the hexahedron, the method further includes: Adjust the position, material roughness, and metallicity of the raindrop masking image to preset values respectively.
8. The method for rendering flowing water on the surface of an object according to claim 1, characterized in that, After calculating the UV of the raindrop masking map in the world coordinate space based on the hexahedron, the method further includes: The raindrop mask image is used as a height map in the shader, and then converted into a normal map using the height-to-normal function in the shader.
9. A device for rendering flowing water on the surface of an object, characterized in that, The object surface water rendering device includes: The acquisition module is used to acquire the preset raindrop masking image and the target model; The hexahedron generation module is used to generate hexahedrons based on the world coordinate space normal in the game development engine. The coordinate calculation module is used to calculate the UV of the raindrop masking image in the world coordinate space based on the hexahedron, including: obtaining the UV of the raindrop masking image in the corresponding direction based on different directions of the hexahedron; A rendering module is used to render the target model based on the UVs of the raindrop mask map; The coordinate calculation module is used for: Create a disconnected component node for the hexahedron, and obtain the registered local variables of the hexahedron based on the disconnected component node. The registered local variables include the RGB mask image of the hexahedron. Different orientations of the hexahedron are used as masks for the raindrop masking pattern at corresponding positions. The UV values of the hexahedron in different directions are extracted separately, and the UV values of the hexahedron in different directions are merged using the mask image to obtain the UV values of the raindrop mask image in the world coordinate space.
10. A surface water rendering device for an object, characterized in that, The object surface water rendering device 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 object surface water rendering device to perform the steps of the object surface water rendering method as described in any one of claims 1-8.
11. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the object surface water rendering method as described in any one of claims 1-8.
Citation Information
Patent Citations
Image processing method and device, electronic equipment, and storage medium
CN107358643A