Virtual object rendering method and apparatus, storage medium, and electronic device

By rendering the floating effect of virtual objects in a two -dimensional space in sampling and interpolation technology, the problem of high -resolution and smooth fluttering effects of high -resolution and smooth fluttering effects in the existing technology in the existing technology.

WO2025020835A1PCT designated stage expired Publication Date: 2025-01-30NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Application Number
PCT/CN2024/101985
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-27
Filing Date
2024-06-27
Publication Date
2025-01-30

AI Technical Summary

Technical Problem

When the existing technology realizes the flag fluttering effect in two-dimensional games, the sequence frame file size is large, the resolution is low, and high frame rates are required to present a smooth effect, resulting in high cost and low efficiency.

Method used

By obtaining coordinate variables and noise diagrams, the target coordinates of the texture map are obtained by sampling and interpolation, and the floating effect of virtual objects is rendered in a two -dimensional space.

Benefits of technology

A virtual object of high -resolution and smooth drifting effects in a two -dimensional space through differential values ​​and interpolations, reducing the cost of making multiple sequence frames and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024101985_30012025_PF_FP_ABST
    Figure CN2024101985_30012025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers, and specifically relates to a virtual object rendering method, a virtual object rendering apparatus, a storage medium, and a device. The method comprises: acquiring a first coordinate variable and a second coordinate variable, and acquiring a first noise map and a second noise map; sampling the first noise map by means of the first coordinate variable to obtain a first sampling result, and sampling the second noise map by means of the second coordinate variable to obtain a second sampling result; performing interpolation on the first sampling result and the second sampling result to obtain a third sampling result; acquiring a texture map corresponding to a virtual object; and superposing the third sampling result on a map coordinate to obtain a target map coordinate, and sampling the texture map by means of the target map coordinate so as to render the floating effect of the virtual object in a two-dimensional space. According to the technical solution of the embodiments of the present disclosure, the problem in the prior art of poor efficiency of realizing the floating effect in a two-dimensional space can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Virtual object rendering method and device, storage medium and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application number 202310937018.3, filed on July 27, 2023, entitled “Virtual object rendering method and device, storage medium and electronic device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of computer technology, and in particular to a virtual object rendering method, a virtual object model rendering device, a computer-readable storage medium, and an electronic device. Background Art

[0004] With the development of terminal devices and the gaming industry, a large number of games or works of different themes have emerged to meet the needs of users. In some two-dimensional games, there is a need to display the fluttering of some flags.

[0005] In related technologies, flag waving can be achieved through a sequential frame approach. Specifically, a sequential frame animation is a form of animation built on continuous static images, typically consisting of a series of static images (frames) played sequentially. During playback, multiple frames are played continuously per second, switching between static images frame by frame, creating a continuous dynamic effect. The changes between each frame can be in terms of position, shape, color, etc., and these changes can be used to present effects such as the movement, deformation, and transformation of an object.

[0006] However, in the related art, the file size of the sequence frames is usually large, the resolution of the sequence frame images is low, and a high frame rate is required to present a smooth fluttering effect. In addition, the cost of producing multiple sequence frames is high and the production efficiency is poor.

[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field.

[0008] Summary of the Invention

[0009] The purpose of the present disclosure is to provide a virtual object rendering method and device, a computer-readable storage medium and an electronic device, which can solve the problem of poor efficiency in achieving floating effects in two dimensions in related technologies.

[0010] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.

[0011] According to a first aspect of the present disclosure, a virtual object rendering method is provided, characterized in that the method includes: obtaining a first coordinate variable and a second coordinate variable, obtaining a first noise map and a second noise map; sampling the first noise map through the first coordinate variable to obtain a first sampling result, and sampling the second noise map through the second coordinate variable to obtain a second sampling result; interpolating the first sampling result and the second sampling result to obtain a third sampling result; obtaining a texture map corresponding to the virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to mapping coordinates; superimposing the third sampling result on the mapping coordinates to obtain target mapping coordinates, and sampling the texture map through the target mapping coordinates to render a floating effect of the virtual object in the two-dimensional space.

[0012] According to a second aspect of the present disclosure, a virtual object model rendering device is provided, characterized in that the device includes: a coordinate variable acquisition module, configured to execute acquisition of a first coordinate variable and a second coordinate variable, and acquire a first noise map and a second noise map; a coordinate variable sampling module, configured to execute sampling of the first noise map through the first coordinate variable to obtain a first sampling result, and to sample the second noise map through the second coordinate variable to obtain a second sampling result; a sampling result interpolation module, configured to execute interpolation of the first sampling result and the second sampling result to obtain a third sampling result; a texture map acquisition module, configured to execute acquisition of a texture map corresponding to the virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a map coordinate; a virtual object rendering module, configured to execute superimposing the third sampling result on the map coordinate to obtain a target map coordinate, and to sample the texture map through the target map coordinate to render a floating effect of the virtual object in the two-dimensional space.

[0013] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the virtual object rendering method according to the first aspect of the above embodiment is implemented.

[0014] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0015] one or more processors; and

[0016] The memory is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the virtual object rendering method of the first aspect of the above embodiment.

[0017] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:

[0018] In a virtual object rendering method provided by an embodiment of the present disclosure, a first coordinate variable and a second coordinate variable can be obtained, a first noise map and a second noise map can be obtained, the first noise map is sampled by the first coordinate variable to obtain a first sampling result, the second noise map is sampled by the second coordinate variable to obtain a second sampling result, the first sampling result and the second sampling result are interpolated to obtain a third sampling result, a texture map corresponding to the virtual object is obtained, the map coordinates are superimposed with the third sampling result to obtain a target map coordinate, and the texture map is sampled by the target map coordinate to render the floating effect of the virtual object in a two-dimensional space. Through the scheme of the present disclosure, on the one hand, the floating effect of the virtual object can be achieved by difference, which occupies less space and has a higher resolution, and can achieve a smooth floating effect; on the other hand, the floating effect of the virtual object can be achieved by interpolation, without the need to produce multiple sequence frame images, and the cost of achieving the floating effect is low and the efficiency is high.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0021] FIG1 schematically shows a schematic diagram of an exemplary system architecture of a virtual object rendering method according to one of the exemplary embodiments of the present disclosure;

[0022] FIG2 schematically shows a flow chart of a virtual object rendering method according to one of the exemplary embodiments of the present disclosure;

[0023] FIG3 schematically shows a flow chart of determining target mapping coordinates according to target first direction coordinates and target second direction coordinates according to one exemplary embodiment of the present disclosure;

[0024] FIG4 schematically illustrates one exemplary embodiment of the present disclosure in which front and back fluttering perspective parameters are different and front and back perspective states of a virtual object are different;

[0025] FIG5 schematically illustrates a flow chart of determining target texture coordinates based on candidate texture coordinates and front-back floating perspective parameters according to one exemplary embodiment of the present disclosure;

[0026] FIG6 schematically shows a flow chart of sampling a back-face texture map by using target texture coordinates in a second region according to one exemplary embodiment of the present disclosure;

[0027] FIG7 schematically illustrates a schematic diagram of how a first area and a second area change as a virtual object curls according to one of the exemplary embodiments of the present disclosure;

[0028] FIG8 schematically shows a flow chart of determining a first area for sampling a front texture map and a second area for sampling a back texture map according to pixel values ​​of a curled portion according to one of the exemplary embodiments of the present disclosure;

[0029] FIG9 schematically shows a flow chart of determining the curling center angle according to the curling arc length and the curling radius according to one exemplary embodiment of the present disclosure;

[0030] FIG10 schematically shows a schematic diagram of determining a first area for sampling a front texture map and a second area for sampling a back texture map according to a pixel value of a curled portion and a quadrant where an endpoint is located, according to one exemplary embodiment of the present disclosure;

[0031] FIG11 schematically shows a flow chart of another virtual object rendering method according to one of the exemplary embodiments of the present disclosure;

[0032] FIG12 schematically shows a composition diagram of a virtual object model rendering device according to one of the exemplary embodiments of the present disclosure;

[0033] FIG13 schematically shows a structural diagram of a computer system of an electronic device suitable for implementing one of the exemplary embodiments of the present disclosure. DETAILED DESCRIPTION

[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In addition, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0035] The blocks shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. Specifically, these functional entities may be implemented in software, or in one or more software-hardened modules, or in different networks and / or processor devices and / or microcontroller devices.

[0036] FIG1 is a schematic diagram showing an exemplary system architecture of a virtual object rendering method to which an embodiment of the present disclosure can be applied.

[0037] As shown in Figure 1, system architecture 1000 may include one or more terminal devices 1001, 1002, and 1003, a network 1004, and a server 1005. Network 1004 is a medium for providing communication links between terminal devices 1001, 1002, and 1003 and server 1005. Network 1004 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0038] It should be understood that the number of terminal devices, networks, and servers in FIG1 is merely illustrative. Any number of terminal devices, networks, and servers may be provided as needed. For example, server 1005 may be a server cluster consisting of multiple servers.

[0039] Users can use terminal devices 1001, 1002, and 1003 to interact with server 1005 via network 1004 to receive or send messages, etc. Terminal devices 1001, 1002, and 1003 can be various electronic devices with display screens, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers. In addition, server 1005 can be a server that provides various services.

[0040] In one embodiment, the executor of the virtual object rendering method disclosed herein may be server 1005, which may obtain the first coordinate variable and the second coordinate variable, the first noise map and the second noise map sent by terminal devices 1001, 1002, and 1003, sample the first noise map through the first coordinate variable to obtain a first sampling result, sample the second noise map through the second coordinate variable to obtain a second sampling result, interpolate the first sampling result and the second sampling result to obtain a third sampling result, obtain the texture map corresponding to the virtual object, superimpose the third sampling result on the map coordinates to obtain the target map coordinates, and sample the texture map through the target map coordinates to render the floating effect of the virtual object in two-dimensional space.

[0041] In addition, the virtual object rendering method disclosed in the present invention can also be executed through terminal devices 1001, 1002, 1003, etc. to obtain the first coordinate variable and the second coordinate variable, obtain the first noise map and the second noise map, sample the first noise map through the first coordinate variable to obtain a first sampling result, sample the second noise map through the second coordinate variable to obtain a second sampling result, interpolate the first sampling result and the second sampling result to obtain a third sampling result, obtain the texture map corresponding to the virtual object, superimpose the third sampling result on the map coordinates to obtain the target map coordinates, and sample the texture map through the target map coordinates to render the floating effect of the virtual object in two-dimensional space.

[0042] In addition, the implementation process of the method for generating special effects of the present disclosure can also be implemented jointly by the terminal devices 1001, 1002, 1003 and the server 1005. For example, the terminal devices 1001, 1002, 1003 can obtain the first coordinate variable and the second coordinate variable, obtain the first noise map and the second noise map, sample the first noise map using the first coordinate variable to obtain a first sampling result, sample the second noise map using the second coordinate variable to obtain a second sampling result, and then send the obtained first sampling result and second sampling result to the server 1005, so that the server 1005 can interpolate the first sampling result and the second sampling result to obtain a third sampling result, obtain the texture map corresponding to the virtual object, superimpose the third sampling result on the map coordinates to obtain the target map coordinates, and sample the texture map using the target map coordinates to render the floating effect of the virtual object in the two-dimensional space.

[0043] In an exemplary embodiment of the present disclosure, a first coordinate variable and a second coordinate variable can be obtained, a first noise map and a second noise map can be obtained, the first noise map is sampled using the first coordinate variable to obtain a first sampling result, the second noise map is sampled using the second coordinate variable to obtain a second sampling result, the first sampling result and the second sampling result are interpolated to obtain a third sampling result, a texture map corresponding to the virtual object is obtained, the third sampling result is superimposed on the map coordinates to obtain the target map coordinates, and the texture map is sampled using the target map coordinates to render a floating effect of the virtual object in a two-dimensional space. Referring to FIG2 , a flowchart of a virtual object rendering method in this exemplary embodiment is shown, which may include the following steps:

[0044] Step S210, obtaining a first coordinate variable and a second coordinate variable, and obtaining a first noise map and a second noise map;

[0045] Step S220, sampling the first noise image using the first coordinate variable to obtain a first sampling result, and sampling the second noise image using the second coordinate variable to obtain a second sampling result;

[0046] Step S230, interpolating the first sampling result and the second sampling result to obtain a third sampling result;

[0047] Step S240, obtaining a texture map corresponding to the virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a mapping coordinate;

[0048] Step S250 , superimposing the third sampling result on the mapping coordinates to obtain target mapping coordinates, and sampling the texture map according to the target mapping coordinates to render a floating effect of the virtual object in a two-dimensional space.

[0049] In a virtual object rendering method provided by an embodiment of the present disclosure, a first coordinate variable and a second coordinate variable can be obtained, a first noise map and a second noise map can be obtained, the first noise map is sampled by the first coordinate variable to obtain a first sampling result, the second noise map is sampled by the second coordinate variable to obtain a second sampling result, the first sampling result and the second sampling result are interpolated to obtain a third sampling result, a texture map corresponding to the virtual object is obtained, the map coordinates are superimposed with the third sampling result to obtain a target map coordinate, and the texture map is sampled by the target map coordinate to render the floating effect of the virtual object in a two-dimensional space. Through the scheme of the present disclosure, on the one hand, the floating effect of the virtual object can be achieved by difference, which occupies less space and has a higher resolution, and can achieve a smooth floating effect; on the other hand, the floating effect of the virtual object can be achieved by interpolation, without the need to produce multiple sequence frame images, and the cost of achieving the floating effect is low and the efficiency is high.

[0050] Next, steps S210 to S250 of the virtual object rendering method in this exemplary embodiment will be described in more detail with reference to FIG. 2 and the embodiment.

[0051] Step S210, obtaining a first coordinate variable and a second coordinate variable, and obtaining a first noise map and a second noise map;

[0052] In an exemplary embodiment of the present disclosure, a first coordinate variable and a second coordinate variable may be obtained. Specifically, the first coordinate variable and the second coordinate variable are a two-dimensional coordinate group, and the first coordinate variable or the second coordinate variable may be used to indicate a sampling position.

[0053] For example, the first coordinate variable and the second coordinate variable may be UV coordinate variables (UV Coordinates, texture coordinates).

[0054] In an exemplary embodiment of the present disclosure, a first noise map and a second noise map may be obtained. Specifically, the first noise map and the second noise map may be images used to generate natural textures and simulate natural phenomena. For example, the first noise map and the second noise map may include grayscale images containing random brightness values, which can be used to simulate various natural scenes.

[0055] In an exemplary embodiment of the present disclosure, the first noise map and the second noise map may be generated by a random algorithm, such as Perlin noise, Simplex noise, Worley noise, etc.

[0056] It should be noted that the present disclosure does not impose any special limitation on the method of generating the first noise map and the second noise map.

[0057] Step S220, sampling the first noise image using the first coordinate variable to obtain a first sampling result, and sampling the second noise image using the second coordinate variable to obtain a second sampling result;

[0058] In an exemplary embodiment of the present disclosure, after obtaining the first and second coordinate variables and the first and second noise maps through the above steps, the first noise map can be sampled using the first coordinate variables to obtain a first sampling result, and the second noise map can be sampled using the second coordinate variables to obtain a second sampling result. Specifically, sampling the noise map using the coordinate variables refers to obtaining one or more values ​​from the noise map. When sampling the noise map, the noise image can be viewed as a two-dimensional pixel matrix, where each pixel contains a different value.

[0059] For example, to generate rock textures, you can use the Perlin noise algorithm to convert the noise map into height map data, and then use the height map data to highly deform the rock model to generate the shape and surface texture of the rock; to simulate clouds, you can use the Simplex noise algorithm to convert the noise map into brightness values, and then use the brightness values ​​to perform material mapping on the clouds in the scene, thereby simulating the softness and dynamic effects of the clouds.

[0060] Furthermore, the first sampling result, the second sampling result, and the third sampling result are random numbers. Specifically, when sampling a noise image, the noise image can be regarded as a two-dimensional pixel matrix, where each pixel contains a different value. By interpolating the coordinates on the noise image, a set of random numbers can be obtained. These values ​​can be used to generate various natural textures and simulate natural phenomena.

[0061] It should be noted that the present disclosure does not specifically limit the specific manner of obtaining the first sampling result by sampling the first noise map through the first coordinate variable and obtaining the second sampling result by sampling the second noise map through the second coordinate variable.

[0062] Step S230, interpolate the first sampling result and the second sampling result to obtain a third sampling result;

[0063] In an exemplary embodiment of the present disclosure, after obtaining the first sampling result and the second sampling result through the above steps, the first sampling result and the second sampling result can be interpolated to obtain a third sampling result. Specifically, interpolating the first sampling result and the second sampling result to obtain a third sampling result means obtaining a new sampling result (the third sampling result) through an interpolation method based on two known sampling results. This interpolation method can be used for texture blending, detailed textures, transition effects, etc.

[0064] In an exemplary embodiment of the present disclosure, methods such as linear interpolation, bilinear interpolation, and trilinear interpolation can be used to interpolate the first sampling result and the second sampling result to obtain a third sampling result. Among them, for linear interpolation, assuming that the change between two sampling points is linear, the value of any point is calculated through a linear equation; for bilinear interpolation, linear interpolation is performed separately in the horizontal and vertical directions to obtain a smoother effect; for trilinear interpolation, linear interpolation is performed in three dimensions, usually used for processing stereo images, volume data, etc.

[0065] In an exemplary embodiment of the present disclosure, the lerp function (interpolation function) can be used to interpolate the first sampling result and the second sampling result to obtain a third sampling result.

[0066] For example, the lerp function can be used to interpolate the first sampling result and the second sampling result to obtain a third sampling result. Specifically, the expression of the lerp function is as follows: lerp(a, b, t) = (1 - t) * a + t * b

[0067] Where, a is the first sampling result, b is the second sampling result, and t is the interpolation scale factor, with a value range of 0 to 1. When t = 0, the lerp function returns a; when t = 1, the lerp function returns b; when 0 < t < 1, the lerp function returns the interpolation result between a and b.

[0068] In an exemplary embodiment of the present disclosure, the lerp function (interpolation function) can be used to interpolate the first sampling result and the second sampling result to obtain a third sampling result. Specifically, the expression is as follows: c = lerp(a, b, t)

[0069] Among them, c is the third sampling result, a is the first sampling result, b is the second sampling result, t is the interpolation scale factor, and its value range is 0 to 1. When t = 0, c is equal to a; when t = 1, c is equal to b; when 0 < t < 1, c is the interpolation result between a and b.

[0070] It should be noted that the present disclosure does not make special limitations on the specific manner of interpolating the first sampling result and the second sampling result to obtain the third sampling result.

[0071] For example, the first coordinate variable uv1 can be obtained, the second coordinate variable uv2 can be obtained, the first noise map noisetex1 and the second noise map noisetex2 can be obtained. The sample2D function (sampling function) can be used as the sampling function. The first noise map is sampled by the first coordinate variable to obtain the first sampling result, and the second noise map is sampled by the second coordinate variable to obtain the second sampling result. The code is as follows: float4 tex1 = sample2D(noisetex1, uv1) float4 tex2 = sample2D(noisetex2, uv2)

[0072] Among them, float4 tex1 is the first sampling result, float4 tex2 is the second sampling result, and then the third sampling result (float4 finalColor) is obtained by interpolating float4 tex1 and float4 tex2. The code is as follows: float4 finalColor = lerp(tex1, tex2, 0.5), where t is 0.5.

[0073] Step S240, obtain the texture map corresponding to the virtual object;

[0074] In an exemplary embodiment of the present disclosure, after obtaining the third sampling result through the above steps, the texture map corresponding to the virtual object can be obtained. Among them, the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to texture coordinates. Specifically, the texture map usually consists of one or more pictures, and can be pictures, patterns, texts, etc., for simulating the appearance and material of the object surface. The texture map can contain information such as different colors, textures, transparencies, reflectivities, etc., so as to achieve various realistic and vivid picture effects.

[0075] In an exemplary embodiment of the present disclosure, the texture map corresponds to texture coordinates. Specifically, the texture coordinates are a two-dimensional coordinate group, used to represent the corresponding relationship when pasting the texture map content onto the virtual object. When the texture map of the virtual object is pasted onto the virtual object, the pixel information of the texture map can be projected onto the virtual object according to the above corresponding relationship, so as to achieve the texture map.

[0076] It should be noted that the present disclosure does not impose any special restrictions on the specific type of texture map corresponding to the virtual object.

[0077] Step S250 , superimposing the third sampling result on the mapping coordinates to obtain target mapping coordinates, and sampling the texture map according to the target mapping coordinates to render a floating effect of the virtual object in a two-dimensional space.

[0078] In an exemplary embodiment of the present disclosure, after obtaining the third sampling result and the texture map corresponding to the virtual object through the above steps, the third sampling result can be superimposed on the texture coordinates to obtain target texture coordinates. Specifically, superimposing the third sampling result on the texture coordinates to obtain the target texture coordinates refers to combining the texture coordinates with the interpolated sampling result to obtain the final target texture coordinates.

[0079] Specifically, the third sampling result (random value) may be superimposed on the mapping coordinates to change the values ​​of the mapping coordinates and obtain target mapping coordinates.

[0080] It should be noted that the present disclosure does not impose any special limitation on the specific method of obtaining the target mapping coordinates by superimposing the third sampling result on the mapping coordinates.

[0081] In an exemplary embodiment of the present disclosure, after obtaining the target mapping coordinates through the above steps, the texture map can be sampled using the target mapping coordinates to render a floating effect of the virtual object in two-dimensional space. Specifically, sampling the texture map using the target mapping coordinates means obtaining the color value of the corresponding position on the texture map using the target mapping coordinates. After obtaining the color value, it can be applied to the virtual object and rendered to achieve a floating effect of the virtual object in two-dimensional space.

[0082] In an exemplary embodiment of the present disclosure, rendering can be performed by a shader. Specifically, a shader is a rendering program used to perform specific calculations in computer graphics rendering to generate the final image output. The shader is written in a programming language such as GLSL (Open Graphics Library Shading Language, a cross-platform graphics programming interface shading language), HLSL (High-Level Shader Language, a high-level shader language), Cg (Collada Effect shading language, an open standard effect shading language for digital content), etc. It can be executed on a GPU (Graphics Processing Unit) and can achieve a variety of rendering effects and graphic effects. Shaders can be divided into multiple types, including vertex shaders, fragment shaders, geometry shaders, compute shaders, etc. Each shader has specific functions and input / output. By writing different types of shader programs, a variety of rendering effects can be achieved, including shadows, reflections, anti-aliasing, etc.

[0083] Specifically, the rendering process of virtual objects can be implemented according to the rendering pipeline. Specifically, the rendering pipeline includes multiple processing steps, such as geometry processing, lighting, texturing, depth testing, etc. The rendering pipeline is usually divided into two stages: vertex processing stage and pixel processing stage.

[0084] Among them, the vertex processing stage mainly includes the following four steps:

[0085] Vertex input: passing the vertex data of the virtual object into the rendering pipeline; Vertex shader: transforming and deforming each vertex and converting it into screen space coordinates; Geometry shader: generating geometric graphics, such as triangles, based on vertex data; Rasterization: converting geometric graphics into pixels and passing the pixels into the pixel processing stage.

[0086] The pixel processing stage mainly includes the following three steps:

[0087] Pixel shader: performs lighting, texture and other calculations on each pixel to generate the final color value; pixel depth test: determines whether the pixel is visible based on the depth value, thereby achieving occlusion culling and transparency effects; pixel output: outputs the processed pixels to the screen or texture.

[0088] It should be noted that the present disclosure does not impose any special limitation on the method of rendering virtual objects.

[0089] In an exemplary embodiment of the present disclosure, the third sampling result can be superimposed on the mapping coordinates to obtain intermediate mapping coordinates, the first direction coordinates can be adjusted according to the bending strength parameter to obtain the target first direction coordinates, the second direction coordinates can be adjusted according to the forward and backward sway parameter and the forward and backward floating perspective parameter to obtain the target second direction coordinates, and the target mapping coordinates can be determined based on the target first direction coordinates and the target second direction coordinates. Referring to FIG. 3 , determining the target mapping coordinates based on the target first direction coordinates and the target second direction coordinates can include the following steps S310 to S330:

[0090] Step S310, superimposing the third sampling result on the mapping coordinates to obtain intermediate mapping coordinates;

[0091] In an exemplary embodiment of the present disclosure, after obtaining the third sampling result and the texture coordinates through the above steps, the third sampling result can be superimposed on the texture coordinates to obtain intermediate texture coordinates. The intermediate texture coordinates include first-direction coordinates and second-direction coordinates. Specifically, superimposing the third sampling result on the texture coordinates to obtain the intermediate texture coordinates refers to combining the texture coordinates with the interpolated sampling result to obtain the intermediate texture coordinates. These intermediate texture coordinates require further processing before sampling the texture map corresponding to the virtual object.

[0092] Specifically, the third sampling result (random value) may be superimposed on the mapping coordinates to change the values ​​of the mapping coordinates and obtain intermediate mapping coordinates.

[0093] It should be noted that the present disclosure does not impose any special limitation on the specific method of superimposing the third sampling result on the mapping coordinates to obtain the intermediate mapping coordinates.

[0094] Step S320, adjusting the first direction coordinate according to the bending strength parameter to obtain the target first direction coordinate, and adjusting the second direction coordinate according to the front-back sway parameter and the front-back floating perspective parameter to obtain the target second direction coordinate;

[0095] In an exemplary embodiment of the present disclosure, after obtaining the intermediate mapping coordinates through the above steps, the first-direction coordinates can be adjusted according to the bending strength parameter to obtain the target first-direction coordinates. The bending strength parameter indicates the bending amplitude of the virtual object, the fore-and-aft sway parameter indicates the fore-and-aft sway amplitude of the virtual object, and the fore-and-aft perspective parameter indicates the fore-and-aft perspective state of the virtual object. Specifically, the intermediate mapping coordinates include first-direction coordinates and second-direction coordinates. For example, the intermediate mapping coordinates are UV coordinates, which include U-direction coordinates and V-direction coordinates.

[0096] Specifically, after obtaining the intermediate mapping coordinates, the first direction coordinates can be adjusted in combination with a bending strength parameter to obtain the target first direction coordinates. The bending strength parameter is used to indicate the bending amplitude of the virtual object. A higher bending strength parameter indicates a greater bending amplitude of the virtual object, while a lower bending strength parameter indicates a smaller bending amplitude. Alternatively, a higher bending strength parameter indicates a smaller bending amplitude of the virtual object, while a lower bending strength parameter indicates a greater bending amplitude of the virtual object.

[0097] For example, the value of the first direction coordinate may be multiplied by the bending strength parameter to obtain the target first direction coordinate.

[0098] In one exemplary embodiment of the present disclosure, the bending amplitude of a virtual object can be controlled using a power (exponential) function. Specifically, a power function represents the result of raising a number (radix) to a power of a positive integer (exponent). The target's first direction coordinate can be obtained using the power function, which can be represented by the formula y = x^n, where x is the radix, n is the exponent, and y is the result.

[0099] Specifically, the bending strength parameter can be used as an index to adjust the first direction coordinate. The code is as follows, where T is the target first direction coordinate:

[0100] T=power (first direction coordinate, bending strength parameter).

[0101] Furthermore, the target first direction coordinate can be determined based on the value obtained by the power function and the first direction coordinate. For example, X=(0.5-first direction coordinate)*T, where X is the target first direction coordinate and T is the value obtained by the power function.

[0102] In an exemplary embodiment of the present disclosure, after obtaining the intermediate mapping coordinates through the above steps, the second-direction coordinates are adjusted based on the sway parameter and the forward and backward floating perspective parameter to obtain the target second-direction coordinates. Specifically, after obtaining the intermediate mapping coordinates, the second-direction coordinates can be adjusted based on the sway parameter and the forward and backward floating perspective parameter to obtain the target second-direction coordinates. The sway parameter indicates the sway amplitude of the virtual object, and the forward and backward floating perspective parameter indicates the forward and backward perspective state of the virtual object.

[0103] The higher the sway parameter, the greater the sway amplitude of the virtual object, while the lower the sway parameter, the smaller the sway amplitude. Alternatively, the higher the sway parameter, the smaller the sway amplitude of the virtual object, while the lower the sway parameter, the greater the sway amplitude of the virtual object. A higher sway perspective parameter moves the virtual object closer to the front, while a lower sway perspective parameter moves the virtual object closer to the back. Alternatively, a higher sway perspective parameter moves the virtual object closer to the back, while a lower sway perspective parameter moves the virtual object closer to the front.

[0104] For example, the target second direction coordinate may be obtained by multiplying the value of the second direction coordinate, the front-back sway parameter, and the front-back drift perspective parameter.

[0105] Furthermore, the target second-direction coordinate can be determined based on the calculation result of the power function, the sway parameter, and the flutter perspective parameter. For example, the bending strength parameter can be used as an exponent: T = power (second-direction coordinate, bending strength parameter), and the target second-direction coordinate is Y = sway parameter * flutter perspective parameter * T.

[0106] For example, as shown in FIG4 , the front and back floating perspective parameters are different, and the front and back perspective states of the virtual object are different.

[0107] Step S330 , determining target mapping coordinates according to the target first direction coordinates and the target second direction coordinates.

[0108] In an exemplary embodiment of the present disclosure, after obtaining the target first-direction coordinates and the target second-direction coordinates through the above steps, the target mapping coordinates can be determined based on the target first-direction coordinates and the target second-direction coordinates. Specifically, the target first-direction coordinates can be used as the first coordinate component of the target mapping coordinates, and the target second-direction coordinates can be used as the second coordinate component of the target mapping coordinates to obtain the target mapping coordinates.

[0109] It should be noted that the present disclosure does not impose any special limitation on the specific method of determining the target mapping coordinates according to the target first direction coordinates and the target second direction coordinates.

[0110] Through the above steps S310 to S330, the third sampling result can be superimposed on the mapping coordinates to obtain the intermediate mapping coordinates, the first direction coordinates can be adjusted according to the bending strength parameter to obtain the target first direction coordinates, the second direction coordinates can be adjusted according to the front and back swing parameters and the front and back floating perspective parameters to obtain the target second direction coordinates, and the target mapping coordinates can be determined based on the target first direction coordinates and the target second direction coordinates.

[0111] In an exemplary embodiment of the present disclosure, candidate texture coordinates can be determined based on the target first direction coordinates and the target second direction coordinates, and target texture coordinates can be determined based on the candidate texture coordinates and the front-back floating perspective parameter. Referring to FIG. 5 , determining the target texture coordinates based on the candidate texture coordinates and the front-back floating perspective parameter can include the following steps S510 to S520:

[0112] Step S510, determining candidate mapping coordinates according to the target first direction coordinates and the target second direction coordinates;

[0113] In an exemplary embodiment of the present disclosure, after obtaining the target first-direction coordinates and the target second-direction coordinates through the above steps, candidate mapping coordinates can be determined based on the target first-direction coordinates and the target second-direction coordinates. Specifically, the target first-direction coordinates can be used as the first coordinate component of the candidate mapping coordinates, and the target second-direction coordinates can be used as the second coordinate component of the candidate mapping coordinates to obtain the candidate mapping coordinates.

[0114] Step S520 : determining target texture coordinates according to the candidate texture coordinates and the front-back floating perspective parameters.

[0115] In an exemplary embodiment of the present disclosure, after obtaining candidate texture coordinates through the above steps, target texture coordinates can be determined based on the candidate texture coordinates and the front-back floating perspective parameter. Specifically, the target texture coordinates can be obtained by multiplying the candidate texture coordinates and the front-back floating perspective parameter.

[0116] For example, the target texture coordinates = candidate texture coordinates (X, Y) * front and back floating perspective parameters.

[0117] It should be noted that the present disclosure does not impose any special limitation on the specific method of determining the target texture coordinates based on the candidate texture coordinates and the front-back floating perspective parameters.

[0118] Through the above steps S510 to S520, candidate mapping coordinates can be determined according to the target first direction coordinates and the target second direction coordinates, and target mapping coordinates can be determined according to the candidate mapping coordinates and the front and back floating perspective parameters.

[0119] In an exemplary embodiment of the present disclosure, during the curling process of a virtual object starting from an endpoint, a first area for sampling a front texture map and a second area for sampling a back texture map can be determined based on the position of the endpoint. In the first area, the front texture map is sampled using the target texture coordinates, and in the second area, the back texture map is sampled using the target texture coordinates. As shown in FIG. 6 , in the second area, sampling the back texture map using the target texture coordinates can include the following steps S610 to S630:

[0120] Step S610, during the curling process of the virtual object starting from the endpoint, determining a first area for sampling the front texture map and a second area for sampling the back texture map according to the position of the endpoint;

[0121] In an exemplary embodiment of the present disclosure, after obtaining the target mapping coordinates through the above steps, the first area for sampling the front texture map and the second area for sampling the back texture map can be determined according to the positions of the endpoints during the curling process of the virtual object starting from the endpoints. Specifically, the virtual object is a two-dimensional object in a two-dimensional space, and the virtual object has endpoints. The endpoints of the virtual object refer to the projection points of the edges of the virtual object in the two-dimensional space. For example, the virtual object is a virtual flag, and the projection points of the lower side of the virtual flag in the two-dimensional space can be used as the endpoints of the virtual object. The texture maps corresponding to the virtual object include a front texture map and a back texture map, wherein the front texture map is used to render the front of the virtual object, and the back texture map is used to render the back of the virtual object. During the curling process of the virtual object starting from the endpoints, different areas of the virtual object need to sample different texture maps.

[0122] For example, the virtual object is a virtual flag, which faces the virtual lens. During the curling process of the virtual flag, first, the entire virtual flag needs to apply the front texture map. As the curling proceeds, some areas of the virtual flag need to apply the back texture map.

[0123] In an exemplary embodiment of the present disclosure, the curling degree of the virtual object may be determined by the positions of the endpoints, and the first area for sampling the front texture map and the second area for sampling the back texture map may be determined according to the curling degree of the virtual object.

[0124] It should be noted that the present disclosure does not impose any special limitation on the specific method of determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the positions of the endpoints.

[0125] Step S620 , sampling the front texture map in the first area using the target map coordinates;

[0126] Step S630: In the second area, the back surface texture map is sampled using the target texture coordinates.

[0127] In an exemplary embodiment of the present disclosure, after determining the first and second regions during the warping process through the above steps, the front texture map can be sampled in the first region using the target mapping coordinates, and the back texture map can be sampled in the second region using the target mapping coordinates. Specifically, as the virtual object warps, the first and second regions change, i.e., the regions where the front and back texture maps are sampled using the target mapping coordinates change, thereby achieving a warped effect on the rendered virtual object.

[0128] For example, as shown in FIG7 , as the virtual object curls, the first area and the second area will change, so that the rendered virtual object achieves a curling effect.

[0129] It should be noted that the present disclosure does not impose any special limitation on the specific manner of sampling the front texture map or the back texture map by using the target mapping coordinates in the first area or the second area.

[0130] Through the above steps S610 to S630, during the curling process of the virtual object starting from the endpoint, the first area for sampling the front texture map and the second area for sampling the back texture map can be determined according to the position of the endpoint. In the first area, the front texture map is sampled through the target map coordinates, and in the second area, the back texture map is sampled through the target map coordinates.

[0131] In an exemplary embodiment of the present disclosure, the degree of the curling center angle is determined based on the positions of the endpoints and the initial position, the curling portion pixel value is determined based on the curling center angle, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined based on the curling portion pixel value. As shown in Figure 8, determining the first area for sampling the front texture map and the second area for sampling the back texture map based on the curling portion pixel value may include the following steps S810-S820:

[0132] Step S810, determining the curling center angle according to the positions of the endpoints and the initial position;

[0133] In an exemplary embodiment of the present disclosure, after the positions of the endpoints are obtained through the above steps, the degree of the curling center angle can be determined based on the positions of the endpoints and the initial position. Specifically, the initial position is used to indicate the starting position of the curling, and a curling center can be determined by the initial position and the positions of the endpoints. The curling center angle can be formed by the curling center, the initial position, and the positions of the endpoints, and the degree of the curling center angle can be determined by the positions of the endpoints and the initial position. Specifically, the curling radius can be determined based on the positions or initial positions of the endpoints and the curling center, and the degree of the curling center angle can be determined based on the curling radius.

[0134] It should be noted that the present disclosure does not impose any particular limitation on the specific method of determining the degree of the curling center angle according to the positions of the endpoints and the initial position.

[0135] Step S820: determining the pixel value of the curled portion according to the curling center angle, and determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the pixel value of the curled portion.

[0136] In an exemplary embodiment of the present disclosure, after obtaining the curl center angle degree through the above steps, the curl portion pixel value can be determined based on the curl center angle degree, and the first area for sampling the front texture map and the second area for sampling the back texture map can be determined based on the curl portion pixel value. Specifically, the curl portion pixel value can be used to indicate the height of the curl portion, and the curl portion pixel value can be used to determine the curl portion and the non-curled portion of the virtual object. The curl portion pixel value can be determined using a trigonometric function to determine the first area for sampling the front texture map and the second area for sampling the back texture map.

[0137] It should be noted that the present disclosure does not impose any special limitation on the specific method of determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the pixel values ​​of the curled portion.

[0138] Through the above steps S810 to S820, the curling center angle degree can be determined according to the position of the endpoint and the initial position, the curling part pixel value can be determined according to the curling center angle degree, and the first area for sampling the front texture map and the second area for sampling the back texture map can be determined according to the curling part pixel value.

[0139] In an exemplary embodiment of the present disclosure, the curling arc length can be determined based on the position of the endpoints, the curling radius corresponding to the curling process can be obtained, and the curling center angle degree can be determined based on the curling arc length and the curling radius. Referring to FIG9 , determining the curling center angle degree based on the curling arc length and the curling radius can include the following steps S910 to S920:

[0140] Step S910, determining the curling arc length according to the positions of the endpoints, and obtaining the curling radius corresponding to the curling process;

[0141] In an exemplary embodiment of the present disclosure, after determining the positions of the endpoints through the above steps, the length of the curling arc can be determined based on the positions of the endpoints. Specifically, after obtaining the positions of the endpoints and the initial position, the curling center can be determined based on the positions of the endpoints and the initial position. A curling arc is constructed with the positions of the endpoints and the initial position as the two endpoints of the curling arc, and the arc length of the curling arc is calculated. Furthermore, the curling radius corresponding to the curling process can be obtained. Specifically, the curling radius can be the length from the curling center to the positions of the endpoints, or the curling radius can be the length from the curling center to the initial position.

[0142] Step S920: determining the curling center angle according to the curling arc length and the curling radius.

[0143] In an exemplary embodiment of the present disclosure, after obtaining the curling arc length and curling radius through the above steps, the curling center angle can be determined based on the curling arc length and curling radius. Specifically, the curling center angle can be calculated based on the arc length calculation formula.

[0144] Specifically, the arc length calculation formula is L = n × π × r / 180, where n is the curling center angle, r is the curling radius, and L is the curling arc length. After deduction, the curling center angle n = curling arc length * 180 / π / curling radius.

[0145] It should be noted that the present disclosure does not impose any particular limitation on the specific method of determining the curling center angle according to the curling arc length and the curling radius.

[0146] Through the above steps S910 to S920, the curling arc length can be determined according to the positions of the end points, the curling radius corresponding to the curling process can be obtained, and the curling center angle can be determined according to the curling arc length and the curling radius.

[0147] In an exemplary embodiment of the present disclosure, a first region for sampling the front texture map and a second region for sampling the back texture map are determined based on the pixel values ​​of the curled portion and the quadrant in which the endpoints are located. Specifically, the curling process corresponds to a curling center, and a coordinate system can be constructed around the curling center. This coordinate system has a first quadrant, a second quadrant, a third quadrant, and a fourth quadrant. Specifically, this coordinate system is a coordinate system within a two-dimensional simulation plane.

[0148] As shown in Figure 10, n is the curling center angle, a is the initial position, b is the curling length position, y is the curling part pixel value, and r is the curling radius.

[0149] When the quadrant where the endpoint is located is the third quadrant, the pixel value of the curled part is less than one-fourth of the curled perimeter, and sin(n) = pixel value of the curled part / curled radius. Then the pixel value of the curled part = sin(n) * curled radius. That is, the curled part corresponding to -b < y ≤ a is the first region. In the first region, the front texture map can be sampled through the target texture coordinates, and the part where y < -b is not rendered;

[0150] When the quadrant where the endpoint is located is the fourth quadrant, the pixel value of the curled part is greater than one-fourth of the curled perimeter and less than one-half of the curled perimeter, and sin(180 - n) = pixel value of the curled part / curled radius. Then the pixel value of the curled part = sin(180 - n) * curled radius. That is, the curled part corresponding to -r < y ≤ -b is the first region. In addition, the uncurled part where y > a is also the first region. In the first region, the front texture map can be sampled through the target texture coordinates. The curled part beyond the pixel value of the curled part is the second region, that is, the curled part corresponding to -b < y ≤ a. In the second region, the back texture map can be sampled through the target texture coordinates, and the part where y < -r is not rendered;

[0151] When the quadrant where the endpoint is located is the first quadrant, the pixel value of the curled part is greater than one-half of the curled perimeter and less than three-fourths of the curled perimeter, and sin(n - 180) = pixel value of the curled part / curled radius. Then the pixel value of the curled part = sin(n - 180) * curled radius. That is, the curled part corresponding to a < y ≤ b is the second region. In the second region, the back texture map can be sampled through the target texture coordinates, and the part where y > b is not rendered;

[0152] When the quadrant where the endpoint is located is the second quadrant, the pixel value of the curled part is greater than three-fourths of the curled perimeter and less than the curled perimeter, and sin(n - 270) = pixel value of the curled part / curled radius. Then the pixel value of the curled part = sin(n - 270) * curled radius. That is, the curled part corresponding to b < y ≤ r is the second region. In the second region, the back texture map can be sampled through the target texture coordinates. The part where y > r is the first region, and in the first region, the front texture map can be sampled through the target texture coordinates.

[0153] In an exemplary embodiment of the present disclosure, it is a flowchart of a method for rendering a virtual object. a is the initial position, b is the curled length position, y is the pixel value of the curled part, and r is the curled radius.

[0154] Step S1101, get the position of the endpoint; Step S1102, determine whether the uv.y corresponding to the endpoint is in the third quadrant, Step S1103, if uv.y is in the third quadrant, determine uv.y<-b; Step S1104, uv.y<-b part is not rendered; Step S1105, the part uv.y≥-b is determined as the first area, uv.y is modified to the pixel value of the curled part, and the front texture map is sampled through the target map coordinates; Step S1110, render the front texture map; Step S1106, if uv.y is not in the third quadrant, determine whether uv.y is in the fourth quadrant; Step S110 7. If uv.y is in the fourth quadrant, it is determined that uv.y is less than -r; step S1104, the part with uv.y less than -r is not rendered; step S1109, for the part with uv.y ≥ -r, it is determined that -r is less than uv.y ≤ -b; step S1110, for the part with -r less than uv.y ≤ -b, it is determined as the second area, uv.y is modified to the pixel value of the curled part, and the back texture map is sampled through the target map coordinates; step S1120, the back texture map is rendered; step S1112, for the part with uv.y less than -r or uv.y> -b, it is determined that -b is less than uv.y ≤ a; step S1105, for the part with -b< The portion where uv.y≤a is determined as the first area, uv.y is modified to the pixel value of the curled portion, and the front texture map is sampled through the target mapping coordinates; step S1110, rendering the front texture map; step S1110, for the portion where uv.y≤-b or uv.y>a, rendering the front texture map; step S1115, if uv.y is not in the fourth quadrant, determining whether uv.y is in the first quadrant; step S1116, if uv.y is in the first quadrant, determining uv.y>b; step S1110, for the portion where uv.y>b, rendering the front texture map; step S1118, for the portion where uv.y≤ b part, determine it as the second area, modify uv.y to the pixel value of the curled part, and sample the back texture map through the target mapping coordinates; step S1120, render the back texture map; step S1119, if uv.y is not in the first quadrant, determine uv.y>r; step S1110, for the part where uv.y>r, render the front texture map; step S1118, for the part where uv.y≤r, determine it as the second area, modify uv.y to the pixel value of the curled part, and sample the back texture map through the target mapping coordinates; step S1120, render the back texture map; step S1123, output.

[0155] In a virtual object rendering method provided by an embodiment of the present disclosure, a first coordinate variable and a second coordinate variable can be obtained, a first noise map and a second noise map can be obtained, the first noise map is sampled by the first coordinate variable to obtain a first sampling result, the second noise map is sampled by the second coordinate variable to obtain a second sampling result, the first sampling result and the second sampling result are interpolated to obtain a third sampling result, a texture map corresponding to the virtual object is obtained, the map coordinates are superimposed with the third sampling result to obtain a target map coordinate, and the texture map is sampled by the target map coordinate to render the floating effect of the virtual object in a two-dimensional space. Through the scheme of the present disclosure, on the one hand, the floating effect of the virtual object can be achieved by difference, which occupies less space and has a higher resolution, and can achieve a smooth floating effect; on the other hand, the floating effect of the virtual object can be achieved by interpolation, without the need to produce multiple sequence frame images, and the cost of achieving the floating effect is low and the efficiency is high.

[0156] It should be noted that the above figures are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0157] In addition, in an exemplary embodiment of the present disclosure, a virtual object rendering apparatus is also provided. Referring to FIG. 12 , the virtual object rendering apparatus 1200 includes a coordinate variable acquisition module 1210 , a coordinate variable sampling module 1220 , a sampling result interpolation module 1230 , a texture map acquisition module 1240 , and a virtual object rendering module 1250 .

[0158] Among them, the coordinate variable acquisition module is configured to execute the acquisition of the first coordinate variable and the second coordinate variable, and obtain the first noise map and the second noise map; the coordinate variable sampling module is configured to execute sampling of the first noise map through the first coordinate variable to obtain a first sampling result, and to sample the second noise map through the second coordinate variable to obtain a second sampling result; the sampling result interpolation module is configured to execute interpolation of the first sampling result and the second sampling result to obtain a third sampling result; the texture map acquisition module is configured to execute the acquisition of the texture map corresponding to the virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a mapping coordinate; the virtual object rendering module is configured to execute superimposing the third sampling result on the mapping coordinate to obtain the target mapping coordinate, and sample the texture map through the target mapping coordinate to render the floating effect of the virtual object in the two-dimensional space.

[0159] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the third sampling result is superimposed on the mapping coordinates to obtain the target mapping coordinates, and the device also includes: an intermediate mapping coordinate acquisition unit, configured to execute superimposing the third sampling result on the mapping coordinates to obtain intermediate mapping coordinates; wherein the intermediate mapping coordinates include first direction coordinates and second direction coordinates; a first direction coordinate adjustment unit, configured to execute adjusting the first direction coordinates according to the bending strength parameter to obtain the target first direction coordinates, and adjusting the second direction coordinates according to the front and back sway parameter and the front and back floating perspective parameter to obtain the target second direction coordinates; wherein the bending strength parameter is used to indicate the bending amplitude of the virtual object, the front and back sway parameter is used to indicate the front and back sway amplitude of the virtual object, and the front and back floating perspective parameter is used to indicate the front and back perspective state of the virtual object; a first target mapping coordinate determination unit, configured to execute determining the target mapping coordinates according to the target first direction coordinates and the target second direction coordinates.

[0160] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target mapping coordinates are determined according to the target first-direction coordinates and the target second-direction coordinates, and the device also includes: a candidate mapping coordinate determination unit, configured to execute the determination of the candidate mapping coordinates according to the target first-direction coordinates and the target second-direction coordinates; a second target mapping coordinate determination unit, configured to execute the determination of the target mapping coordinates according to the candidate mapping coordinates and the front and back floating perspective parameters.

[0161] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the texture map corresponding to the virtual object includes a front texture map and a back texture map, the virtual object has an endpoint, and the texture map is sampled through the target map coordinates, and the device also includes: a curling unit, configured to execute in the process of curling the virtual object starting from the endpoint, determine the first area for sampling the front texture map and the second area for sampling the back texture map according to the position of the endpoint; a first area sampling unit, configured to execute in the first area, sampling the front texture map through the target map coordinates; and a second area sampling unit, configured to execute in the second area, sampling the back texture map through the target map coordinates.

[0162] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the endpoint has an initial position, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the position of the endpoint. The device also includes: a first curling center angle degree determination unit, which is configured to determine the curling center angle degree according to the position of the endpoint and the initial position; a curling part pixel value determination unit, which is configured to determine the curling part pixel value according to the curling center angle degree, and determine the first area for sampling the front texture map and the second area for sampling the back texture map according to the curling part pixel value.

[0163] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the curling center angle degree is determined according to the position of the endpoint and the initial position, and the device also includes: a curling arc length determination unit, which is configured to determine the curling arc length according to the position of the endpoint and obtain the curling radius corresponding to the curling process; a second curling center angle degree determination unit, which is configured to determine the curling center angle degree according to the curling arc length and the curling radius.

[0164] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the curling process corresponds to a curling center, and a coordinate system is constructed with the curling center. The coordinate system corresponds to the first quadrant, the second quadrant, the third quadrant, and the fourth quadrant. The first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the pixel value of the curled part. The device also includes: an area determination unit, which is configured to execute the determination of the first area for sampling the front texture map and the second area for sampling the back texture map according to the pixel value of the curled part and the quadrant where the endpoint is located.

[0165] Since the various functional modules of the virtual object rendering device of the exemplary embodiment of the present disclosure correspond to the steps of the exemplary embodiment of the virtual object rendering method described above, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the virtual object rendering method described above.

[0166] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0167] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above-mentioned virtual object rendering method is also provided.

[0168] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."

[0169] The electronic device 1300 according to this embodiment of the present disclosure is described below with reference to Figure 13. The electronic device 1300 shown in Figure 13 is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0170] As shown in FIG13 , electronic device 1300 is implemented as a general-purpose computing device. Components of electronic device 1300 may include, but are not limited to, the aforementioned at least one processing unit 1310 , the aforementioned at least one storage unit 1320 , a bus 1330 connecting various system components (including storage unit 1320 and processing unit 1310 ), and a display unit 1340 .

[0171] The storage unit stores program code, which can be executed by the processing unit 1310, so that the processing unit 1310 performs the steps described in the "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1310 may perform step S210 as shown in FIG2 to obtain a first coordinate variable and a second coordinate variable, and obtain a first noise map and a second noise map; step S220 to sample the first noise map using the first coordinate variable to obtain a first sampling result, and to sample the second noise map using the second coordinate variable to obtain a second sampling result; step S230 to interpolate the first sampling result and the second sampling result to obtain a third sampling result; step S240 to obtain a texture map corresponding to the virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a texture coordinate; step S250 to superimpose the third sampling result on the texture coordinate to obtain a target texture coordinate, and sample the texture map using the target texture coordinate to render a floating effect of the virtual object in the two-dimensional space.

[0172] Based on the embodiments of the present disclosure, the following solutions can also be implemented:

[0173] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the third sampling result is superimposed on the mapping coordinates to obtain the target mapping coordinates, including: superimposing the third sampling result on the mapping coordinates to obtain intermediate mapping coordinates; wherein the intermediate mapping coordinates include first direction coordinates and second direction coordinates; adjusting the first direction coordinates according to the bending strength parameter to obtain the target first direction coordinates, and adjusting the second direction coordinates according to the front and back sway parameter and the front and back floating perspective parameter to obtain the target second direction coordinates; wherein the bending strength parameter is used to indicate the bending amplitude of the virtual object, the front and back sway parameter is used to indicate the front and back sway amplitude of the virtual object, and the front and back floating perspective parameter is used to indicate the front and back perspective state of the virtual object; determining the target mapping coordinates according to the target first direction coordinates and the target second direction coordinates.

[0174] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target mapping coordinates are determined according to the target first direction coordinates and the target second direction coordinates, including: determining candidate mapping coordinates according to the target first direction coordinates and the target second direction coordinates; determining the target mapping coordinates according to the candidate mapping coordinates and the front and back floating perspective parameters.

[0175] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the texture map corresponding to the virtual object includes a front texture map and a back texture map, the virtual object has an endpoint, and the texture map is sampled through the target map coordinates, including: in the process of curling of the virtual object starting from the endpoint, determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the position of the endpoint; in the first area, the front texture map is sampled through the target map coordinates; in the second area, the back texture map is sampled through the target map coordinates.

[0176] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the endpoint has an initial position, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the position of the endpoint, including: determining the degree of the curling center angle according to the position of the endpoint and the initial position; determining the curling part pixel value according to the curling center angle, and determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the curling part pixel value.

[0177] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the degree of the curling center angle is determined according to the position of the endpoint and the initial position, including: determining the curling arc length according to the position of the endpoint, and obtaining the curling radius corresponding to the curling process; determining the degree of the curling center angle according to the curling arc length and the curling radius.

[0178] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the curling process corresponds to a curling center, and a coordinate system is constructed with the curling center. The coordinate system corresponds to the first quadrant, the second quadrant, the third quadrant, and the fourth quadrant. The first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the pixel value of the curled part, including: determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the pixel value of the curled part and the quadrant where the endpoint is located.

[0179] An electronic device provided by an embodiment of the present disclosure can obtain a first coordinate variable and a second coordinate variable, obtain a first noise map and a second noise map, sample the first noise map through the first coordinate variable to obtain a first sampling result, sample the second noise map through the second coordinate variable to obtain a second sampling result, interpolate the first sampling result and the second sampling result to obtain a third sampling result, obtain a texture map corresponding to the virtual object, superimpose the third sampling result on the map coordinates to obtain a target map coordinate, and sample the texture map through the target map coordinates to render a floating effect of the virtual object in a two-dimensional space. Through the scheme of the present disclosure, on the one hand, the floating effect of the virtual object can be achieved by interpolation, which occupies less space and has a higher resolution, and can achieve a smooth floating effect; on the other hand, the floating effect of the virtual object can be achieved by interpolation, without the need to produce multiple sequence frame images, and the cost of achieving the floating effect is low and the efficiency is high.

[0180] The storage unit 1320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1321 and / or a cache memory unit 1322 , and may further include a read-only memory unit (ROM) 1323 .

[0181] The storage unit 1320 may also include a program / utility 1324 having a set (at least one) of program modules 1325, such program modules 1325 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0182] Bus 1330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0183] Electronic device 1300 can also communicate with one or more external devices 1370 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1300, and / or any device that enables electronic device 1300 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication can occur via input / output (I / O) interface 1350. Furthermore, electronic device 1300 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 1360. As shown, network adapter 1360 communicates with other modules of electronic device 1300 via bus 1330. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 1300, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Array of Independent Disks) systems, tape drives, and data backup storage systems.

[0184] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0185] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, on which is stored a program product capable of implementing the aforementioned methods of this specification. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Methods" section of this specification.

[0186] In an exemplary embodiment of the present disclosure, a first coordinate variable and a second coordinate variable can be obtained, and a first noise map and a second noise map can be obtained; the first noise map is sampled through the first coordinate variable to obtain a first sampling result, and the second noise map is sampled through the second coordinate variable to obtain a second sampling result; the first sampling result and the second sampling result are interpolated to obtain a third sampling result; a texture map corresponding to the virtual object is obtained; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to mapping coordinates; the third sampling result is superimposed on the mapping coordinates to obtain target mapping coordinates, and the texture map is sampled through the target mapping coordinates to render a floating effect of the virtual object in the two-dimensional space.

[0187] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the third sampling result is superimposed on the mapping coordinates to obtain the target mapping coordinates, including: superimposing the third sampling result on the mapping coordinates to obtain intermediate mapping coordinates; wherein the intermediate mapping coordinates include first direction coordinates and second direction coordinates; adjusting the first direction coordinates according to the bending strength parameter to obtain the target first direction coordinates, and adjusting the second direction coordinates according to the front and back sway parameter and the front and back floating perspective parameter to obtain the target second direction coordinates; wherein the bending strength parameter is used to indicate the bending amplitude of the virtual object, the front and back sway parameter is used to indicate the front and back sway amplitude of the virtual object, and the front and back floating perspective parameter is used to indicate the front and back perspective state of the virtual object; determining the target mapping coordinates according to the target first direction coordinates and the target second direction coordinates.

[0188] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target mapping coordinates are determined according to the target first direction coordinates and the target second direction coordinates, including: determining candidate mapping coordinates according to the target first direction coordinates and the target second direction coordinates; determining the target mapping coordinates according to the candidate mapping coordinates and the front and back floating perspective parameters.

[0189] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the texture map corresponding to the virtual object includes a front texture map and a back texture map, the virtual object has an endpoint, and the texture map is sampled through the target map coordinates, including: in the process of curling of the virtual object starting from the endpoint, determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the position of the endpoint; in the first area, the front texture map is sampled through the target map coordinates; in the second area, the back texture map is sampled through the target map coordinates.

[0190] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the endpoint has an initial position, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the position of the endpoint, including: determining the degree of the curling center angle according to the position of the endpoint and the initial position; determining the curling part pixel value according to the curling center angle, and determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the curling part pixel value.

[0191] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the degree of the curling center angle is determined according to the position of the endpoint and the initial position, including: determining the curling arc length according to the position of the endpoint, and obtaining the curling radius corresponding to the curling process; determining the degree of the curling center angle according to the curling arc length and the curling radius.

[0192] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the curling process corresponds to a curling center, and a coordinate system is constructed with the curling center. The coordinate system corresponds to the first quadrant, the second quadrant, the third quadrant, and the fourth quadrant. The first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the pixel value of the curled part, including: determining the first area for sampling the front texture map and the second area for sampling the back texture map according to the pixel value of the curled part and the quadrant where the endpoint is located.

[0193] An embodiment of the present disclosure provides a computer-readable signal medium that can obtain a first coordinate variable and a second coordinate variable, obtain a first noise map and a second noise map, sample the first noise map using the first coordinate variable to obtain a first sampling result, sample the second noise map using the second coordinate variable to obtain a second sampling result, interpolate the first sampling result and the second sampling result to obtain a third sampling result, obtain a texture map corresponding to a virtual object, superimpose the third sampling result on the map coordinates to obtain a target map coordinate, and sample the texture map using the target map coordinates to render a floating effect of a virtual object in a two-dimensional space. Through the solution of the present disclosure, on the one hand, the floating effect of the virtual object can be achieved by interpolation, which occupies less space and has a higher resolution, and can achieve a smooth floating effect; on the other hand, the floating effect of the virtual object can be achieved by interpolation, without the need to produce multiple sequence frame images, and the cost of achieving the floating effect is low and the efficiency is high.

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

[0195] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.

[0196] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0197] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0198] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

Claims

1. A virtual object rendering method, the method comprising: Obtain a first coordinate variable and a second coordinate variable, and obtain a first noise map and a second noise map; The first noise image is sampled by the first coordinate variable to obtain a first sampling result, and the second noise image is sampled by the second coordinate variable to obtain a second sampling result; interpolating the first sampling result and the second sampling result to obtain a third sampling result; Acquire a texture map corresponding to a virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a map coordinate; The third sampling result is superimposed on the mapping coordinates to obtain target mapping coordinates, and the texture map is sampled by the target mapping coordinates to render a floating effect of the virtual object in the two-dimensional space.

2. The method according to claim 1, wherein: The step of superimposing the third sampling result on the mapping coordinates to obtain target mapping coordinates includes: Superimposing the third sampling result on the mapping coordinates to obtain intermediate mapping coordinates; wherein the intermediate mapping coordinates include first direction coordinates and second direction coordinates; The first direction coordinate is adjusted according to the bending strength parameter to obtain the target first direction coordinate, and the second direction coordinate is adjusted according to the front-to-back sway parameter and the front-to-back floating perspective parameter to obtain the target second direction coordinate; wherein the bending strength parameter is used to indicate the bending amplitude of the virtual object, the front-to-back sway parameter is used to indicate the front-to-back sway amplitude of the virtual object, and the front-to-back floating perspective parameter is used to indicate the front-to-back perspective state of the virtual object; The target mapping coordinates are determined according to the target first direction coordinates and the target second direction coordinates.

3. The method according to claim 2, wherein: The step of determining the target mapping coordinates according to the target first direction coordinates and the target second direction coordinates includes: Determine candidate mapping coordinates according to the target first direction coordinates and the target second direction coordinates; The target mapping coordinates are determined according to the candidate mapping coordinates and the front-back floating perspective parameters.

4. The method according to claim 1, wherein: The texture map corresponding to the virtual object includes a front texture map and a back texture map, the virtual object has an endpoint, and sampling the texture map through the target map coordinates includes: In the process of curling the virtual object from the endpoint, a first area for sampling the front texture map and a first area for sampling the back texture map are determined according to the position of the endpoint. The second area sampled; In the first region, sampling the front texture map by the target map coordinates; In the second region, the back surface texture map is sampled using the target texture coordinates.

5. The method according to claim 4, wherein: The endpoint has an initial position, and determining a first area for sampling the front texture map and a second area for sampling the back texture map according to the position of the endpoint includes: Determine the degree of the curling center angle according to the position of the endpoint and the initial position; The pixel value of the curled part is determined according to the curling center angle, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the curling part pixel value.

6. The method according to claim 5, wherein: Determining the curling center angle according to the position of the endpoint and the initial position includes: Determine the curling arc length according to the position of the end point, and obtain the curling radius corresponding to the curling process; The degree of the curling center angle is determined according to the curling arc length and the curling radius.

7. The method according to claim 5, wherein: The curling process corresponds to a curling center, a coordinate system is constructed with the curling center, the coordinate system corresponds to a first quadrant, a second quadrant, a third quadrant, and a fourth quadrant, and the first area for sampling the front texture map and the second area for sampling the back texture map are determined according to the pixel values ​​of the curled part, including: A first area for sampling the front texture map and a second area for sampling the back texture map are determined according to the pixel value of the curled portion and the quadrant where the endpoint is located.

8. A virtual object model rendering device, the device comprising: A coordinate variable acquisition module is configured to execute acquisition of a first coordinate variable and a second coordinate variable, and to acquire a first noise map and a second noise map; A coordinate variable sampling module, configured to perform sampling of the first noise map through the first coordinate variable to obtain a first sampling result, and to perform sampling of the second noise map through the second coordinate variable to obtain a second sampling result; A sampling result interpolation module, configured to perform interpolation on the first sampling result and the second sampling result to obtain a third sampling result; A texture map acquisition module is configured to execute acquisition of a texture map corresponding to a virtual object; wherein the virtual object is a two-dimensional virtual object in a two-dimensional space, and the texture map corresponds to a map coordinate; The virtual object rendering module is configured to perform superposition of the third sampling The target mapping coordinates are obtained by sampling the result, and the texture map is sampled by the target mapping coordinates to render the floating effect of the virtual object in the two-dimensional space.

9. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 7.

10. An electronic device comprising: one or more processors; as well as The memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Generation method and device of wind field effect picture, storage medium and computer equipment

    CN114768251A

  • Image rendering method and device, storage medium and electronic equipment

    CN115018968A

  • Cloud model rendering method and device, storage medium and electronic device

    CN115375822A

  • Virtual object rendering method and device, storage medium and electronic equipment

    CN116958358A

  • Minimum sampling rate and minimum sampling curve for image-based rendering

    US6738533B1

Cited By

  • Texture sampling method and device

    CN121544677A