Method, device, electronic device and storage medium for rendering target image

By only having the CPU perform coarse-grained calculations in image processing and passing them to the GPU to render the target image, the CPU performance bottleneck problem is solved, and the efficiency of virtual model production and user experience are improved.

CN114677469BActive Publication Date: 2025-09-12BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210307708.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-09-12
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

In the prior art, when an image processing program renders a virtual model, a large amount of calculations performed by the CPU and communication interactions between the CPU and the GPU lead to performance bottlenecks, resulting in a poor user experience.

Method used

By having the CPU only perform coarse-grained calculations and passing the calculation results to the GPU, the vertex shader is used to render the target image according to the sub-model attributes and original vertex information, reducing the interaction between the CPU and GPU.

Benefits of technology

It avoids the performance bottleneck caused by the CPU performing a large number of calculations, improves the efficiency of image processing programs, and improves the user experience of making models in virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677469B_ABST
    Figure CN114677469B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a method, device, electronic device and storage medium for rendering a target image, the method comprising: when a touch event on a current model is detected, determining the touch point attributes of the target touch point; taking the sub-model to which the target touch point belongs as the sub-model to be adjusted, and determining two associated sub-models adjacent to the sub-model to be adjusted; determining the attributes to be adjusted of the sub-model to be adjusted based on the touch point attributes and the sub-model attributes of the two associated sub-models, and updating the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted; sending each sub-model attribute to a vertex shader, so that the vertex shader renders a target image after the current model is touched according to each sub-model attribute and the original vertex information. The technical solution of the embodiments of the present disclosure can obtain the target image by only requiring the CPU to perform coarse-grained calculations and pass the calculation results to the GPU, thereby avoiding the problem of program performance bottlenecks caused by the CPU performing a large amount of calculations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to a method, device, electronic device, and storage medium for rendering a target image. Background Art

[0002] With the continuous development of image processing technology, many application software provide users with the function of making virtual models. For example, based on the relevant functions in the application, users can make a piece of pottery in a virtual scene according to their own wishes.

[0003] In the existing technology, applications can dynamically modify models based on user operations. However, on the one hand, in order to obtain the data required to change the model shape, the central processing unit (CPU) needs to perform a large amount of calculations, which leads to performance bottlenecks in related image processing programs. On the other hand, in order to render the model, the CPU will also generate a large amount of communication interactions between the graphics processing unit (GPU) after obtaining the calculation results, which further reduces the processing efficiency of related programs and poor user experience of the application. Summary of the Invention

[0004] The present disclosure provides a method, device, electronic device and storage medium for rendering a target image. The target image can be obtained by only requiring the CPU to perform coarse-grained calculations and pass the calculation results to the GPU, avoiding the problem of program performance bottlenecks caused by the CPU performing large amounts of calculations.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for rendering a target image, comprising:

[0006] When a touch event on a current model is detected, determining a touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models;

[0007] The sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attributes;

[0008] Determining the attributes to be adjusted of the sub-model to be adjusted according to the touch point attributes and the sub-model attributes of the two associated sub-models, and updating the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted;

[0009] Sending the sub-model attributes of each sub-model to a vertex shader, so that the vertex shader renders a target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model;

[0010] The original vertex information matches the original model corresponding to the current model.

[0011] In a second aspect, an embodiment of the present disclosure further provides a method for rendering a target image, comprising:

[0012] a touch point attribute determination module, configured to, when a touch event on a current model is detected, determine the touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models;

[0013] a sub-model to be adjusted determining module, configured to take the sub-model to which the target touch point belongs as the sub-model to be adjusted, and determine two associated sub-models adjacent to the sub-model to be adjusted according to the touch point attributes;

[0014] a to-be-adjusted attribute updating module, configured to determine the to-be-adjusted attribute of the to-be-adjusted sub-model according to the touch point attribute and the sub-model attributes of the two associated sub-models, and update the to-be-adjusted attribute to the sub-model attribute of the to-be-adjusted sub-model;

[0015] A sub-model attribute sending module is used to send the sub-model attributes of each sub-model to the vertex shader, so that the vertex shader renders the target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model; wherein the original vertex information matches the original model corresponding to the current model.

[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0017] one or more processors;

[0018] a storage device for storing one or more programs,

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for rendering a target image as described in any one of the embodiments of the present disclosure.

[0020] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the method for rendering a target image as described in any one of the embodiments of the present disclosure.

[0021] The technical solution of the embodiment of the present disclosure is that when a touch event on the current model is detected, the touch attribute of the target touch point corresponding to the touch event is determined, that is, which point on the model the user touches is determined; the sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attribute; further, the to-be-adjusted attribute of the to-be-adjusted sub-model is determined according to the touch point attribute and the sub-model attributes of the two associated sub-models, and the to-be-adjusted attribute is updated to the sub-model attribute of the to-be-adjusted sub-model; the sub-model attributes of each sub-model are sent to the vertex shader so that the vertex shader The shader renders the target image after the current model is touched based on the attributes of each sub-model and the original vertex information, and uses the model displayed in the target image as the current model. The target image can be obtained by having the CPU perform coarse-grained calculations and pass the calculation results to the GPU, avoiding the problem of program performance bottlenecks caused by the CPU performing large amounts of calculations. At the same time, by significantly reducing the interaction between the CPU and the GPU, the limitations of the GPU communication bandwidth on the program processing process are reduced, further improving the processing efficiency of related programs and enhancing the user experience of making models such as pottery in virtual scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0023] Figure 1 A schematic flow chart of a method for rendering a target image provided in the first embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of the structure of a device for rendering a target image provided by the second embodiment of the present disclosure;

[0025] Figure 3 This is a structural diagram of an electronic device provided in Example 3 of the present disclosure. DETAILED DESCRIPTION

[0026] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0028] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "a plurality of" mentioned in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or more".

[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0031] Before introducing this technical solution, we can first provide an illustrative description of the application scenarios of the disclosed embodiments. For example, in a pre-developed model-making application, users can be provided with the ability to create 3D models, such as pottery, in a virtual scene. Specifically, the application can present a pre-built initial pottery model to the user. Upon detecting that the user touches the model, the model can be processed based on the solution of this embodiment, thereby changing the shape of the initial pottery model in response to the user's touch operation, and the changed pottery model can be presented in the display interface associated with the application.

[0032] Example 1

[0033] Figure 1 This is a flow chart of a method for rendering a target image provided in the first embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where the shape of a model is processed according to the user's touch operation, thereby rendering and displaying the processed model. The method can be executed by a device for rendering the target image, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.

[0034] like Figure 1 As shown, the method includes:

[0035] S110 : When a touch event on the current model is detected, determine a touch point attribute of a target touch point corresponding to the touch event.

[0036] It should be noted that the solution of this embodiment can be executed based on the target device, wherein the target device can be any terminal device equipped with a CPU and a GPU. When the model is displayed in the display interface and the user's touch operation on the model is detected, the target device can use the processing power of the CPU and GPU to process the model, and render the processed model and display it in the relevant display interface.

[0037] The current model can be a pre-built initial 3D model displayed in the application's related display interface. For example, in an application that provides 3D model creation, users can choose to create pottery or clay sculptures, among other gameplay options. Once the user selects one of these options, the application will display a corresponding blank model in the display interface based on the user's selection. At the same time, in order to make the initial virtual model provided to the user more natural and realistic, and to provide the user with a better model-making experience, in actual application, the current model displayed in the display interface is an axisymmetric model with a circular bottom surface, which can be understood as being more similar to real-world pottery.

[0038] Furthermore, after the current model is displayed on the display interface, the user's touch operation can be detected, thereby changing the shape of the model according to the user's wishes. If the display device is an interactive device, the touch operation can be a touch operation on the current model. Alternatively, in order to further improve intelligence, key points can be monitored. For example, the key point is the nose, and the corresponding pixel point in the display interface can be determined to determine whether the pixel point is a point on the current model. If so, it is determined that a touch operation has been triggered. In other words, it can be understood that a touch event can include a touch event and a key point detection event. Touch points and key points are regarded as touch points.

[0039] It should be noted that, in this embodiment, in order to capture the position of the user's touch model in a more accurate manner, before detecting the user's touch operation, the original model can be divided into multiple sub-models according to the height information of the original model in the first direction; the original height information and the original radius information of the upper and lower bottom surfaces of each sub-model are determined, and the identification, original height information and original radius information of each sub-model are sent to the vertex shader as sub-model attributes; and, the vertex information of the original model is sent to the vertex shader, so that when a touch event on the original model is detected, the corresponding sub-model attributes are determined and the sub-model attributes are sent to the vertex shader, so that the vertex shader updates the original model based on the sub-model attributes and each vertex information to obtain the current model.

[0040] To simulate the pottery-making process, the original model can be an axisymmetric model with a circular bottom. The first direction can be perpendicular to the bottom of the cylinder, and the height information is the height of the original model in three-dimensional space. Once the original model, the first direction, and the corresponding height of the model are determined, the model can be divided into multiple parts, which are called sub-models.

[0041] For example, after constructing a 3D space and calling a cylindrical model, a 3D coordinate system can be generated within the space. The center point of the cylindrical model is used as the coordinate system origin, the direction perpendicular to the bottom of the cylinder is used as the positive direction of the coordinate system's y-axis, and the height of the cylindrical model in the 3D coordinate system is determined to be 10 units in length. At this point, the cylindrical model can be divided based on 1 unit length along the y-axis, resulting in 10 sub-models.

[0042] It should be noted that when the division basis is different, the number of sub-models obtained will also be different. At the same time, the more sub-models are divided, the more refined the model obtained after subsequent processing will be.

[0043] In this embodiment, after the original model is divided into multiple sub-models, the original height information of each sub-model along the first direction in the three-dimensional space and the original radius information of the upper and lower bottom surfaces can be determined. Further, the above data can be combined with the identifier assigned to each sub-model to obtain the corresponding sub-model attributes. It can be understood that based on this attribute, at least each sub-model can be distinguished. At the same time, the sub-model attributes can reflect the shape of the corresponding sub-model to a certain extent. Finally, the attributes of each sub-model are sent to the vertex shader, wherein the vertex shader is an editable program used to implement image rendering and replace the fixed rendering pipeline, which is mainly responsible for the geometric relationship calculation of the vertices in the model. Those skilled in the art should understand that only one vertex shader can be activated at the same time. When the vertex shader runs in the GPU, the corresponding image can be rendered in the display interface. The embodiments of the present disclosure will not be repeated here.

[0044] Continuing with the above example, after the cylindrical model is divided into 10 sub-models, corresponding identifiers can be set for each sub-model in the order of No. 1 to No. 10. At the same time, the height of each sub-model is determined, that is, 1 unit length. Since the original model is a cylindrical model, the original radius of the upper and lower bottom surfaces of each sub-model is also the same. Those skilled in the art should understand that when the original model is a model of other shapes (such as a truncated cone model), for each adjacent sub-model, the radius of the surface where the two sub-models meet is still the same, while for each sub-model, the radius of its upper and lower bottom surfaces can be different, which will not be repeated here. Finally, 10 groups of sub-model attributes are generated based on the above data, and these sub-model attributes can be sent to the vertex shader corresponding to the GPU.

[0045] In this embodiment, while determining the attributes of each sub-model, the original vertex information of the original model also needs to be sent to the vertex shader. Specifically, a model can be composed of multiple facets, and each facet can be composed of at least three vertices. Based on this, it can be understood that the original vertex information is the position information of each vertex that constitutes the model, for example, the coordinates of each vertex in a three-dimensional space coordinate system. It can be understood that after the vertex shader receives the attributes and the original vertex information, it can rely on the GPU's image processing capabilities to render the corresponding model.

[0046] In this embodiment, after performing the aforementioned preprocessing on the original model and displaying the current model on the display interface, touch events can be detected to determine the touch attributes of the target touch point. A touch event can be an event generated based on a user touch operation. The target touch point is the corresponding touch point generated in the virtual space where the model resides after the user performs the touch operation. Correspondingly, the touch point attributes are the specific position information of the target touch point relative to the current model. For example, when a user taps a piece of pottery displayed on the touch screen, the application can generate a corresponding touch event based on the tap operation. Simultaneously, the point generated in the virtual space corresponding to the user's touch operation is determined as the target touch point, and the coordinates of the point in the three-dimensional space coordinate system are used as the touch attributes.

[0047] In actual application, after a touch event is detected, the original touch point on the display interface and the target straight line to which the original touch point and viewpoint information belong can be determined; the intersection information of the target straight line and the target cross-section of the current model is used as the target touch point, and the coordinate information of the target touch point is used as the touch point attribute.

[0048] Among them, the original touch point is the touch point generated by the user on the touch screen. At the same time, since there is a virtual camera consistent with the user's viewpoint in the three-dimensional space constructed by the application, the ray emitted by the virtual camera based on the original touch point can be used as the target line. Furthermore, in order to accurately determine which point on the model the user touched, it is also necessary to determine the section of the model in the XOY plane in the three-dimensional space coordinate system (when the Z axis is parallel to the target line), and use the section as the target cross section. On the basis of the above, when the target line and the target cross section have an intersection, the intersection can be used as the target touch point, indicating that the user has clicked on the current model. Correspondingly, the coordinates of the intersection in the three-dimensional space coordinate system are the touch point attributes.

[0049] It should be noted that when there is no intersection between the target straight line and the target cross section of the current model, it indicates that the user did not click on the current model in the display interface through the touch screen. Therefore, the data can be deleted from the buffer and subsequent touch events can continue to be detected.

[0050] S120: The sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attributes.

[0051] In this embodiment, after the target touch point and its corresponding touch point attributes are determined, it can be determined which sub-model the touch point corresponds to, so that the sub-model can be used as the sub-model to be adjusted. It can be understood that in the final presented image, at least the shape of the sub-model to be adjusted needs to be changed according to the user's wishes.

[0052] In actual applications, the coordinate information of the target touch point can be used to determine the sub-model to which the target touch point belongs. For example, if the current model is a cylindrical model divided into 10 segments, if the target touch point is determined to correspond to the third sub-model from the top to the bottom, then this segment can be used as the sub-model to be adjusted.

[0053] At the same time, in order to determine the change amount of the sub-model to be adjusted in subsequent processing, it is also necessary to determine two associated sub-models adjacent to the sub-model to be adjusted, where the two associated sub-models include a first associated sub-model and a second associated sub-model. Optionally, based on the height information of each sub-model, the first associated sub-model located above the sub-model to be adjusted and the second associated sub-model located below the sub-model to be adjusted are determined.

[0054] Continuing with the above example, when the third sub-model is determined to be the sub-model to be adjusted, and the value of the center point of the sub-model in the y-axis direction is determined to be 2, the segment model with a center point value of 4 in the y-axis direction above the sub-model to be adjusted can be determined as the first associated sub-model based on the height of each segment model in the three-dimensional space coordinate system, and the segment model with a center point value of 2 in the y-axis direction below the sub-model to be adjusted can be determined as the second associated sub-model.

[0055] S130 : Determine the attributes to be adjusted of the sub-model to be adjusted according to the touch point attributes and the sub-model attributes of the two associated sub-models, and update the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted.

[0056] Among them, the sub-model attributes include the sub-model radius. It can be understood that after determining the coordinate value of the target touch point and the radii of the upper and lower base surfaces of the cylinder corresponding to the two associated sub-models, the radii of the upper and lower base surfaces of the cylinder corresponding to the sub-model to be adjusted can be adjusted based on the above data.

[0057] Optionally, determine the first distance information between the target touch point and the lower bottom surface of the first associated sub-model in the first direction, and the second distance information between the target touch point and the upper bottom surface of the second associated sub-model; and obtain the adjusted radius information of the sub-model to be adjusted by analyzing the first distance information, the second distance information, the sub-model radii of the two associated sub-models, and the sub-model radius of the sub-model to be adjusted.

[0058] Continuing with the above example, after determining the coordinate information of the target touch point, and that the second segment sub-model above the sub-model to be adjusted is the first associated sub-model, and the fourth segment sub-model below the sub-model to be adjusted is the second associated sub-model, the distance value of the point from the lower bottom surface of the second segment sub-model and the distance value of the point from the upper bottom surface of the fourth terminal model can be determined based on the coordinate value of the target touch point in three-dimensional space. It can be understood that when the upper and lower ground surfaces of each sub-model are parallel to the XOZ plane of the three-dimensional space coordinate system, the first distance information and the second distance information can be determined based on the height corresponding to the lower bottom surface of the second segment sub-model (the value corresponding to the y-axis), the height corresponding to the upper bottom surface of the fourth terminal model, and the height of the target touch point.

[0059] Furthermore, after determining the first distance information, the second distance information, the submodel radii of the two associated submodels, and the submodel radius of the submodel to be adjusted, the above four data can be processed based on the curve algorithm to obtain the adjusted radius of the submodel to be adjusted.

[0060] For example, if the target touch point is determined to be 0.4 unit lengths from the lower surface of the second sub-model and 0.6 unit lengths from the upper surface of the fourth sub-model, and the radius of the second sub-model, the radius of the sub-model to be adjusted, and the radius of the fourth sub-model are all 1 unit length, this data can be processed using a curve algorithm to determine the adjusted radius of the sub-model to be adjusted. Compared to the original radius of 1 unit length of the sub-model to be adjusted, the adjusted radius is smaller, more consistent with the real-world effect of rotating a pottery blank to shrink a specific portion.

[0061] S140 , sending the sub-model attributes of each sub-model to the vertex shader, so that the vertex shader renders a target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model.

[0062] In this embodiment, after the radius of each sub-model is calculated based on the CPU, this data can be sent to the vertex shader corresponding to the GPU, and the vertex shader can be triggered to run, thereby relying on the GPU's capabilities to render a target image containing the adjusted model. For example, in the rendered target image, a pottery model is included in which the radius of a certain circle changes according to the user's touch point.

[0063] Optionally, in the process of sending the sub-model attributes to the vertex shader, the updated sub-model radius of each sub-model may be updated to the attribute array corresponding to the current model, and the attribute array may be sent to the vertex shader, so that the vertex shader renders the target image based on the sub-model radius stored in the attribute array and the pre-stored original vertex information.

[0064] The attribute array can be a vector generated based on multiple sub-model radii, and the original vertex information matches the original model corresponding to the current model. In actual application, the process of processing the received data by the vertex shader and rendering the target image can be based on the vertex shader receiving the attribute array; determining the target radius of the sub-model to which each original vertex information belongs based on the sub-model radius in the attribute array; and rendering the target image based on each original vertex information and the corresponding target radius.

[0065] For example, when the sub-model is a 10-segment cylindrical sub-model, a ten-dimensional vector can be constructed according to the radius of each segment of the cylindrical model. The vector is the attribute array. Further, after sending it to the vertex shader, the vertex shader can calculate the new vertex coordinates of each vertex in each cylinder adjusted according to the user touch point based on the radius value of the 10-segment cylindrical sub-model in the vector and the pre-stored vertex coordinates of each vertex in the 10-segment cylindrical sub-model, thereby constructing the adjusted model and rendering the target image containing the adjusted model.

[0066] Optionally, there are two ways to determine the target radius of the sub-model to which each original vertex information belongs. The first way is to determine the target sub-model to which the current original vertex information belongs for each original vertex information, and determine the bottom surface radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; based on the interpolation algorithm, determine the target radius of the circular plane where the current original vertex information is located.

[0067] Continuing with the above example, after the vertex shader has received the original vertex information of the 10-segment cylindrical sub-model, it can determine which segment of the cylindrical sub-model each vertex belongs to based on the coordinate value of each vertex in the three-dimensional space coordinate system; at the same time, after receiving the attribute array generated by the radius values ​​of the 10-segment cylindrical sub-model, the vertex shader can determine the radius of the lower base of the second sub-model and the radius of the upper base of the fourth sub-model.

[0068] Furthermore, after determining the above data, the vertex shader can calculate the target radius of the circular plane where the original vertex is located based on the interpolation algorithm, that is, the radius of some circular planes in the current model adjusted according to the user's touch operation. Among them, the interpolation algorithm is an algorithm that interpolates continuous functions on the basis of discrete data so that this continuous curve passes through all given discrete data points, such as linear interpolation algorithm, parabolic interpolation algorithm, polynomial interpolation algorithm and spline interpolation algorithm. It can be understood that in the above example, after calculation based on the interpolation algorithm, the radius of the circular plane where the original vertices of the third segment of the cylindrical sub-model are located, which is adjusted according to the user's touch operation, can be obtained.

[0069] The second method is to determine multiple arrays to be processed that belong to the same circular plane; for each array to be processed, determine the target sub-model to which any original vertex information in the current array to be processed belongs, and determine the bottom surface radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; based on the interpolation algorithm, determine the target radius of the circular plane to which the current array to be processed belongs.

[0070] The array to be processed includes at least one piece of original vertex information. Continuing with the above example, once the vertex shader has received the original vertex information for each of the 10 segments of the cylindrical sub-model, it can determine the circular plane to which each vertex belongs based on its coordinate value in the three-dimensional space coordinate system and construct the array to be processed based on the circular plane. It can be understood that each array to be processed contains the coordinate values ​​of multiple vertices.

[0071] Furthermore, based on the multiple pending arrays associated with the 10-segment cylindrical sub-models, the vertex shader can calculate the base radius of the upper and lower bases of the third segment sub-model, which is the sub-model to be adjusted. This is the new radius value generated based on the user's touch operation. Once the two radius values ​​are determined, the target radius of the circular plane containing the original vertex can also be calculated using a difference algorithm. This embodiment of the disclosure will not be further described here.

[0072] It should be noted that in this embodiment, if a touch event is detected again, a new model can be constructed according to the solution of this embodiment, and the corresponding image can be re-rendered based on the new model, thereby realizing dynamic adjustment of the model and continuously showing the user the visual effect of adjusting models such as pottery according to their own wishes.

[0073] The technical solution of the embodiment of the present disclosure is that when a touch event on the current model is detected, the touch attribute of the target touch point corresponding to the touch event is determined, that is, which point on the model the user touches is determined; the sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attribute; further, the to-be-adjusted attribute of the to-be-adjusted sub-model is determined according to the touch point attribute and the sub-model attributes of the two associated sub-models, and the to-be-adjusted attribute is updated to the sub-model attribute of the to-be-adjusted sub-model; the sub-model attributes of each sub-model are sent to the vertex shader so that the vertex shader The shader renders the target image after the current model is touched based on the attributes of each sub-model and the original vertex information, and uses the model displayed in the target image as the current model. The target image can be obtained by having the CPU perform coarse-grained calculations and pass the calculation results to the GPU, avoiding the problem of program performance bottlenecks caused by the CPU performing large amounts of calculations. At the same time, by significantly reducing the interaction between the CPU and the GPU, the limitations of the GPU communication bandwidth on the program processing process are reduced, further improving the processing efficiency of related programs and enhancing the user experience of making models such as pottery in virtual scenes.

[0074] Example 2

[0075] Figure 2 This is a schematic diagram of a device structure for rendering a target image provided by the second embodiment of the present disclosure, such as Figure 2As shown, the apparatus includes: a touch point attribute determination module 210 , a to-be-adjusted sub-model determination module 220 , a to-be-adjusted attribute update module 230 , and a sub-model attribute sending module 240 .

[0076] The touch point attribute determination module 210 is configured to determine the touch point attributes of a target touch point corresponding to a touch event when a touch event on a current model is detected; wherein the current model includes a plurality of sub-models.

[0077] The sub-model to be adjusted determining module 220 is configured to take the sub-model to which the target touch point belongs as the sub-model to be adjusted, and determine two associated sub-models adjacent to the sub-model to be adjusted according to the touch point attributes.

[0078] The attribute updating module 230 is configured to determine the attribute to be adjusted of the sub-model to be adjusted according to the touch point attribute and the sub-model attributes of the two associated sub-models, and update the attribute to be adjusted to the sub-model attribute of the sub-model to be adjusted.

[0079] The sub-model attribute sending module 240 is used to send the sub-model attributes of each sub-model to the vertex shader, so that the vertex shader renders the target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model; wherein the original vertex information matches the original model corresponding to the current model.

[0080] Based on the above technical solutions, the device for rendering the target image also includes a model division module.

[0081] A model division module is used to divide the original model into multiple sub-models according to the height information of the original model in the first direction; wherein the bottom surface of the original model is circular; determine the original height information and the original radius information of the upper and lower bottom surfaces of each sub-model, and send the identification, original height information and original radius information of each sub-model as sub-model attributes to the vertex shader; and send the vertex information of the original model to the vertex shader, so that when a touch event is detected on the original model, the corresponding sub-model attributes are determined and the sub-model attributes are sent to the vertex shader, so that the vertex shader updates the original model based on the sub-model attributes and each vertex information to obtain the current model.

[0082] On the basis of the above technical solutions, the touch point attribute determination module 210 includes an original touch point determination unit and a touch point attribute determination unit.

[0083] The original touch point determining unit is used to determine the original touch point on the display interface and the target straight line to which the original touch point and viewpoint information belong.

[0084] The touch point attribute determination unit is configured to use the intersection information of the target straight line and the target cross section of the current model as the target touch point, and use the coordinate information of the target touch point as the touch point attribute.

[0085] On the basis of the above technical solutions, the two associated sub-models include a first associated sub-model and a second associated sub-model, and the sub-model to be adjusted determining module 220 includes a sub-model to be adjusted determining unit and an associated sub-model determining unit.

[0086] The sub-model to be adjusted determining unit is configured to determine the sub-model to be adjusted to which the target touch point belongs according to the coordinate information of the target touch point.

[0087] The associated sub-model determining unit is configured to determine, based on height information of each sub-model, a first associated sub-model located above the sub-model to be adjusted and a second associated sub-model located below the sub-model to be adjusted.

[0088] On the basis of the above technical solutions, the sub-model attributes include the sub-model radius, and the to-be-adjusted attribute updating module 230 includes a distance information determining unit and a to-be-adjusted radius information determining unit.

[0089] The distance information determining unit is configured to determine first distance information between the target touch point and the lower bottom surface of the first associated sub-model in a first direction, and second distance information between the target touch point and the upper bottom surface of the second associated sub-model.

[0090] The to-be-adjusted radius information determining unit is configured to obtain the to-be-adjusted radius information of the to-be-adjusted submodel by processing the first distance information, the second distance information, the submodel radii of the two associated submodels, and the submodel radius of the to-be-adjusted submodel.

[0091] Optionally, the sub-model attribute sending module 240 is also used to update the updated sub-model radius of each sub-model to the attribute array corresponding to the current model, and send the attribute array to the vertex shader, so that the vertex shader renders the target image based on the sub-model radius stored in the attribute array and the pre-stored original vertex information.

[0092] On the basis of the above technical solutions, the device for rendering a target image further includes a target image rendering module.

[0093] The target image rendering module is used to receive the attribute array based on the vertex shader; determine the target radius of the sub-model to which each original vertex information belongs according to the sub-model radius in the attribute array; and render a target image based on each original vertex information and the corresponding target radius.

[0094] Optionally, the target image rendering module is also used to determine, for each piece of original vertex information, the target sub-model to which the current original vertex information belongs, and determine the bottom radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; based on the interpolation algorithm, determine the target radius of the circular plane where the current original vertex information is located.

[0095] Optionally, the target image rendering module is also used to determine multiple arrays to be processed belonging to the same circular plane; wherein the array to be processed includes at least one original vertex information; for each array to be processed, determine the target sub-model to which any original vertex information in the current array to be processed belongs, and determine the bottom surface radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; based on the interpolation algorithm, determine the target radius of the circular plane to which the current array to be processed belongs.

[0096] On the basis of the above technical solutions, the current model is an axisymmetric model, and the bottom surface of the current model is circular.

[0097] The technical solution provided by this embodiment is as follows: when a touch event on the current model is detected, the touch attribute of the target touch point corresponding to the touch event is determined, that is, which point on the model the user touches is determined; the sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attribute; further, the attributes to be adjusted of the sub-model to be adjusted are determined according to the touch point attribute and the sub-model attributes of the two associated sub-models, and the attributes to be adjusted are updated to the sub-model attributes of the sub-model to be adjusted; the sub-model attributes of each sub-model are sent to the vertex shader to make the vertex Based on the attributes of each sub-model and the original vertex information, the shader renders the target image after the current model is touched, and uses the model displayed in the target image as the current model. The target image can be obtained by simply having the CPU perform coarse-grained calculations and pass the calculation results to the GPU, avoiding the problem of program performance bottlenecks caused by the CPU performing large amounts of calculations. At the same time, by significantly reducing the interaction between the CPU and the GPU, the limitations of the GPU communication bandwidth on the program processing process are reduced, further improving the processing efficiency of related programs and enhancing the user experience of making models such as pottery in virtual scenes.

[0098] The device for rendering a target image provided by the embodiments of the present disclosure can execute the method for rendering a target image provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.

[0099] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0100] Example 3

[0101] Figure 3 This is a structural diagram of an electronic device provided by the third embodiment of the present disclosure. Figure 3 , which shows an electronic device (eg Figure 3 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0102] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a pattern processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.

[0103] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0104] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0105] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0106] The electronic device provided by the embodiment of the present disclosure and the method for rendering a target image provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0107] Example 4

[0108] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the method for rendering a target image provided by the above embodiment is implemented.

[0109] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0110] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0111] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0112] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0113] When a touch event on a current model is detected, determining a touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models;

[0114] The sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attributes;

[0115] Determining the attributes to be adjusted of the sub-model to be adjusted according to the touch point attributes and the sub-model attributes of the two associated sub-models, and updating the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted;

[0116] Sending the sub-model attributes of each sub-model to a vertex shader, so that the vertex shader renders a target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model;

[0117] The original vertex information matches the original model corresponding to the current model.

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

[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0121] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0122] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] According to one or more embodiments of the present disclosure, [Example 1] provides a method for rendering a target image, the method comprising:

[0124] When a touch event on a current model is detected, determining a touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models;

[0125] The sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attributes;

[0126] Determining the attributes to be adjusted of the sub-model to be adjusted according to the touch point attributes and the sub-model attributes of the two associated sub-models, and updating the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted;

[0127] Sending the sub-model attributes of each sub-model to a vertex shader, so that the vertex shader renders a target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model;

[0128] The original vertex information matches the original model corresponding to the current model.

[0129] According to one or more embodiments of the present disclosure, [Example 2] provides a method for rendering a target image, the method further comprising:

[0130] Optionally, the original model is divided into a plurality of sub-models according to height information of the original model in the first direction; wherein the bottom surface of the original model is circular;

[0131] Determine the original height information and the original radius information of the upper and lower bottom surfaces of each sub-model, and send the identifier, original height information, and original radius information of each sub-model as sub-model attributes to the vertex shader; and

[0132] The vertex information of the original model is sent to the vertex shader, so that when a touch event on the original model is detected, the corresponding sub-model attributes are determined and the sub-model attributes are sent to the vertex shader, so that the vertex shader updates the original model based on the sub-model attributes and each vertex information to obtain the current model.

[0133] According to one or more embodiments of the present disclosure, [Example 3] provides a method for rendering a target image, the method further comprising:

[0134] Optionally, determining an original touch point on the display interface, and a target straight line to which the original touch point and viewpoint information belong;

[0135] The intersection information of the target straight line and the target cross section of the current model is used as the target touch point, and the coordinate information of the target touch point is used as the touch point attribute.

[0136] According to one or more embodiments of the present disclosure, [Example 4] provides a method for rendering a target image, wherein the two associated sub-models include a first associated sub-model and a second associated sub-model, and the method further includes:

[0137] Optionally, determining the sub-model to be adjusted to which the target touch point belongs according to the coordinate information of the target touch point;

[0138] According to the height information of each sub-model, a first associated sub-model located above the sub-model to be adjusted and a second associated sub-model located below the sub-model to be adjusted are determined.

[0139] According to one or more embodiments of the present disclosure, [Example 5] provides a method for rendering a target image, wherein the sub-model attribute includes a sub-model radius, and the method further includes:

[0140] Optionally, determining first distance information between the target touch point and the lower bottom surface of the first associated sub-model in a first direction, and second distance information between the target touch point and the upper bottom surface of the second associated sub-model;

[0141] The radius information to be adjusted of the submodel to be adjusted is obtained by processing the first distance information, the second distance information, the submodel radii of the two associated submodels, and the submodel radius of the submodel to be adjusted.

[0142] According to one or more embodiments of the present disclosure, [Example 6] provides a method for rendering a target image, the method further comprising:

[0143] The updated sub-model radius of each sub-model is updated into an attribute array corresponding to the current model, and the attribute array is sent to the vertex shader, so that the vertex shader renders a target image based on the sub-model radius stored in the attribute array and the pre-stored original vertex information.

[0144] According to one or more embodiments of the present disclosure, [Example 7] provides a method for rendering a target image, the method further comprising:

[0145] Optionally, receiving the attribute array based on the vertex shader;

[0146] Determining the target radius of the sub-model to which each original vertex information belongs according to the sub-model radius in the attribute array;

[0147] Render the target image based on the original vertex information and the corresponding target radius.

[0148] According to one or more embodiments of the present disclosure, [Example 8] provides a method for rendering a target image, the method further comprising:

[0149] Optionally, for each piece of original vertex information, determining the target sub-model to which the current original vertex information belongs, and determining the bottom radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array;

[0150] Based on an interpolation algorithm, a target radius of the circular plane where the current original vertex information is located is determined.

[0151] According to one or more embodiments of the present disclosure, [Example 9] provides a method for rendering a target image, the method further comprising:

[0152] Optionally, a plurality of arrays to be processed belonging to the same circular plane are determined; wherein the arrays to be processed include at least one original vertex information;

[0153] For each array to be processed, determining the target sub-model to which any original vertex information in the current array to be processed belongs, and determining the bottom surface radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array;

[0154] Based on the interpolation algorithm, a target radius of the circular plane to which the current array to be processed belongs is determined.

[0155] According to one or more embodiments of the present disclosure, [Example 10] provides a method for rendering a target image, the method further comprising:

[0156] Optionally, the current model is an axisymmetric model, and the bottom surface of the current model is circular.

[0157] According to one or more embodiments of the present disclosure, [Example 11] provides a device for rendering a target image, the device including:

[0158] a touch point attribute determination module, configured to, when a touch event on a current model is detected, determine the touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models;

[0159] a sub-model to be adjusted determining module, configured to take the sub-model to which the target touch point belongs as the sub-model to be adjusted, and determine two associated sub-models adjacent to the sub-model to be adjusted according to the touch point attributes;

[0160] a to-be-adjusted attribute updating module, configured to determine the to-be-adjusted attribute of the to-be-adjusted sub-model according to the touch point attribute and the sub-model attributes of the two associated sub-models, and update the to-be-adjusted attribute to the sub-model attribute of the to-be-adjusted sub-model;

[0161] A sub-model attribute sending module is used to send the sub-model attributes of each sub-model to the vertex shader, so that the vertex shader renders the target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model; wherein the original vertex information matches the original model corresponding to the current model.

[0162] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0163] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0164] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A method for rendering a target image, characterized in that: include: When a touch event on a current model is detected, determining a touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models; The submodel to which the target touch point belongs is used as the submodel to be adjusted, and two associated submodels adjacent to the submodel to be adjusted are determined according to the touch point attributes, wherein the two associated submodels are determined according to height information of multiple submodels of the current model; Determining the attributes to be adjusted of the sub-model to be adjusted according to the touch point attributes and the sub-model attributes of the two associated sub-models, and updating the attributes to be adjusted to the sub-model attributes of the sub-model to be adjusted; Sending the sub-model attributes of each sub-model to a vertex shader, so that the vertex shader renders a target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model; The original vertex information matches the original model corresponding to the current model.

2. The method according to claim 1, characterized in that Also includes: Dividing the original model into a plurality of sub-models according to height information of the original model in the first direction; wherein the bottom surface of the original model is circular; Determine the original height information and the original radius information of the upper and lower bottom surfaces of each sub-model, and send the identifier, original height information, and original radius information of each sub-model as sub-model attributes to the vertex shader; and The vertex information of the original model is sent to the vertex shader, so that when a touch event on the original model is detected, the corresponding sub-model attributes are determined and the sub-model attributes are sent to the vertex shader, so that the vertex shader updates the original model based on the sub-model attributes and each vertex information to obtain the current model.

3. The method according to claim 1, characterized in that The determining of the touch point attribute of the target touch point corresponding to the touch event includes: Determine an original touch point on the display interface, and a target straight line to which the original touch point and viewpoint information belong; The intersection information of the target straight line and the target cross section of the current model is used as the target touch point, and the coordinate information of the target touch point is used as the touch point attribute.

4. The method according to claim 1, wherein The two associated sub-models include a first associated sub-model and a second associated sub-model, and the sub-model to which the target touch point belongs is used as the sub-model to be adjusted, and two associated sub-models adjacent to the sub-model to be adjusted are determined according to the touch point attributes, including: Determining the sub-model to be adjusted to which the target touch point belongs according to the coordinate information of the target touch point; According to the height information of each sub-model, a first associated sub-model located above the sub-model to be adjusted and a second associated sub-model located below the sub-model to be adjusted are determined.

5. The method according to claim 4, characterized in that The sub-model attribute includes a sub-model radius, and determining the attribute to be adjusted of the sub-model to be adjusted according to the touch point attribute and the sub-model attributes of the two associated sub-models includes: Determine first distance information between the target touch point and the lower bottom surface of the first associated sub-model in a first direction, and second distance information between the target touch point and the upper bottom surface of the second associated sub-model; The radius information to be adjusted of the submodel to be adjusted is obtained by processing the first distance information, the second distance information, the submodel radii of the two associated submodels, and the submodel radius of the submodel to be adjusted.

6. The method according to claim 5, characterized in that The sending of the sub-model attributes of each sub-model to the vertex shader includes: The updated sub-model radius of each sub-model is updated into an attribute array corresponding to the current model, and the attribute array is sent to the vertex shader, so that the vertex shader renders a target image based on the sub-model radius stored in the attribute array and the pre-stored original vertex information.

7. The method according to claim 6, characterized in that Also includes: receiving the attribute array based on the vertex shader; Determining the target radius of the sub-model to which each original vertex information belongs according to the sub-model radius in the attribute array; Render the target image based on the original vertex information and the corresponding target radius.

8. The method according to claim 7, characterized in that Determining the target radius of the sub-model to which each original vertex information belongs according to the sub-model radius in the attribute array includes: For each original vertex information, determining the target sub-model to which the current original vertex information belongs, and determining the bottom radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; Based on an interpolation algorithm, a target radius of the circular plane where the current original vertex information is located is determined.

9. The method according to claim 7, characterized in that Determining the target radius of the sub-model to which each original vertex information belongs according to the sub-model radius in the attribute array includes: Determine a plurality of arrays to be processed belonging to the same circular plane; wherein the arrays to be processed include at least one original vertex information; For each array to be processed, determining the target sub-model to which any original vertex information in the current array to be processed belongs, and determining the bottom surface radius of the upper and lower bottom surfaces of the target sub-model based on the attribute array; Based on the interpolation algorithm, a target radius of the circular plane to which the current array to be processed belongs is determined.

10. The method according to claim 1, characterized in that The current model is an axisymmetric model, and the bottom surface of the current model is circular.

11. A device for rendering a target image, characterized in that: include: a touch point attribute determination module, configured to, when a touch event on a current model is detected, determine the touch point attribute of a target touch point corresponding to the touch event; wherein the current model includes a plurality of sub-models; a sub-model to be adjusted determining module, configured to take the sub-model to which the target touch point belongs as the sub-model to be adjusted, and determine two associated sub-models adjacent to the sub-model to be adjusted based on the touch point attributes, wherein the two associated sub-models are determined based on height information of multiple sub-models of the current model; a to-be-adjusted attribute updating module, configured to determine the to-be-adjusted attribute of the to-be-adjusted sub-model according to the touch point attribute and the sub-model attributes of the two associated sub-models, and update the to-be-adjusted attribute to the sub-model attribute of the to-be-adjusted sub-model; A sub-model attribute sending module is used to send the sub-model attributes of each sub-model to the vertex shader, so that the vertex shader renders the target image after the current model is touched according to the sub-model attributes and the original vertex information, and uses the model displayed in the target image as the current model; wherein the original vertex information matches the original model corresponding to the current model.

12. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for rendering a target image according to any one of claims 1 to 10.

13. A storage medium comprising computer executable instructions, wherein when the computer executable instructions are executed by a computer processor, the computer executable instructions are used to perform the method for rendering a target image according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image special effect implementation method and device, electronic equipment and storage medium

    CN111833461A

  • Image rendering method and apparatus, and electronic device

    US20220005255A1