Rendering method and device, electronic equipment and storage medium

By using template testing and buffer update methods in shooting games, the poor aiming effect caused by shooting prop design is solved, and the rendering effect is achieved without blocking the perspective area, which improves the accuracy of players' aiming.

CN119444971APending Publication Date: 2025-02-14NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411473020.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In shooting game scenes, due to the design of shooting props, components outside the scope block some areas, limiting the scenes that players see through the scope, resulting in poor aiming effect.

Method used

By obtaining the first model and the second model in the target screen to be rendered, wherein the first model has a perspective area, the reference value for template testing is respectively configured. Write the first reference value into the preset template buffer, perform template testing based on the second reference value and template value, determine whether the model part of the second model overlaps with the first model, and update the template value to render the unobstructed target Screen.

Benefits of technology

The second model avoids obstructing the perspective area of ​​the first model, improves the aiming effect of the player when aiming with shooting props, and improves the effect of the game screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444971A_ABST
    Figure CN119444971A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering method and device, electronic equipment and a computer readable storage medium. The rendering method comprises the steps of obtaining a first model and a second model contained in a to-be-rendered target picture; writing the first reference value as a template value into a preset template buffer area corresponding to the target picture; based on the second reference value and the template value in the preset template buffer area, template testing of the second model is carried out; when the template test of the second model is carried out, if a target second reference value matched with the first reference value in the preset template buffer area exists in the plurality of second reference values, determining that a model part corresponding to the target second reference value does not pass the template test; according to a model part passing the template test in the second model, updating a template value in a preset template buffer area; and based on the template value in the preset template buffer area, rendering a target picture containing the first model and the second model so as to improve the aiming effect when the player aims by using the shooting prop.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Under the wave of the Internet, the continuous development and evolution of hardware and software technologies have promoted the emergence of smart devices and software. At the same time, a large number of games with different themes have emerged to meet the needs of users. For example, in shooting game scenes, in order to help players aim and shoot targets more accurately, it is necessary to use the scopes that come with shooting props such as guns to aim and improve shooting accuracy.

[0003] At present, due to the design of the shooting props themselves, the size or shape of the components outside the scope of the shooting props will block part of the area in the precision scope, thereby limiting the scene seen by the player through the scope, resulting in poor aiming effect when the player uses the shooting props to aim. Summary of the invention

[0004] The embodiments of the present application provide a rendering method, device, electronic device and storage medium, which can improve the aiming effect of players when aiming with shooting props.

[0005] In a first aspect, an embodiment of the present application provides a rendering method, the method comprising:

[0006] Acquire a first model and a second model included in a target picture to be rendered, wherein at least a portion of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to respective parts of the second model;

[0007] Writing the first reference value as a template value into a preset template buffer corresponding to the target picture;

[0008] Based on the second reference value and the template value in the preset template buffer, performing a template test of the second model;

[0009] When performing the template test of the second model, if there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values, it is determined that the model part corresponding to the target second reference value does not pass the template test;

[0010] According to the model part in the second model that passes the template test, updating the template value in the preset template buffer;

[0011] Based on the template value in the preset template buffer, a target screen including the first model and the second model is rendered.

[0012] In a second aspect, an embodiment of the present application provides a rendering device, the device comprising:

[0013] A model acquisition module, used to acquire a first model and a second model included in a target picture to be rendered, wherein at least a part of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to various parts of the second model;

[0014] A reference value writing module, used for writing the first reference value as a template value into a preset template buffer corresponding to the target picture;

[0015] A template testing module, used for performing a template test of the second model based on the second reference value and the template value in the preset template buffer;

[0016] a comparison module, configured to, when performing the template test of the second model, determine that the model part corresponding to the target second reference value does not pass the template test if there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values;

[0017] An updating module, used for updating the template value in the preset template buffer according to the model part in the second model that passes the template test;

[0018] A rendering module is used to render a target picture including the first model and the second model based on the template value in the preset template buffer.

[0019] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any rendering method provided in the embodiment of the present application.

[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any rendering method provided in an embodiment of the present application.

[0021] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of any rendering method provided in the embodiment of the present application.

[0022] According to the scheme of the embodiment of the present application, a target model included in a target screen to be rendered can be obtained, wherein the components of the target model include a first model and a second model, and at least part of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, and the plurality of second reference values ​​correspond to the respective parts of the second model. Then, the first reference value can be written as a template value into a preset template buffer corresponding to the target screen, which means that the first model with a perspective area can be rendered in its entirety, and the template test of the second model can also be performed based on the second reference value and the template value in the preset template buffer, which means that it is determined whether the model part corresponding to the second reference value overlaps with the first model, that is, when performing the template test of the second model, if there is a target second reference value among the plurality of second reference values ​​that matches the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test. Finally, the template value in the preset template buffer is updated according to the model part in the second model that passes the template test, that is, the model part in the second model that does not overlap with the first model, so as to render the target screen including the target model based on the template value in the preset template buffer, so that the second model in the target model of the rendered target screen does not contain the model part that blocks the first model, thereby avoiding the situation that limits the scene seen by the player through the scope, and improving the aiming effect of the player when aiming with shooting props. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 It is a schematic diagram of an embodiment of the rendering method provided in the embodiments of the present application;

[0025] Figure 2 It is a schematic diagram of a shooting prop provided in an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of another shooting prop provided in an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of the structure of a rendering device provided in an embodiment of the present application;

[0028] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0030] Embodiments of the present application provide a rendering method, apparatus, electronic device, and computer-readable storage medium.

[0031] Specifically, this embodiment will be described from the perspective of a rendering device, which can be integrated into an electronic device, that is, the rendering method of the embodiment of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0032] The rendering method provided in the embodiment of the present application can be applied to a rendering system. The rendering system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0033] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0034] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0035] The rendering method of this embodiment obtains the first model and the second model included in the target screen to be rendered, wherein at least part of the area in the above-mentioned first model is a perspective area, and the above-mentioned first model and the above-mentioned second model are respectively configured with a first reference value and multiple second reference values ​​for template testing, wherein the above-mentioned multiple second reference values ​​respectively correspond to various parts of the above-mentioned second model; the above-mentioned first reference value is written as a template value into a preset template buffer corresponding to the above-mentioned target screen; based on the above-mentioned second reference value and the template value in the above-mentioned preset template buffer, the template test of the above-mentioned second model is performed; when performing the template test of the above-mentioned second model, if there is a target second reference value matching the first reference value in the preset template buffer among the above-mentioned multiple second reference values, it is determined that the model part corresponding to the above-mentioned target second reference value does not pass the template test; according to the model part in the above-mentioned second model that passes the template test, the template value in the above-mentioned preset template buffer is updated; based on the template value in the above-mentioned preset template buffer, the target screen including the above-mentioned first model and the above-mentioned second model is rendered, which can improve the aiming effect of the player when aiming with the shooting prop.

[0036] Please refer to Figure 1 Taking a terminal as an example, this embodiment provides a rendering method. The specific process of the rendering method may be as follows: Step 101 to Step 106, wherein:

[0037] Step 101: obtain a target model included in a target picture to be rendered, wherein components of the target model include a first model and a second model, at least a portion of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and multiple second reference values ​​for template testing, wherein the multiple second reference values ​​respectively correspond to respective parts of the second model.

[0038] Among them, the above-mentioned target screen is a screen that needs to be rendered on a graphical user interface. The target screen is provided with a first model and a second model. The first model and the second model can be independent models. The first model and the second model can be constructed into a model, such as a target model. The target model is composed of different components, and the components of the target model can include the first model and the second model.

[0039] Exemplarily, the above-mentioned target model can be applied to shooting scenes as a shooting prop, such as a firearm prop, and the first model with a perspective area in the target model can be a lens model of the sight part of the firearm prop, and the second model can be a barrel model of the barrel part of the firearm prop. The specific setting can be based on demand and is not limited here.

[0040] It is understandable that, when the target screen is rendered and displayed by the existing method, the perspective area of ​​one part of the target model in the target screen will be blocked by other parts, so that the player cannot observe the virtual scene through the perspective area well, such as Figure 2 As shown, Figure 2 The shooting props shown here include a barrel model and a lens model. Figure 2 As can be seen, Figure 2 The middle shadow area 201 is the area blocked by the lens barrel model in the lens model, which makes it difficult for the player to observe the game character in the lens.

[0041] Therefore, in order to facilitate the distinction between the first model and the second model, in this embodiment, the terminal can configure corresponding multiple reference values ​​for the first model and the second model respectively, and the multiple reference values ​​can correspond to various parts of the model respectively, that is, the first reference value corresponds to each part of the first model respectively, and the second reference value corresponds to each part of the second model respectively, so that the first reference value and the second reference value can be used to at least perform a template test on the second model to distinguish the area in the second model that overlaps with the first model having a perspective area.

[0042] Among them, the above-mentioned first reference value and the second reference value can be used to compare with the template value of each pixel in the preset template buffer in the template test to determine whether the model part of the corresponding model passes the template test. Among them, since the target picture is rendered, the size of the above-mentioned preset template buffer can match the size of the target picture, so that the template value corresponding to each pixel in the template buffer can be compared with the first reference value or the second reference value of the corresponding model part to clarify which model parts have not passed the template test.

[0043] The stencil test is a computer graphics technology that controls the rendering method through a stencil buffer. By performing per-pixel comparison, pixels that meet specific stencil conditions are drawn onto the screen, while pixels that do not meet the specific stencil conditions are discarded.

[0044] The above-mentioned pixel-by-pixel comparison refers to a comparison operation at the pixel level in image processing; the above-mentioned pixel culling refers to not rendering certain pixels in graphics processing, which is usually used to optimize rendering performance or achieve specific effects.

[0045] The stencil buffer is a technology used to control pixel drawing during the rendering process. It allows a stencil mask to be defined and determines whether to draw pixels based on the stencil mask. The stencil buffer can be implemented by setting stencil properties on the material or using stencil-related commands in the shader. The material is used to define a set of properties for the appearance of the surface of a 3D model. In a game engine, it is generally composed of a shader and a texture. It contains information describing the color, texture, reflectivity, transparency, gloss, etc. of the model surface, as well as properties that control how the model reflects, refracts, and scatters light.

[0046] The reference value is a value used in the template test and is used for comparison with the value in the template buffer.

[0047] In some embodiments, the target screen to be rendered may also include a third model to be rendered. The third model may be a model corresponding to a virtual object in a virtual scene, such as a model corresponding to a game character. Since the first model has a perspective area, and the second model and the third model need to be physically realized in the virtual scene, the first model generally uses one shader, and the third model and the second model are processed in another shader. Only one reference value can be set in one shader, which will cause the reference value of the third model to be the same as that of the second model, that is, the shader will assign the same reference value to the second model and the third model, which will cause the model part of the third model to be eliminated along with the template test of the second model.

[0048] Therefore, before performing a template test based on the second reference value and the template value in the preset template buffer, the terminal also needs to introduce a mask to perform corresponding reference value processing, so as to draw the second model and the third model in the game scene with different reference values ​​respectively, so as to avoid the template test of the second model affecting the third model, that is, the terminal can set the rendering layer where the renderer is located to a mask, such as setting the rendering layer corresponding to the first model to Layer20, and setting the rendering layer corresponding to the second model to Layer21, so as to perform a template test by setting the Layer layer, that is, only the model with the Layer layer needs to perform a template test, thereby avoiding the third model from performing a template test, and, in order to avoid the second model and the third model sharing the same reference value, the reference value corresponding to the second model and / or the third model can be updated based on the mask map corresponding to the second model, so that the reference values ​​of the third model and the second model are different.

[0049] Specifically, the terminal may obtain a mask image corresponding to the second model to modify the reference value assigned by the shader to the second model and / or the third model based on the mask image so that the reference values ​​of the second model and the third model are different.

[0050] Accordingly, when rendering the third model, the third model may be rendered on the target screen based on the reference value corresponding to the third model.

[0051] The mask map may correspond to the target image, so that which areas in the mask map are areas corresponding to the second model can be clearly identified based on the mask map, so that the reference value assigned to the third model by the shader based on the mask map may be modified, which may include:

[0052] The terminal may update the second reference value of the area corresponding to the second model so that the second reference value of the second model is different from the reference value of the third model; alternatively, the terminal may update the reference value of the area other than the second model to change the reference value of the third model; alternatively, the terminal may modify the reference value assigned to the third model by the shader based on the mask image and the position of the third model in the target screen; alternatively, the terminal may also simultaneously update the reference values ​​of the second model and the third model based on the mask so that the reference values ​​of the second model and the third model are different.

[0053] It can be understood that the above-mentioned shader is a program used to generate images in computer graphics, coloring objects on the screen.

[0054] Step 102: write the first reference value as a template value into a preset template buffer corresponding to the target image.

[0055] In this embodiment, in order to avoid the situation where certain model parts of the second model block the perspective area of ​​the first model, the terminal can first specify a rendering queue for the first model so that its rendering order is before the second model, that is, the first reference value corresponding to the first model can be written into the template buffer as a template value, so as to perform a template test on the second model based on the template value corresponding to each pixel in the template buffer, so as to eliminate the model parts in the second model that block the first model or not retain the model parts in the second model that block the first model.

[0056] The rendering queue can specify the order and priority of rendering to control the rendering order of different objects.

[0057] Specifically, the terminal can directly obtain the position of the first model in the target screen, and determine the pixel position corresponding to the first model in the template buffer based on the position of the first model in the target screen, so as to directly write the first reference value of the first model into the corresponding pixel position in the template buffer. Alternatively, the terminal can also perform a template test on the first model, and write the first reference value corresponding to the first model as a template value into a preset template buffer when the first model test passes. The specific setting can be made according to the needs and is not limited here.

[0058] In some embodiments, when a template test is required for the first model or the second model, the first model and the second model are also respectively provided with a template comparison function and a template operation value, wherein the template comparison function is used to determine the template test result of the first model or the second model during the template test, and the template operation value is used to indicate the update method of the preset template buffer when the template test of the first model or the second model passes.

[0059] Among them, the above-mentioned template comparison function (Stencil Comparison) is set with judgment conditions for the model when performing template testing. For example, the judgment conditions can be always passing conditions, equal conditions, not equal conditions, less than conditions, greater than conditions, etc., which can be set specifically according to needs and are not limited here. Therefore, the template test results of the above-mentioned first model or the above-mentioned second model during template testing can be determined according to the set judgment conditions.

[0060] Among them, the above-mentioned template operation value (Stencil Operation) is the operation value performed on the template buffer after the template test passes, which can indicate updating the template value, increasing the template value, decreasing the template value or maintaining the template value in the template buffer, etc., which can be set according to needs and is not limited here.

[0061] In some embodiments, the first model is further configured with a first template comparison function and a first template operation value. The first template comparison function is used to indicate that the template test result always passes the template test. If the first template comparison function is set to "always", it means that no matter what the value in the template buffer is, the result of comparison with the template buffer always meets the conditions, indicating that the template test always passes, that is, the pixels of the first model can pass the template test.

[0062] Correspondingly, the above-mentioned first template operation value is used to indicate that the first reference value of the model part that passes the template test is written into the above-mentioned preset template buffer as a template value. If the first template operation value is set to "Replace", the first reference value of the first model is written into the template buffer as a template value. In order to be able to use the first reference value representing the first model to perform a template test on the second model, the first reference value needs to be written into the preset template buffer.

[0063] Specifically, the above-mentioned writing of the above-mentioned first reference value as a template value into the preset template buffer corresponding to the above-mentioned target picture may include: the terminal may perform a template test based on the above-mentioned first template comparison function and the above-mentioned first reference value, and determine that the above-mentioned template test result of the model part corresponding to the first model is passed the template test, wherein, due to the setting of the first template comparison function, all model parts of the first model may pass the template test; then, when passing the template test, based on the above-mentioned first template operation value, the first reference value of the model part that passes the template test is written into the above-mentioned preset template buffer as a template value.

[0064] Exemplarily, the first reference value is set to 79, and when each model part of the first model passes the template test, the template value corresponding to the pixel point of the first model in the preset template buffer is written to 79.

[0065] Step 103: Perform a template test on the second model based on the second reference value and the template value in the preset template buffer.

[0066] In this embodiment, after the first reference value corresponding to the first model is written into the preset template buffer, when the template test is performed on the second model, the second reference value can be compared with the template value in the preset template buffer. The template value in the template buffer may include the first reference value and may also include the initial template value, that is, when setting the template buffer, the initial template value is set for each pixel in the template buffer. Therefore, the second reference value can be compared with the first reference value at certain positions in the preset template buffer, and can also be compared with the initial template value at other positions in the preset template buffer, so as to clarify whether each model part in the second model passes the template test based on the comparison result.

[0067] Step 104 , when performing the template test on the second model, if there is a target second reference value among the plurality of second reference values ​​that matches the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test.

[0068] In this embodiment, when the terminal is performing a template test on the second model, if there is a target second reference value among multiple second reference values ​​that matches the first reference value in the preset template buffer, that is, the target second reference value is compared with the template value corresponding to the first reference value. When the target second reference value matches the first reference value, it means that the model part corresponding to the target second reference value overlaps with the model part corresponding to the first reference value. In order to avoid the model part of the second model affecting the model part of the first model, it is necessary to determine that the model part corresponding to the target second reference value does not pass the template test.

[0069] Among them, the above-mentioned match may be that the second reference value is the same as the template value corresponding to the first reference value in the preset template buffer, and the above-mentioned match may also be that the second reference value is different from the template value corresponding to the first reference value in the preset template buffer. The specific details can be determined according to the setting of the template comparison function and are not limited here.

[0070] In some embodiments, when the first reference value is the same as the second reference value, the second model is also configured with a second template comparison function, and the second template comparison function is used to indicate that the template test result is through the template test when the second reference value is different from the template value in the preset template buffer.

[0071] It can be understood that since the first reference value is the same as the second reference value, when the second reference value is the same as the template value in the preset template buffer, it means that the template value may be the template value after the first reference value is written, that is, the second reference value is compared with the first reference value at this time. Therefore, it is necessary to determine that the model part corresponding to the second reference value with the same comparison result does not pass the template test, that is, when the second reference value is different from the template value in the preset buffer, it means that the model parts corresponding to the two do not overlap in the target picture, but can pass the template test.

[0072] Specifically, the template test of the second model based on the second reference value and the template value in the preset template buffer may include: the terminal may compare the multiple second reference values ​​with the template value in the preset template buffer through the second template comparison function to obtain a corresponding comparison result, that is, the second reference value is different from the template value in the preset template buffer, or the second reference value is the same as the template value in the preset template buffer.

[0073] Then, if there is a second reference value among the above-mentioned multiple second reference values ​​that is different from the template value in the above-mentioned preset template buffer, it is determined that the target model part passes the template test, and the above-mentioned target model part is the model part corresponding to the second reference value that is different from the template value in the above-mentioned preset template buffer.

[0074] Correspondingly, if there is a target second reference value among the multiple second reference values ​​that matches the first reference value in the preset template buffer, then determining that the model part corresponding to the target second reference value does not pass the template test may include: if there is a target second reference value among the multiple second reference values ​​that is the same as the first reference value in the preset template buffer, then determining that the model part corresponding to the target second reference value does not pass the template test and needs to be eliminated, that is, not rendered.

[0075] Exemplarily, the first reference value and the second reference value are both set to 79, and the second template comparison function is set to "Not Equal" to determine whether the second reference value is unequal to the template value in the template buffer. If they are unequal, the model part corresponding to the second reference value can be retained; if they are equal, the model part corresponding to the second reference value can be discarded.

[0076] It can be understood that since the first reference value is stored in the preset template buffer, that is, the preset template buffer is equivalent to storing the pixel position of the first model, the second reference value corresponding to the second model will be compared pixel by pixel in the preset template buffer. If the comparison result is the same, it means that this pixel point already exists in the model part of the first model, and this pixel of the second model needs to be discarded. That is, the final effect is that the area in the second model that overlaps with the first model is hollowed out, so as to avoid the second model affecting the first model.

[0077] In some embodiments, when the first reference value is different from the second reference value, the second model is further configured with a third template comparison function, and the third template comparison function is used to indicate that the template test result is through the template test when the second reference value is the same as the template value in the preset template buffer.

[0078] It can be understood that since the first reference value is different from the second reference value, when the second reference value is different from the template value in the preset template buffer, it means that the template value may be the template value after the first reference value is written, that is, it means that the second reference value is compared with the first reference value at this time. Therefore, it is necessary to determine that the model part corresponding to the second reference value with a different comparison result does not pass the template test, that is, when the second reference value is the same as the template value in the preset buffer, it means that the model parts corresponding to the two do not overlap in the target picture, but can pass the template test.

[0079] Specifically, the template test of the second model based on the second reference value and the template value in the preset template buffer may include: the terminal may compare the multiple second reference values ​​with the template value in the preset template buffer through the third template comparison function to obtain a corresponding comparison result, that is, the second reference value is different from the template value in the preset template buffer, or the second reference value is the same as the template value in the preset template buffer.

[0080] Then, if there is a second reference value in the above-mentioned second reference values ​​that is the same as the template value in the above-mentioned preset template buffer, the target model part passes the template test, and the above-mentioned target model part is the model part corresponding to the second reference value that is the same as the template value in the above-mentioned preset template buffer.

[0081] Correspondingly, if there is a target second reference value among the multiple second reference values ​​that matches the first reference value in the preset template buffer, then determining that the model part corresponding to the target second reference value does not pass the template test may include: if there is a target second reference value among the multiple second reference values ​​that is different from the first reference value in the preset template buffer, then determining that the model part corresponding to the target second reference value does not pass the template test.

[0082] Exemplarily, the first reference value is set to 79, the second reference value is set to 79&0, and the second template comparison function is set to "Equal" to determine whether the second reference value is equal to the template value in the template buffer. If they are equal, the model part corresponding to the second reference value can be retained. If they are not equal, the model part corresponding to the second reference value can be discarded.

[0083] Step 105: Update the template value in the preset template buffer according to the model part in the second model that passes the template test.

[0084] In this embodiment, the template value in the preset template buffer can be updated according to the model part in the second model that passes the template test, so that only the pixels that pass the template test are retained for rendering based on the template value in the template buffer.

[0085] In some embodiments, the second model is also configured with a second template operation value or a third template operation value; the second template operation value is used to indicate that the template value in the preset template buffer is kept unchanged when passing the template test, and the third template operation value is used to indicate that the reference value of the model part that passes the template test is written into the preset template buffer as a template value.

[0086] Specifically, updating the template value in the preset template buffer according to the model part in the second model that passes the template test may include: when the target model part passes the template test, keeping the template value in the preset template buffer unchanged based on the second template operation value, or, based on the third template operation value, writing the second reference value as the template value into the preset template buffer.

[0087] Exemplarily, the second template operation value is set to "Keep", that is, the template value in the preset template buffer is kept unchanged; the third template operation value is set to "Replace", that is, the second reference value of the second model is written into the template buffer as the template value.

[0088] Step 106: Render a target screen including the target model based on the template value in the preset template buffer.

[0089] In this embodiment, the terminal can clarify the model parts that need to be rendered in the first model and the second model based on the template values ​​in the above-mentioned preset template buffer. Since the first reference values ​​of the first model need to be written into the preset template buffer as template values, the first model needs to be rendered in its entirety, and only some model parts in the second model pass the template test. Only the model parts that pass the template test will be rendered on the target screen, thereby achieving the goal that the second model will not obscure the first model on the target screen.

[0090] It can be understood that by preventing the second model from blocking the field of view of the perspective area of ​​the first model, the effect of the game screen can be improved, thereby improving the picture effect of the target screen. For example, in a shooting scene, by preventing the barrel model from blocking the field of view of the lens model, the machine aiming effect when using the lens model to aim and shoot in the game can be improved, prompting players to aim more clearly and smoothly when using the target model to aim and shoot, avoiding their field of view from being blocked, thereby improving the user experience.

[0091] Furthermore, there is no need to create a new camera at the lens model to avoid the barrel model blocking the view of the lens model, so that the image seen by the camera can be projected onto the lens model, without consuming the resources and performance required for two renderings, thus reducing the extra rendering burden, reducing the resource consumption of the game when aiming, and improving the performance of the game, thereby improving the effect while controlling the performance consumption. The two renderings include the rendering corresponding to the perspective of the main camera and the perspective of the camera in the lens model.

[0092] For example, based on Figure 2For example, since there is an area in the lens model that is blocked by the lens barrel model, namely the shadow area 201, the model part occupying the shadow area 201 in the lens barrel model may not be rendered through the rendering method provided in this embodiment. Figure 3 As shown, in Figure 3 In the game, there is no obstructed shadow area in the lens model, which enables players to perform operations such as aiming and shooting just right, thereby improving the player's user experience.

[0093] In some embodiments, in some virtual scenes, the target screen to be rendered may also include a third model to be rendered, and through reference value processing, the reference value of the third model in the same shader as the second model is different from the second model, and the reference value of the third model may also be stored as a template value in a preset template buffer. Therefore, in this embodiment, the terminal may first draw the first model for template testing and the second model based on the template values ​​corresponding to the first model and the second model, and then draw the third model based on the template value corresponding to the third model, so as to avoid the second model blocking the perspective area in the first model while retaining the third model. For example, when the target model is a firearm prop, the barrel model of the second model will have part of the area hollowed out by the lens model of the first model, so that the barrel model will not block the lens model, and the game character model of the third model in the lens model will not be eliminated.

[0094] From the above content, it can be seen that by obtaining the target model contained in the target picture to be rendered, the component parts of the target model include the first model and the second model, and at least part of the area in the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and multiple second reference values ​​for template testing, and the multiple second reference values ​​correspond to the various parts of the second model. Then, the first reference value can be written as a template value into the preset template buffer corresponding to the target picture, that is, it means that the first model with the perspective area can be rendered in its entirety, and the template test of the second model can also be performed based on the second reference value and the template value in the preset template buffer, that is, it is determined whether the model part corresponding to the second reference value overlaps with the first model, that is, when performing the template test of the second model, if there is a target second reference value matching the first reference value in the preset template buffer among the multiple second reference values, it is determined that the model part corresponding to the target second reference value does not pass the template test. Finally, the template value in the preset template buffer is updated according to the model part in the second model that passes the template test, that is, the model part in the second model that does not overlap with the first model, so as to render the target screen including the target model based on the template value in the preset template buffer, so that the second model in the target model of the rendered target screen does not contain the model part that blocks the first model, thereby avoiding the situation that limits the scene seen by the player through the scope, and improving the aiming effect of the player when aiming with shooting props.

[0095] This embodiment also provides a rendering device, which can be integrated into a terminal device. Figure 4 As shown, the rendering device may include:

[0096] The model acquisition module 401 is used to acquire a target model included in a target picture to be rendered, wherein the component parts of the target model include a first model and a second model, at least a part of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to the respective parts of the second model;

[0097] A reference value writing module 402, used to write the first reference value as a template value into a preset template buffer corresponding to the target picture;

[0098] A template testing module 403, configured to perform a template test on the second model based on the second reference value and the template value in the preset template buffer;

[0099] A comparison module 404 is used for, when performing the template test of the second model, if there is a target second reference value among the plurality of second reference values ​​that matches the first reference value in the preset template buffer, determining that the model part corresponding to the target second reference value does not pass the template test;

[0100] An updating module 405, configured to update the template value in the preset template buffer according to the model part in the second model that passes the template test;

[0101] The rendering module 406 is used to render a target picture including the target model based on the template value in the preset template buffer.

[0102] In some embodiments, the target picture to be rendered further includes a third model to be rendered, the third model and the second model are processed in the same shader, and the rendering device further includes a reference value modification module, and the reference value modification module is specifically used to:

[0103] Obtain a mask image corresponding to the second model;

[0104] Based on the mask image, modify the reference value assigned by the shader to the second model and / or the third model so that the reference values ​​of the second model and the third model are different;

[0105] Also includes:

[0106] Based on the reference value corresponding to the third model, the third model is rendered on the target screen.

[0107] In some embodiments, the reference value modification module is specifically used to:

[0108] Based on the mask image and the position of the third model in the target picture, the reference value assigned to the third model by the shader is modified.

[0109] In some embodiments, the first model is further configured with a first template comparison function and a first template operation value, the first template comparison function is used to indicate that the template test result is always through the template test, and the first template operation value is used to indicate that the first reference value of the model part that passes the template test is written as the template value into the preset template buffer;

[0110] The reference value writing module 402 is specifically used for:

[0111] Performing a template test based on the first template comparison function and the first reference value, and determining that the template test result is a pass in the template test;

[0112] When the template test is passed, based on the first template operation value, the first reference value of the model part that passes the template test is written into the preset template buffer as a template value.

[0113] In some embodiments, the first reference value is the same as the second reference value, and the second model is further configured with a second template comparison function, and the second template comparison function is used to indicate that the template test result passes the template test when the second reference value is different from the template value in the preset template buffer;

[0114] The template testing module 403 is specifically used for:

[0115] By using the second template comparison function, the plurality of second reference values ​​are compared with the template values ​​in the preset template buffer;

[0116] If there is a second reference value different from the template value in the preset template buffer among the plurality of second reference values, it is determined that the target model part passes the template test, and the target model part is the model part corresponding to the second reference value different from the template value in the preset template buffer;

[0117] The comparison module 404 includes:

[0118] If there is a target second reference value in the plurality of second reference values ​​that is the same as the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test.

[0119] In some embodiments, the first reference value is different from the second reference value, and the second model is further configured with a third template comparison function, and the third template comparison function is used to indicate that the template test result passes the template test when the second reference value is the same as the template value in the preset template buffer;

[0120] The template testing module 403 is specifically used for:

[0121] By using the third template comparison function, the plurality of second reference values ​​are compared with the template values ​​in the preset template buffer;

[0122] If there is a second reference value in the second reference values ​​that is the same as the template value in the preset template buffer, the target model part passes the template test, and the target model part is the model part corresponding to the second reference value that is the same as the template value in the preset template buffer;

[0123] The comparison module 404 includes:

[0124] If there is a target second reference value among the plurality of second reference values ​​that is different from the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test.

[0125] In some embodiments, the second model is further configured with a second template operation value or a third template operation value;

[0126] The second template operation value is used to indicate that the template value in the preset template buffer is kept unchanged when the template test is passed, and the third template operation value is used to indicate that the reference value of the model part that passes the template test is written into the preset template buffer as the template value;

[0127] The above-mentioned updating module 405 is specifically used for:

[0128] When the target model part passes the template test, the template value in the preset template buffer is kept unchanged based on the second template operation value, or the second reference value is written into the preset template buffer as the template value based on the third template operation value.

[0129] From the above content, it can be seen that by obtaining the target model contained in the target picture to be rendered, the component parts of the target model include the first model and the second model, and at least part of the area in the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and multiple second reference values ​​for template testing, and the multiple second reference values ​​correspond to the various parts of the second model. Then, the first reference value can be written as a template value into the preset template buffer corresponding to the target picture, that is, it means that the first model with the perspective area can be rendered in its entirety, and the template test of the second model can also be performed based on the second reference value and the template value in the preset template buffer, that is, it is determined whether the model part corresponding to the second reference value overlaps with the first model, that is, when performing the template test of the second model, if there is a target second reference value matching the first reference value in the preset template buffer among the multiple second reference values, it is determined that the model part corresponding to the target second reference value does not pass the template test. Finally, the template value in the preset template buffer is updated according to the model part in the second model that passes the template test, that is, the model part in the second model that does not overlap with the first model, so as to render the target screen including the target model based on the template value in the preset template buffer, so that the second model in the target model of the rendered target screen does not contain the model part that blocks the first model, thereby avoiding the situation that limits the scene seen by the player through the scope, and improving the aiming effect of the player when aiming with shooting props.

[0130] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0131] like Figure 5 As shown, Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0132] The processor 501 is the control center of the electronic device 500, and uses various interfaces and lines to connect various parts of the entire electronic device 500. By running or loading software programs and / or units stored in the memory 502, and calling data stored in the memory 502, the processor 501 executes various functions of the electronic device 500 and processes data, thereby monitoring the electronic device 500 as a whole. The processor 501 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0133] In the embodiment of the present application, the processor 501 in the electronic device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions, such as:

[0134] Acquire a first model and a second model included in a target picture to be rendered, wherein at least a portion of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to respective parts of the second model;

[0135] Writing the first reference value as a template value into a preset template buffer corresponding to the target picture;

[0136] Based on the second reference value and the template value in the preset template buffer, performing a template test of the second model;

[0137] When performing the template test of the second model, if there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values, it is determined that the model part corresponding to the target second reference value does not pass the template test;

[0138] According to the model parts in the second model that pass the template test, updating the template value in the preset template buffer;

[0139] Based on the template value in the preset template buffer, a target screen including the first model and the second model is rendered.

[0140] Therefore, the electronic device 500 provided in this embodiment can bring the following technical effects: improving the aiming effect of the player when aiming with a shooting prop.

[0141] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0142] Optional, such as Figure 5 As shown, the electronic device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0143] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.

[0144] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.

[0145] The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another electronic device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0146] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0147] The power supply 507 is used to supply power to various components of the electronic device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0148] although Figure 5 Not shown, the electronic device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0150] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0151] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any rendering method provided in the embodiment of the present application. The computer program can execute the following steps of the rendering method:

[0152] Acquire a first model and a second model included in a target picture to be rendered, wherein at least a portion of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to respective parts of the second model;

[0153] Writing the first reference value as a template value into a preset template buffer corresponding to the target picture;

[0154] Based on the second reference value and the template value in the preset template buffer, performing a template test of the second model;

[0155] When performing the template test of the second model, if there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values, it is determined that the model part corresponding to the target second reference value does not pass the template test;

[0156] According to the model parts in the second model that pass the template test, updating the template value in the preset template buffer;

[0157] Based on the template value in the preset template buffer, a target screen including the first model and the second model is rendered.

[0158] It can be seen that the computer program can be loaded by the processor to execute any rendering method provided in the embodiments of the present application, thereby bringing the following technical effects: improving the aiming effect of the player when aiming with shooting props.

[0159] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0160] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0161] Since the computer program stored in the computer-readable storage medium can execute any rendering method provided in the embodiments of the present application, the beneficial effects that can be achieved by any rendering method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0162] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0163] In the above rendering device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described rendering device, computer-readable storage medium, computer program product, electronic device, and corresponding units can refer to the description of the rendering method in the above embodiment, and will not be repeated here.

[0164] The above is a detailed introduction to a rendering method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A rendering method, characterized in that: The method comprises: Acquire a first model and a second model included in a target picture to be rendered, wherein at least a portion of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to respective parts of the second model; Writing the first reference value as a template value into a preset template buffer corresponding to the target picture; Performing a template test of the second model based on the second reference value and the template value in the preset template buffer; When performing the template test of the second model, if there is a target second reference value among the plurality of second reference values ​​that matches the first reference value in the preset template buffer, determining that the model part corresponding to the target second reference value does not pass the template test; updating the template value in the preset template buffer according to the model part in the second model that passes the template test; Based on the template value in the preset template buffer, a target screen including the first model and the second model is rendered.

2. The rendering method according to claim 1, characterized in that: The target picture to be rendered further includes a third model to be rendered, and the third model and the second model are processed in the same shader. Before performing a template test of the second model based on the second reference value and the template value in the preset template buffer, the method further includes: Obtaining a mask image corresponding to the second model; Based on the mask map, modify the reference value assigned by the shader to the second model and / or the third model so that the reference values ​​of the second model and the third model are different; Also includes: The third model is rendered on the target screen based on the reference value corresponding to the third model.

3. The rendering method according to claim 2, characterized in that: Based on the mask image, modifying the reference value assigned by the shader to the third model comprises: Based on the mask image and the position of the third model in the target picture, a reference value assigned to the third model by the shader is modified.

4. The rendering method according to claim 1, characterized in that: The first model is further configured with a first template comparison function and a first template operation value, wherein the first template comparison function is used to indicate that the template test result is always through the template test, and the first template operation value is used to indicate that the first reference value of the model part that passes the template test is written as a template value into a preset template buffer; Writing the first reference value as a template value into a preset template buffer corresponding to the target picture includes: Performing a template test based on the first template comparison function and the first reference value, and determining that the template test result is a pass in the template test; When the template test is passed, based on the first template operation value, a first reference value of the model part that passes the template test is written into the preset template buffer as a template value.

5. The rendering method according to claim 1, characterized in that: The first reference value is the same as the second reference value, and the second model is further configured with a second template comparison function, and the second template comparison function is used to indicate that the template test result passes the template test when the second reference value is different from the template value in the preset template buffer; The performing a template test of the second model based on the second reference value and the template value in the preset template buffer includes: By using the second template comparison function, the plurality of second reference values ​​are compared with the template values ​​in the preset template buffer; If there is a second reference value different from the template value in the preset template buffer among the plurality of second reference values, it is determined that the target model part passes the template test, and the target model part is the model part corresponding to the second reference value different from the template value in the preset template buffer; If there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values, determining that the model part corresponding to the target second reference value does not pass the template test comprises: If there is a target second reference value in the plurality of second reference values ​​that is the same as the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test.

6. The rendering method according to claim 1, characterized in that: The first reference value is different from the second reference value, and the second model is further configured with a third template comparison function, and the third template comparison function is used to indicate that the template test result passes the template test when the second reference value is the same as the template value in the preset template buffer; The performing a template test of the second model based on the second reference value and the template value in the preset template buffer includes: By means of the third template comparison function, the plurality of second reference values ​​are compared with the template values ​​in the preset template buffer; If there is a second reference value in the second reference value that is the same as the template value in the preset template buffer, the target model part passes the template test, and the target model part is the model part corresponding to the second reference value that is the same as the template value in the preset template buffer; If there is a target second reference value matching the first reference value in the preset template buffer among the plurality of second reference values, determining that the model part corresponding to the target second reference value does not pass the template test comprises: If there is a target second reference value among the plurality of second reference values ​​that is different from the first reference value in the preset template buffer, it is determined that the model part corresponding to the target second reference value does not pass the template test.

7. The rendering method according to claim 5 or 6, characterized in that: The second model is also configured with a second template operation value or a third template operation value; The second template operation value is used to indicate that the template value in the preset template buffer is kept unchanged when the template test is passed, and the third template operation value is used to indicate that the reference value of the model part that passes the template test is written into the preset template buffer as the template value; The updating of the template value in the preset template buffer according to the model part in the second model that passes the template test includes: When the target model part passes the template test, the template value in the preset template buffer is kept unchanged based on the second template operation value, or the second reference value is written into the preset template buffer as the template value based on the third template operation value.

8. A rendering device, characterized in that: The device comprises: A model acquisition module, used to acquire a first model and a second model included in a target picture to be rendered, wherein at least a part of the first model is a perspective area, and the first model and the second model are respectively configured with a first reference value and a plurality of second reference values ​​for template testing, wherein the plurality of second reference values ​​respectively correspond to various parts of the second model; A reference value writing module, used for writing the first reference value as a template value into a preset template buffer corresponding to the target picture; A template testing module, configured to perform a template test on the second model based on the second reference value and the template value in the preset template buffer; a comparison module, configured to, when performing a template test on the second model, determine that a model portion corresponding to the target second reference value does not pass the template test if there is a target second reference value among the plurality of second reference values ​​that matches the first reference value in the preset template buffer; An updating module, used for updating the template value in the preset template buffer according to the model part in the second model that passes the template test; A rendering module is used to render a target picture including the first model and the second model based on the template value in the preset template buffer.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the rendering method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the rendering method according to any one of claims 1 to 7.