Display method and device in game, electronic equipment and readable storage medium

Through multiple vertex expansion, the color data of multi-layer hollowing and stroked parts is generated, and the existing virtual strokes are crowded and single, and the hollow ink stroke effect is achieved, which improves the sense of space and stylized expression.

CN119919553AActive Publication Date: 2025-05-02NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411846853.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-05-02
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

The existing virtual strokes appear crowded in the game, have poor spatial sense, and are single in appearance, lacking stylized brushstroke expression.

Method used

Through multiple vertex expansion, the color data of the multi-layer hollow and stroked parts is generated, and combined with the color and depth data of the virtual model, the hollow ink stroke effect is achieved.

Benefits of technology

It enhances the stroke space of the virtual model, and achieves a stylized ink brushstroke effect through the design of multi-layer hollowing and stroked parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919553A_ABST
    Figure CN119919553A_ABST
Patent Text Reader

Abstract

The invention discloses a display method and device in a game, electronic equipment and a readable storage medium, and relates to the technical field of computers. The method comprises the steps of rendering a model in response to a rendering instruction to obtain color data of the model; performing first vertex expansion on the model to obtain a first model; generating color data of the first hollow part based on the first model; performing second vertex expansion on the model to obtain a second model; generating color data of the second hollow part based on a second model; performing third vertex expansion on the model to obtain a third model; generating color data of the first stroked part based on a third model; performing fourth vertex expansion on the model to obtain a fourth model; generating color data of the second stroked part based on a fourth model; and according to the color depth data of the model, the color depth data of the first hollow part, the color depth data of the second hollow part, the color data of the first stroking part and the color data of the second stroking part, displaying the model with the hollow ink stroking effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the game, a virtual stroke can be generated for the virtual model. The virtual stroke can highlight the outline of the virtual model and improve the display effect of the virtual model.

[0003] However, current virtual strokes are usually closely attached to virtual models, appearing crowded, and having a poor sense of space. In addition, current virtual strokes are relatively simple in expression and lack stylized brushstroke expression. Summary of the invention

[0004] The present disclosure provides a display method, device, electronic device and readable storage medium in a game to solve or at least partially solve the above-mentioned problems, as follows.

[0005] In a first aspect, the present disclosure provides a display method in a game, wherein the game includes a virtual model, and the method includes:

[0006] In response to a rendering instruction for the virtual model, rendering the virtual model to obtain color data of the virtual model;

[0007] Performing a first vertex expansion on the virtual model to obtain a first model;

[0008] generating color data of a first hollow portion between the virtual model and the stroke portion based on the first model;

[0009] Performing a second vertex expansion on the virtual model to obtain a second model; wherein the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion;

[0010] generating color data of a second hollow portion located between the stroke portion and the first hollow portion based on the second model;

[0011] Performing a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some of the vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion;

[0012] generating color data of a first stroke portion among the stroke portions based on the third model;

[0013] Performing a fourth vertex expansion on the virtual model to obtain a fourth model; wherein the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion;

[0014] generating color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model;

[0015] The virtual model with a hollow ink stroke effect is displayed according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

[0016] In a second aspect, the present disclosure further provides a display device in a game, wherein the game includes a virtual model, and the device includes:

[0017] A rendering module, configured to render the virtual model in response to a rendering instruction for the virtual model, and obtain color data of the virtual model;

[0018] A first vertex expansion module, used for performing a first vertex expansion on the virtual model to obtain a first model;

[0019] A first generating module, configured to generate color data of a first hollow portion located between the virtual model and the stroke portion based on the first model;

[0020] A second vertex expansion module is used to perform a second vertex expansion on the virtual model to obtain a second model; the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion;

[0021] A second generating module, configured to generate color data of a second hollow portion located between the stroke portion and the first hollow portion based on the second model;

[0022] A third vertex expansion module, configured to perform a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some of the vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion;

[0023] A third generating module, configured to generate color data of a first stroke portion in the stroke portions based on the third model;

[0024] A fourth vertex expansion module, used for performing a fourth vertex expansion on the virtual model to obtain a fourth model; the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion;

[0025] a fourth generating module, configured to generate color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model;

[0026] A display module is used to display the virtual model with a hollow ink stroke effect based on the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

[0027] In a third aspect, the present disclosure further provides an electronic device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor;

[0028] When the processor executes the computer program instructions, the display method in the game as described in the first aspect above is implemented.

[0029] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to implement the display method in the game as described in the first aspect above.

[0030] The exemplary embodiments of the present disclosure have the following beneficial effects:

[0031] In an exemplary embodiment of the present disclosure, a model can be rendered in response to a rendering instruction to obtain color data of the model; the model can be expanded for the first time to obtain a first model; color data of the first hollow part can be generated based on the first model; the model can be expanded for the second time to obtain a second model; color data of the second hollow part can be generated based on the second model; the model can be expanded for the third time to obtain a third model; color data of the first stroke part can be generated based on the third model; the model can be expanded for the fourth time to obtain a fourth model; color data of the second stroke part can be generated based on the fourth model; and a model with a hollow ink stroke effect can be displayed according to the color depth data of the model, the color depth data of the first hollow part, the color depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part. In the present disclosure, a first hollow portion is generated to leave a certain distance between the stroke and the model, thereby achieving a hollow stroke effect and enhancing the spatial sense of the stroke; a second hollow portion is generated to give the side of the stroke facing the model a dry brushstroke effect in the ink painting style; the stroke is achieved by generating the first stroke portion; and the second stroke portion is generated to give the side of the stroke facing away from the model a dry brushstroke effect in the ink painting style. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a flow chart of a display method in a game provided by one of the embodiments of the present disclosure;

[0033] Figure 2is a schematic diagram of a hollow stroke effect provided by one of the embodiments of the present disclosure;

[0034] Figure 3 is a schematic diagram of a hollow stroke effect provided by one of the embodiments of the present disclosure;

[0035] Figure 4 is a block diagram of a display device in a game provided by one embodiment of the present disclosure;

[0036] Figure 5 It is a logical structure diagram of an electronic device for realizing display in a game provided by one of the embodiments of the present disclosure. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present disclosure.

[0038] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0039] It should be understood that in the embodiments of the present disclosure, "at least one" means one or more, and "more than one" means two or more. "And / or" is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "Including A, B and / or C" means including any one, any two, or any three of A, B, and C.

[0040] It should be understood that in the embodiments of the present disclosure, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, and B can also be determined according to A and / or other information.

[0041] In one embodiment of the present disclosure, the display method in the game can be run on a local terminal device or a server. When the display method in the game is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0042] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the display method in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0043] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0044] In a possible implementation, an embodiment of the present disclosure provides a display method in a game, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.

[0045] The execution subject of the method can be a terminal device or a server. The terminal device can be a desktop computer, a laptop computer, a tablet computer, a mobile phone, etc., or other electronic devices, which are not specifically limited in the present disclosure. The server is used to provide background services for the client of the application in the terminal device. For example, the server can be the background server of the above-mentioned application. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms, which are not specifically limited in the present disclosure.

[0046] Before describing the embodiments of the present disclosure in detail, related technical terms are first introduced.

[0047] 1. Multi-pass rendering

[0048] Multi-pass rendering refers to the process of dividing the rendering task into multiple stages (passes) during the rendering process of geometric graphics (such as vector graphics and 3D models). Each stage handles different tasks, and finally merges the results of these stages to generate the final image to be displayed. Each pass will go through the underlying process of graphics rendering, including vertex calculation, rasterization, shading, etc., to obtain a frame of data.

[0049] The present disclosure can obtain the desired virtual model with hollow ink stroking effect through multiple pass rendering, which will be described in detail in the embodiments of the present disclosure.

[0050] 2. Frame Buffer

[0051] The frame buffer is used to store and present the image data to be displayed. Each storage unit of the frame buffer corresponds to a pixel on the screen, and the entire frame buffer corresponds to a frame of image. The frame buffer includes a color buffer and a depth buffer (also called a Z buffer). The color buffer is used to store the color information of the pixel, and the depth buffer is used to store the depth information of the pixel, that is, the distance between the pixel and the virtual camera in the observation space.

[0052] During the rendering process, the color buffer can first receive the rendering results of the graphics color, and then can finally determine the color value of each pixel on the screen based on factors such as occlusion relationships.

[0053] During the rendering process, the visibility of pixels can be determined by depth testing to prevent rendering of obscured pixels and improve rendering efficiency. The depth test is to compare the depth value of the pixel corresponding to the current graphic on the screen with the depth value cached for the pixel in the current depth buffer, so as to determine the occlusion relationship between the current graphic and the previously rendered graphic. If the depth value of the current graphic is less than the cached depth value, it means that the current graphic occludes the previously rendered graphic. In the color buffer, the color value cached for the pixel is overwritten by the color value of the current graphic, and in the depth buffer, the depth value for the pixel is overwritten by the color of the current graphic; otherwise, the color value and depth value of the corresponding pixel of the current graphic will be discarded, and the color value and depth value cached for the pixel will remain unchanged.

[0054] 3. Transparent testing

[0055] Transparency test is also called transparency test. Transparency test refers to the relationship between the transparency of the latest rendering data of the pixel and the threshold to determine which pixels' latest rendering data should be retained and which pixels' latest rendering data should be discarded. If the transparency of the latest rendering data of the pixel is less than the threshold, the latest rendering data of the pixel is discarded and will not affect the cached data of the pixel in the frame buffer; otherwise, the latest rendering data of the pixel will be retained, overwriting the cached data of the pixel in the frame buffer, so that the data in the frame buffer is updated.

[0056] 4. Transparent Blending

[0057] Transparent blending is also called transparency blending. Transparent blending refers to blending the graphic color with the background color according to the transparency of the graphic, thereby achieving a semi-transparent effect of the graphic.

[0058] 5. Front face culling and back face culling

[0059] In graphics rendering, each polygon (such as a triangle) has two faces, the front face and the back face. FaceCulling allows developers to choose to render only the face of the graphics facing the observer (i.e., the front face), and discard the face of the graphics facing away from the observer (i.e., the back face). Backface Culling allows developers to choose to render only the face of the graphics facing away from the observer (i.e., the back face), and discard the face of the graphics facing the observer (i.e., the front face). Front face culling and back face culling can cull the front or back face of the graphics during the graphics rendering process. The culled faces do not need to be rendered, and only the retained faces are rendered, thereby optimizing rendering performance and reducing unnecessary calculations.

[0060] 6. Rasterization

[0061] Rasterization is a computer graphics technology used to convert geometric graphics (such as vector graphics, 3D models) into raster images composed of pixels. The rasterization process is located after the vertex calculation process (such as the vertex expansion process involved in the present disclosure) performed by the vertex shader and before the pixel shading process performed by the pixel shader, which can convert geometric graphics into pixels.

[0062] Figure 1 A display method in a game provided by one embodiment of the present disclosure is shown, wherein the game includes a virtual model, such as Figure 1 As shown, the method includes the following steps S101 to S110.

[0063] Step S101: In response to a rendering instruction for a virtual model, the virtual model is rendered to obtain color data of the virtual model.

[0064] Before introducing this step, the preparatory work that can be performed in an exemplary embodiment is first introduced.

[0065] One is to increase the number of faces of the virtual model to reduce the sense of segmentation of the stroked part and make the stroked part smoother. This is because the stroke solution based on the outward expansion of the model vertices will enhance the segmentation of the polygons, so the number of faces of the virtual model can be increased to prevent the stroked part from having too strong a sense of segmentation visually.

[0066] The other is the preparation of vertex normals for virtual models. Two sets of vertex normals can be stored for virtual models. One set is the unprocessed vertex normals. In this set of vertex normals, if a vertex is shared by multiple faces, and the multiple faces belong to different smooth groups, then the vertex has a vertex normal corresponding to each face; in the other set of vertex normals, if a vertex has multiple vertex normals, the multiple vertex normals are averaged to obtain the smooth normal corresponding to the vertex. In this set of vertex normals, there is only one smooth normal corresponding to a vertex. For the convenience of description and distinction, the first set of vertex normals is referred to as vertex normals, and the second set of vertex normals is referred to as smooth normals.

[0067] Another is the preparation of data required for vertex expansion. If you want to get a hollow ink stroke effect, you can set a first preset expansion distance and a second preset expansion distance, where the first preset expansion distance can represent the vertex expansion distance related to generating the hollow part, and the second preset expansion distance can represent the vertex expansion distance related to generating the stroke part.

[0068] In order to reduce the number of textures required for rendering, the first preset expansion distance and the second preset expansion distance may be stored through the color channels (e.g., any two color channels) of the vertices of the virtual model. Exemplarily, the first preset expansion distance may be stored through the r channel of the vertices of the virtual model, and the second preset expansion distance may be stored through the g channel of the vertices of the virtual model; or, the first preset expansion distance may be stored through the g channel of the vertices of the virtual model, and the second preset expansion distance may be stored through the b channel of the vertices of the virtual model; or, the first preset expansion distance may be stored through the g channel of the vertices of the virtual model, and the second preset expansion distance may be stored through the r channel of the vertices of the virtual model.

[0069] Optionally, in order to make both the hollowed-out part and the stroked part have certain variations in thickness, the first preset expansion distance and the second preset expansion distance corresponding to the vertex can be stored in the color channel of the vertex of the virtual model, so that different vertices have different hollowed-out widths and different stroke widths.

[0070] Optionally, the virtual model can be copied in two copies, and the first color channel (for example, the r channel) of the vertices of one of the virtual models can be painted with a color brush, and the color value painted on the first color channel of the vertex is the first preset outward expansion distance corresponding to the vertex; the second color channel (for example, the g channel) of the vertices of the other virtual model can be painted with a color brush, and the color value painted on the second color channel of the vertex is the second preset outward expansion distance corresponding to the vertex; then, the vertex colors of the two virtual models can be merged to obtain the vertex colors of the virtual model.

[0071] This step is described below.

[0072] In an exemplary embodiment, the virtual model may include one or more of the following: a character model, an object model, and a building model, which is not specifically limited in the present disclosure.

[0073] In this step, in response to a rendering instruction for the virtual model, a basic physical rendering may be performed on the virtual model through a first pass.

[0074] In an exemplary embodiment, the virtual model can be rendered in this step in the following manner: configure the transparency of the virtual model to be opaque; perform back-face culling on the virtual model; render the front face of the virtual model according to the current lighting information and a preconfigured basic color map to obtain the color data of the virtual model.

[0075] In the above embodiment, only the front side of the virtual model is rendered in the first pass, the transparency of the virtual model is opaque, and the color of the virtual model needs to consider the influence of lighting on the basis of the basic color map. The color calculation considering lighting can be calculated according to the light source direction, the observation direction and the model normal direction (the first set of vertex normals described above is used here). For example, in diffuse reflection calculation, if the model normal direction of a pixel is closer to the light source direction, then the pixel will be brighter; otherwise, it will be darker; in specular reflection calculation, the highlight pixel and the brightness of the highlight pixel are calculated according to the model normal direction, the light source direction and the observation direction; in shadow calculation, by comparing the model normal direction of a pixel with the light source direction, it can be determined whether the pixel is in the shadow.

[0076] In the first pass, the color data of the virtual model can be written into the color buffer through the depth test, and the depth data of the virtual model can be written into the depth buffer. Through the first pass, the performance of the virtual model under the influence of light can be rendered.

[0077] Step S102: Perform a first vertex expansion on the virtual model to obtain a first model.

[0078] Step S103: Generate color data of a first hollow portion between the virtual model and the stroke portion based on the first model.

[0079] In this disclosure, reference is made to Figure 2 , it is necessary to generate a stroke portion 02 (sometimes referred to as a stroke in the text) for the virtual model 01, and generate a hollow portion 03 between the virtual model 01 and the stroke portion 02, wherein the stroke portion 02 includes at least a first stroke portion 021 and a second stroke portion 022, and the second stroke portion 022 can be farther away from the virtual model than the first stroke portion 021, and the hollow portion 03 includes at least a first hollow portion 031 and a second hollow portion 032, and the second hollow portion 032 can be farther away from the virtual model than the first hollow portion 031.

[0080] Steps S102 to S103 are the second pass, and the second pass is used to render the first hollowed-out part. In the second pass, the color component of the vertex color of the virtual model on the first color channel can be read first, that is, the first preset expansion distance corresponding to each vertex can be read, and then the first vertex expansion of the virtual model can be performed according to the first preset expansion distance. Vertex expansion is to move the vertex of the virtual model along the smooth normal direction corresponding to the vertex. The expansion distance of the vertex during the first vertex expansion can be determined according to the first preset expansion distance corresponding to the vertex. Exemplarily, the expansion distance of the vertex during the first vertex expansion can be equal to the product of the first preset expansion distance corresponding to the vertex and the first preset parameter. The first model can be obtained by performing the first vertex expansion on the virtual model. The above process can be implemented by a vertex shader.

[0081] After the first model is obtained by the first vertex expansion, the transparency of the first model can be configured to be completely transparent, and the color of the first model can be configured to be a preset color, such as black. The above process can be implemented by a pixel shader. For example, taking the preset color as black as an example, the output of the pixel shader for each vertex of the first model can be rgba=(0,0,0,0).

[0082] Afterwards, the color of the first model can be transparently mixed based on the transparency of the first model to obtain the color data of the first hollowed-out part. That is, the color of the first model and the current background color are transparently mixed using the transparency of the first model as a weight, where the current background color is the cached color data in the current color buffer. Specifically, for a pixel corresponding to the first model on the screen, the latest color of the pixel = a*the color data of the first model at the pixel+(1-a)*the cached color data of the pixel in the current color buffer, where a is the transparency of the first model at the pixel.

[0083] In the second pass, the color data of the first hollowed-out part can be written into the color buffer through the depth test, and the depth data of the first hollowed-out part (i.e., the depth of the first model) can be written into the depth buffer. Through the second pass, the first hollowed-out part between the virtual model and the stroked part can be rendered, so that some distance is left between the stroked part and the virtual model, so that the stroked part will not be close to the virtual model, avoiding the crowding between the virtual model and the stroked part.

[0084] Step S104: performing a second vertex expansion on the virtual model to obtain a second model; the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion.

[0085] Step S105: Generate color data of a second hollow portion between the stroke portion and the first hollow portion based on the second model.

[0086] Steps S104 to S105 are the third pass, and the third pass is used to render the second hollowed-out portion. In the third pass, the virtual model is firstly subjected to a second vertex expansion to obtain a second model, and then the color data of the second hollowed-out portion is generated based on the second model.

[0087] The second vertex expansion of the virtual model can refer to the line of sight process of the first vertex expansion of the virtual model, wherein the difference between the second vertex expansion and the first vertex expansion includes: the expansion distance of all vertices of the virtual model during the second vertex expansion is greater than the expansion distance during the first vertex expansion. In an optional embodiment, the expansion distance of a vertex during the second vertex expansion can be equal to the product of the first preset expansion distance corresponding to the vertex and the second preset parameter, wherein the second preset parameter can be greater than the first preset parameter, thereby ensuring that the expansion distance of the vertex during the second vertex expansion is greater than the expansion distance during the first vertex expansion. The above process can be implemented by a vertex shader.

[0088] After the second model is obtained by the second vertex expansion, the transparency of the second model can be configured to be completely transparent, and the color of the second model can be configured to be a preset color, such as black. The above process can be implemented by a pixel shader. For example, taking the preset color as black as an example, the output of the pixel shader for each vertex of the second model can be rgba=(0,0,0,0).

[0089] Afterwards, the color of the second model can be tested for transparency based on the preconfigured noise map to obtain the color data of the second hollow part. During the transparency test, considering that the transparency of all pixels corresponding to the second model is the same and completely transparent, comparing the size with the preset threshold will lead to two extreme results, either all the pixels corresponding to the second model are discarded, or all are retained. Therefore, during the transparency test of the third pass, the preconfigured noise map can be sampled. The preconfigured noise map has the same resolution as the screen, and the sampling result for a certain pixel (that is, the grayscale value of the pixel) is compared with the preset threshold, so as to achieve random discarding of some pixels, so that the subsequently generated stroke part can be displayed through the pixel position discarded for the second model, so that the stroke part close to the hollow part shows the effect of dry ink brushstrokes. Optionally, the preconfigured noise map can be a 2D noise map, such as a Perlin noise map, and the present disclosure does not specifically limit this.

[0090] In the third pass, the color data of the second hollowed-out portion can be written into the color buffer through the depth test, and the depth data of the second hollowed-out portion (ie, the depth of the second model) can be written into the depth buffer. Through the third pass, the second hollowed-out portion between the virtual model and the stroked portion can be rendered.

[0091] Step S106: performing a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some of the vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion.

[0092] Step S107: Generate color data of a first stroke portion in the stroke portion based on the third model.

[0093] Steps S106 to S107 are the fourth pass, and the fourth pass is used to render the first stroke portion. In the fourth pass, the virtual model is firstly vertex expanded for the third time to obtain a third model, and then the color data of the first stroke portion is generated based on the third model.

[0094] The third vertex expansion of the virtual model can refer to the line of sight process of the first vertex expansion of the virtual model, wherein the difference between the third vertex expansion and the previous vertex expansion (including the first vertex expansion and the second vertex expansion) includes: the expansion distance of at least some vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion, and what is read during the third vertex expansion is the color component of the vertex color of the virtual model on the second color channel, that is, the second preset expansion distance corresponding to each vertex is read, and then the third vertex expansion of the virtual model can be performed according to the second preset expansion distance. In an optional embodiment, the expansion distance of a vertex during the third vertex expansion can be equal to the product of the second preset expansion distance corresponding to the vertex and the third preset parameter.

[0095] After the third model is obtained through the third vertex expansion, the transparency of the third model can be configured to be opaque; the front face of the third model is culled; the back face of the third model is colored according to a preconfigured target color map to obtain color data of the first stroke portion.

[0096] In an optional embodiment, the target color map may be the above-mentioned basic color map, and of course may also be other color maps, such as a pure color map, a gradient color map, and the like.

[0097] In the fourth pass, the front face of the third model can be culled when rendering the first stroke part, and only the back face of the third model is rendered.

[0098] In the fourth pass, the color data of the first stroke part can be written into the color buffer through the depth test, while the depth data of the first stroke part (i.e., the depth of the third model) is not written into the depth buffer, that is, the depth is not written into the first stroke part, while the depth is written into the first three passes. Through the fourth pass, the first stroke part closest to the virtual model in the stroke part can be rendered. The fourth pass and the third pass can make the side of the stroke part close to the hollow part show the effect of dry ink brushstrokes.

[0099] By the fourth pass, the following will appear: Figure 3 The stroke effect shown in the figure can appear as follows because the depth has been written in the previous pass. Figure 3 The hollow ink stroke effect shown, wherein, according to the first preset outward expansion distance and the second preset outward expansion distance of each model vertex, a stroke effect that sometimes appears and sometimes disappears, sometimes is thick and sometimes is thin can be presented.

[0100] Step S108: performing a fourth vertex expansion on the virtual model to obtain a fourth model; the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion.

[0101] Step S109: Generate color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model.

[0102] Steps S108 to S109 are the fifth pass, and the fifth pass is used to render the second stroke portion. In the fifth pass, the fourth vertex expansion of the virtual model is first performed to obtain a fourth model, and then the color data of the second stroke portion is generated based on the fourth model.

[0103] The fourth vertex expansion of the virtual model may refer to the line of sight process of the third vertex expansion of the virtual model, wherein the difference between the fourth vertex expansion and the third vertex expansion includes: the expansion distance of all vertices of the virtual model during the fourth vertex expansion is greater than the expansion distance during the third vertex expansion. In an optional embodiment, the expansion distance of a vertex during the fourth vertex expansion may be equal to the product of the second preset expansion distance corresponding to the vertex and the fourth preset parameter.

[0104] After the fourth model is obtained through the fourth vertex expansion, the transparency of the fourth model can be configured to be opaque; the front face of the fourth model is culled; and the back face of the fourth model is colored according to a preconfigured target color map to obtain the color of the fourth model.

[0105] In an optional embodiment, the target color map may be the above-mentioned basic color map, and of course may also be other color maps, such as a pure color map, a gradient color map, and the like.

[0106] Afterwards, the color of the fourth model can be tested for transparency based on the preconfigured noise map to obtain the color data of the second stroke part. During the transparency test, considering that the transparency of all pixels corresponding to the fourth model is the same and all are opaque, comparing the size with the preset threshold will lead to two extreme results, either all the pixels corresponding to the fourth model are discarded, or all are retained. Therefore, during the transparency test of the fifth pass, the preconfigured noise map can be sampled. The preconfigured noise map has the same resolution as the screen, and the sampling result for a certain pixel (that is, the grayscale value of the pixel) is compared with the preset threshold, so as to achieve random discarding of some pixels, so that the subsequently generated stroke part can be displayed through the pixel position discarded for the fourth model, so that the side of the stroke part principle hollow part shows the effect of ink dry brushstrokes. Optionally, the preconfigured noise map can be a 2D noise map, such as a Berlin noise map, and the present disclosure does not make specific limitations on this.

[0107] In the fifth pass, the color data of the second stroke part can be written into the color buffer through the depth test, and the depth data of the second stroke part (that is, the depth of the fourth model) is not written into the depth buffer, that is, the depth is not written into the second stroke part. Through the fifth pass, the second stroke part showing the ink dry brushstroke effect around the stroke can be rendered.

[0108] Step S110: Displaying a virtual model with a hollow ink stroke effect according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

[0109] The depth data of the virtual model, the first hollow part, and the second hollow part can be written into the depth buffer in the first to third passes respectively. The occlusion relationship between the virtual model, the first hollow part, and the second hollow part is reflected through the depth test. In the color buffer, only the color data of the third part closest to the virtual camera is retained for the pixel. The color data of the first stroke part and the second stroke part are also written into the color buffer in the fourth to fifth passes respectively. Therefore, the color data in the current color buffer (including the rendering results of the first to fifth passes) can be displayed in the graphical user interface, and the virtual model with the hollow ink stroke effect can be presented in the graphical user interface.

[0110] In an alternative embodiment, reference Figure 2The stroke portion 02 may further include a third stroke portion 023. The third stroke portion 023 may be further away from the virtual model than the second stroke portion 022. In this embodiment, the third stroke portion 023 may also be rendered through a sixth pass.

[0111] In the sixth pass, the virtual model may be subjected to a fifth vertex expansion to obtain a fifth model, wherein an expansion distance of the fifth vertex expansion is greater than an expansion distance of the third vertex expansion, and optionally, the expansion distance of the fifth vertex expansion may be greater than an expansion distance of the fourth vertex expansion; and then color data of the third stroke portion is generated based on the fifth model.

[0112] The fifth vertex expansion of the virtual model may refer to the line of sight process of the third vertex expansion of the virtual model, wherein the difference between the fifth vertex expansion and the third vertex expansion includes: the expansion distance of all vertices of the virtual model during the fifth vertex expansion is greater than the expansion distance during the third vertex expansion. In an optional embodiment, the expansion distance of a vertex during the fifth vertex expansion may be equal to the product of the second preset expansion distance corresponding to the vertex and the fifth preset parameter.

[0113] After the fifth model is obtained through the fifth vertex expansion, the transparency of the fifth model can be determined according to the preconfigured noise map; the front face of the fifth model is culled; and the back face of the fifth model is colored according to the preconfigured target color map to obtain the color of the fifth model.

[0114] In this embodiment, the preconfigured noise map can be sampled according to the pixels corresponding to the fifth model, the preconfigured noise map has the same resolution as the screen, and the sampling result for a certain pixel (i.e., the grayscale value of the pixel) is determined as the transparency of the fifth model at the pixel. Optionally, the preconfigured noise map can be a 2D noise map, such as a Perlin noise map, which is not specifically limited in the present disclosure.

[0115] In an optional embodiment, the target color map may be the above-mentioned basic color map, and of course may also be other color maps, such as a pure color map, a gradient color map, and the like.

[0116] Afterwards, the color of the fifth model can be transparently mixed based on the transparency of the fifth model to obtain the color data of the third stroke part. That is, the color of the fifth model and the current background color are transparently mixed using the transparency of the fifth model as a weight, where the current background color is the cached color data in the current color buffer. Specifically, for a certain pixel corresponding to the fifth model on the screen, the latest color of the pixel = b*color data of the fifth model at the pixel+(1-b)*cached color data of the pixel in the current color buffer, where b is the transparency of the fifth model at the pixel.

[0117] In the sixth pass, the color data of the third stroke portion can be written into the color buffer through the depth test, while the depth data of the third stroke portion (i.e., the depth of the fifth model) is not written into the depth buffer, that is, the depth is not written into the third stroke portion. Through the sixth pass, the third stroke portion showing the ink wet brushstroke effect around the stroke can be rendered.

[0118] In the above embodiment, in step S110, after the sixth pass, a virtual model having a hollow ink stroke effect and a wet brush stroke effect on the stroke part can be displayed based on the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, and the color data of the third stroke part.

[0119] In the above embodiment, the depth data of the virtual model, the first hollow part, and the second hollow part can be written into the depth buffer in the first to third passes respectively, and the occlusion relationship between the virtual model, the first hollow part, and the second hollow part can be reflected through the depth test. In the color buffer, only the color data of the third one closest to the virtual camera is retained for the pixel. The color data of the first stroke part, the second stroke part, and the third stroke part are also written into the color buffer in the fourth to sixth passes respectively. Therefore, the color data in the current color buffer (including the rendering results of the first to sixth passes) can be displayed in the graphical user interface, and a virtual model with a hollow ink stroke effect and a wet brushstroke effect on the stroke part can be presented in the graphical user interface.

[0120] In an optional embodiment, after the sixth pass, the ink-wash effect of the stroke portion may be enhanced. Two exemplary implementations of enhancing the ink-wash effect are provided below.

[0121] In one embodiment of the present disclosure, a first image is generated based on color data and depth data of a virtual model, color data and depth data of a first hollow portion, color data and depth data of a second hollow portion, color data of a first stroke portion, color data of a second stroke portion, and color data of a third stroke portion; a rendering target for representing an outer contour of the stroke portion is generated based on the depth data of the third stroke portion; noise is superimposed on the rendering target to obtain a second image; the first image is blurred to obtain a third image; the first image and the third image are mixed based on the second image to obtain mixed color data; and based on the mixed color data, a virtual model with a hollow ink stroke effect and a wet brushstroke effect and an ink smudge effect on the stroke portion is displayed.

[0122] In this embodiment, after the sixth pass, the color data in the color buffer can form an image, that is, the first image; a rendering target (rendertarget) for representing the outline of the third stroke portion can be generated according to the depth data of the third stroke portion, that is, a mask map representing the third stroke portion. Then, noise is superimposed on the rendering target, that is, the rendering target is superimposed with a preconfigured noise map (optionally, the preconfigured noise map can be a 2D noise map, such as a Perlin noise map). The first image can be blurred to obtain a third image; optionally, the blurring can include Gaussian blurring; optionally, the blurring can be performed multiple times, such as 2 times or 3 times. Then, the second image can be used as a weight to mix the first image and the third image to obtain mixed color data. Specifically, for a certain pixel on the screen, the mixed color data of the pixel = c*color data of the pixel in the first image + (1-c)*color data of the pixel in the third image, where c is the color data of the pixel in the second image.

[0123] In this way, the clear first image and the blurred third image can be mixed according to the stroke contour image with superimposed noise to obtain an enhanced ink-and-wash effect.

[0124] In one embodiment of the present disclosure, an enhanced ink-wash effect can be achieved through an additional pass, that is, a fourth stroke portion in the stroke portion is generated through a seventh pass, and the fourth stroke portion can be farther away from the virtual model than the third stroke portion. In this embodiment, the virtual model can be subjected to a sixth vertex expansion to obtain a sixth model, wherein the expansion distance of the sixth vertex expansion is greater than the expansion distance of the third vertex expansion, and optionally, the expansion distance of the sixth vertex expansion can be greater than the expansion distance of the fourth vertex expansion, and optionally, the expansion distance of the sixth vertex expansion can be greater than the expansion distance of the fifth vertex expansion; then, color data of the fourth stroke portion is generated based on the sixth model, wherein the fourth stroke portion is a Fresnel transparency effect, thereby achieving a semi-transparent ink-wash effect through the Fresnel transparency effect of the fourth stroke portion.

[0125] The sixth vertex expansion of the virtual model may refer to the line of sight process of the third vertex expansion of the virtual model, wherein the difference between the sixth vertex expansion and the third vertex expansion includes: the expansion distance of all vertices of the virtual model during the sixth vertex expansion is greater than the expansion distance during the third vertex expansion. In an optional embodiment, the expansion distance of a vertex during the sixth vertex expansion may be equal to the product of the second preset expansion distance corresponding to the vertex and the sixth preset parameter.

[0126] After the sixth model is obtained through the sixth vertex expansion, the transparency of the Fresnel effect of the sixth model can be determined to obtain the transparency data of the fourth stroke part; the front face of the sixth model is culled; the back face of the sixth model is colored according to the preconfigured target color map to obtain the color data of the fourth stroke part.

[0127] In this embodiment, the Fresnel effect transparency of the sixth model, that is, the transparency of the sixth model at the corresponding pixel, can be expressed by the following formula. The sixth model is presented at the corresponding pixel using the transparency determined by the following formula, which can show the Fresnel transparency effect.

[0128] Frenel_alpha=saturate(powN(saturate(-dot(V,normalize(smooth))))-noise.r)

[0129] Among them, Frenel_alpha represents the transparency of the sixth model at the pixel X, the saturate() function represents the part of the function value in the brackets of the saturate() function intercepted to [0,1], that is, if the function value in the brackets of the saturate() function is less than 0, the saturate() function returns 0, if the function value in the brackets of the saturate() function is greater than 1, the saturate() function returns 1, if the function value in the brackets of the saturate() function is in [0,1], the saturate() function returns the function value in the brackets of the saturate() function itself; powN represents N-th power operation, N can be a positive integer greater than 2, such as 2, 3, 4, 5, etc.; dot represents dot multiplication operation; V represents the observation direction corresponding to the sixth model at the pixel X; normalize represents normalization operation; smooth represents the smooth normal direction of the vertex corresponding to the sixth model at the pixel X; noise.r represents the grayscale value corresponding to the pixel X in the preconfigured noise map.

[0130] In an optional embodiment, the target color map may be the above-mentioned basic color map, and of course may also be other color maps, such as a pure color map, a gradient color map, and the like.

[0131] In the above embodiment, in step S110, after the seventh pass, a virtual model having a hollow ink stroke effect and a wet brushstroke effect and an ink smudge effect on the stroke part can be displayed based on the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, the color data of the third stroke part, and the color data of the fourth stroke part.

[0132] In the above embodiment, the depth data of the virtual model, the first hollow part, and the second hollow part can be written into the depth buffer in the first to third passes respectively, and the occlusion relationship between the virtual model, the first hollow part, and the second hollow part can be reflected through the depth test. In the color buffer, only the color data of the third one closest to the virtual camera is retained for the pixel. The color data of the first stroke part, the second stroke part, the third stroke part, and the fourth stroke part are also written into the color buffer in the fourth to seventh passes respectively. Therefore, the color data in the current color buffer (including the rendering results of the first to seventh passes) can be displayed in the graphical user interface, and a virtual model with a hollow ink stroke effect and a wet brushstroke effect and an ink smudge effect in the stroke part can be presented in the graphical user interface.

[0133] Optionally, one of the two embodiments of enhancing the ink-wash effect can be selected according to the performance of the electronic device, wherein the second embodiment is more performance-saving than the first embodiment. Exemplarily, the first embodiment can be selected in a higher-performance electronic device (i.e., a high-end device), and the second embodiment can be selected in a lower-performance electronic device (i.e., a high-end device), or the second embodiment can be selected in both higher-performance and lower-performance electronic devices, and the present disclosure is not intended to limit this.

[0134] In an optional embodiment, the display method in the game may further include the following steps: determining the total illumination color corresponding to the target stroke position in the stroke portion according to the current illumination information; converting the total illumination color into illumination intensity; mapping the illumination intensity to a preset illumination intensity range to obtain the target illumination intensity corresponding to the target stroke position. According to the target illumination intensity corresponding to the target stroke position, adjusting the color corresponding to the target stroke position.

[0135] In one implementation of this embodiment, first check whether there is a point light source. If so, calculate the contribution of the point light source to the target stroke position in the stroke portion. Then add the contribution of the point light source to the target stroke position and the contribution of the direct light source to the target stroke position to obtain the total illumination color corresponding to the target stroke position. Afterwards, dot product operation is performed on the total illumination color and a preconfigured weight vector, where the weight vector is a coefficient for converting RGB color to brightness. Exemplarily, the weight vector can be (0.2126, 0.7152, 0.0722). The total illumination color can be converted to illumination intensity through dot product operation to obtain the illumination intensity corresponding to the target stroke position; the illumination intensity corresponding to the target stroke position is limited to a certain range (i.e., a preset illumination intensity range) to obtain the target illumination intensity corresponding to the target stroke position. Finally, the target illumination intensity corresponding to the target stroke position can be multiplied by the color corresponding to the target stroke position to obtain the color of the target stroke position adapted to illumination.

[0136] In this embodiment, the color brightness of the stroke can be adjusted according to the current light, so that the color brightness of the stroke changes with the change of light intensity, that is, the color brightness of the stroke increases with the increase of light intensity and decreases with the decrease of light intensity.

[0137] The colors of the virtual model and the surrounding environment are adapted to the lighting. In a darker environment, if the color brightness of the stroke remains unchanged (that is, the stroke color does not adapt to the lighting), the stroke will appear to be glowing (for example, a yellow stroke will appear to be glowing in a darker environment), resulting in poor display of the stroke in a darker environment. In addition, if lighting calculations are performed for each pass of rendering each stroke portion, there will be additional performance overhead. Therefore, in this embodiment, the stroke color brightness is limited according to the light intensity of the point light source and the direct light source, and finally multiplied by the rendered stroke color, thereby achieving low-cost stroke lighting adaptation and improving the display of the stroke in a darker environment.

[0138] In an optional embodiment, in the first pass, the front face of the virtual model may be rendered according to the current lighting information and the preconfigured basic color map to obtain the color data of the virtual model in the following manner:

[0139] Periodically offset the UV of the virtual model;

[0140] Sample the pre-configured base color map according to the offset virtual model's UV;

[0141] Process the sampled color data according to the current illumination information to obtain processed color data;

[0142] The processed color data is mapped to the front face of the virtual model to obtain color data of the virtual model.

[0143] In this embodiment, by periodically offsetting the UV of the virtual model and then sampling the basic color map, a flowmap loop effect can be achieved for the texture of the virtual model, thereby producing a circulating ink texture through the flowmap loop animation, thereby adding a sense of dynamics to the ink effect of the virtual model.

[0144] In an optional embodiment, the display method in the game may further include the following steps:

[0145] emitting sheet-like particles at target positions of the virtual model;

[0146] Configure UV flow effect for surface flake particles;

[0147] Rendering display of surface-like particles with UV flow effect configured.

[0148] In this embodiment, sheet-like particles (such as square particles, rectangular particles, etc.) can be emitted at the target position of the virtual model (such as the end of the skirt of the character model, the position of the decorative tassel, etc.), and the UV of the sheet-like particles is offset each time the texture is sampled for the sheet-like particles, so as to achieve the UV flow effect for the sheet-like particles. In this embodiment, the ink and wash effect of the virtual model is further enhanced by the flowing sheet special effect.

[0149] In an exemplary embodiment of the present disclosure, a first hollow portion is generated to leave a certain distance between the stroke and the model, thereby realizing a hollow stroke effect and enhancing the spatial sense of the stroke; a second hollow portion is generated to make the side of the stroke facing the model have a dry brushstroke effect in ink style; the stroke is realized by generating the first stroke portion; the second stroke portion is generated to make the side of the stroke facing away from the model have a dry brushstroke effect in ink style; the third stroke portion is generated to make the side of the stroke facing away from the model have a wet brushstroke effect in ink style; and the fourth stroke portion is generated to make the stroke have an ink smudge effect.

[0150] Corresponding to the display method in the game provided by the embodiment of the present disclosure, the embodiment of the present disclosure also provides a display device in the game, wherein the game includes a virtual model. Figure 4 As shown, the device 700 includes:

[0151] A rendering module 701 is used to render the virtual model in response to a rendering instruction for the virtual model to obtain color data of the virtual model;

[0152] A first vertex expansion module 702 is used to perform a first vertex expansion on the virtual model to obtain a first model;

[0153] A first generating module 703, configured to generate color data of a first hollow portion between the virtual model and the stroke portion based on the first model;

[0154] A second vertex expansion module 704 is used to perform a second vertex expansion on the virtual model to obtain a second model; the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion;

[0155] A second generating module 705, configured to generate color data of a second hollow portion located between the stroke portion and the first hollow portion based on the second model;

[0156] A third vertex expansion module 706 is used to perform a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion;

[0157] A third generating module 707, configured to generate color data of a first stroke portion in the stroke portion based on the third model;

[0158] A fourth vertex expansion module 708 is used to perform a fourth vertex expansion on the virtual model to obtain a fourth model; the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion;

[0159] A fourth generating module 709, configured to generate color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model;

[0160] The display module 710 is used to display the virtual model with a hollow ink stroke effect according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

[0161] In an optional embodiment, displaying the virtual model with a hollow ink stroke effect according to the color data and depth data of the virtual model, the color data and depth data of the first hollowed-out portion, the color data and depth data of the second hollowed-out portion, the color data of the first stroke portion, and the color data of the second stroke portion includes:

[0162] Performing a fifth vertex expansion on the virtual model to obtain a fifth model; wherein the expansion distance of the fifth vertex expansion is greater than the expansion distance of the third vertex expansion;

[0163] generating color data of a third stroke portion of the stroke portion located on a side of the second stroke portion away from the virtual model based on the fifth model;

[0164] The virtual model having a hollow ink stroke effect and the stroke part having a wet brushstroke effect is displayed according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, and the color data of the third stroke part.

[0165] In an optional embodiment, displaying the virtual model with a hollow ink stroke effect and a wet brushstroke effect on the stroke portion according to the color data and depth data of the virtual model, the color data and depth data of the first hollow portion, the color data and depth data of the second hollow portion, the color data of the first stroke portion, the color data of the second stroke portion, and the color data of the third stroke portion includes:

[0166] Generate a first image according to the color data and depth data of the virtual model, the color data and depth data of the first hollowed-out portion, the color data and depth data of the second hollowed-out portion, the color data of the first stroked portion, the color data of the second stroked portion, and the color data of the third stroked portion;

[0167] generating a rendering target for representing the outline of the third stroke portion according to the depth data of the third stroke portion;

[0168] superimposing noise on the rendering target to obtain a second image;

[0169] Performing blur processing on the first image to obtain the third image;

[0170] Mixing the first image and the third image based on the second image to obtain mixed color data;

[0171] According to the mixed color data, the virtual model is displayed with a hollow ink stroke effect, and the stroke portion has a wet brushstroke effect and an ink smudge effect.

[0172] In an optional embodiment, displaying the virtual model with a hollow ink stroke effect and a wet brushstroke effect on the stroke portion according to the color data and depth data of the virtual model, the color data and depth data of the first hollow portion, the color data and depth data of the second hollow portion, the color data of the first stroke portion, the color data of the second stroke portion, and the color data of the third stroke portion includes:

[0173] Performing a sixth vertex expansion on the virtual model to obtain a sixth model; wherein the expansion distance of the sixth vertex expansion is greater than the expansion distance of the third vertex expansion;

[0174] generating color data of a fourth stroke portion of the stroke portion located on a side of the third stroke portion away from the virtual model based on the sixth model; the fourth stroke portion has a Fresnel transparent effect;

[0175] According to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, the color data of the third stroke part, and the color data of the fourth stroke part, the virtual model with a hollow ink stroke effect and the stroke part with a wet brushstroke effect and an ink smudge effect is displayed.

[0176] In an optional embodiment, rendering the virtual model to obtain color data of the virtual model includes:

[0177] Configuring the transparency of the virtual model to be opaque;

[0178] Performing backface culling on the virtual model;

[0179] The front face of the virtual model is rendered according to the current illumination information and a preconfigured basic color map to obtain color data of the virtual model.

[0180] In an optional embodiment, rendering the front face of the virtual model according to the current illumination information and a preconfigured basic color map to obtain color data of the virtual model includes:

[0181] Periodically shifting the UV of the virtual model;

[0182] Sample the pre-configured base color map according to the offset virtual model's UV;

[0183] Process the sampled color data according to the current illumination information to obtain processed color data;

[0184] The processed color data is mapped to the front face of the virtual model to obtain the color data of the virtual model.

[0185] In an optional embodiment, the device is further used for:

[0186] emitting sheet-like particles at a target position of the virtual model;

[0187] Configuring UV flow effect for the surface flake particles;

[0188] The sheet-like particles configured with UV flow effects are rendered and displayed.

[0189] In an optional embodiment, generating color data of the first hollowed-out portion based on the first model includes:

[0190] Configure the transparency of the first model to be completely transparent;

[0191] Configure the color of the first model to be a preset color;

[0192] The colors of the first model are transparently mixed based on the transparency of the first model to obtain color data of the first hollowed-out part.

[0193] In an optional embodiment, generating color data of the second hollowed-out portion based on the second model includes:

[0194] Configure the transparency of the second model to be completely transparent;

[0195] Configure the color of the second model to be a preset color;

[0196] A transparency test is performed on the color of the second model based on a preconfigured noise map to obtain color data of the second hollowed-out portion.

[0197] In an optional embodiment, generating color data of the first stroke portion based on the third model includes:

[0198] Configuring the transparency of the third model to be opaque;

[0199] Performing front culling on the third model;

[0200] The back surface of the third model is colored according to a preconfigured target color map to obtain color data of the first stroke portion.

[0201] In an optional embodiment, generating color data of the second stroke portion based on the fourth model includes:

[0202] Configuring the transparency of the fourth model to be opaque;

[0203] Performing front culling on the fourth model;

[0204] Coloring the back surface of the fourth model according to a preconfigured target color map to obtain the color of the fourth model;

[0205] A transparency test is performed on the color of the fourth model based on a preconfigured noise map to obtain color data of the second stroke portion.

[0206] In an optional embodiment, generating color data of the third stroke portion based on the fifth model includes:

[0207] determining a transparency of the fifth model according to a preconfigured noise map;

[0208] Performing front face culling on the fifth model;

[0209] Coloring the back surface of the fifth model according to a preconfigured target color map to obtain the color of the fifth model;

[0210] The color of the fifth model is transparently mixed based on the transparency of the fifth model to obtain color data of the third stroke portion.

[0211] In an optional embodiment, generating color data of the fourth stroke portion based on the sixth model includes:

[0212] determining a Fresnel effect transparency of the sixth model;

[0213] Performing front culling on the sixth model;

[0214] The back surface of the sixth model is colored according to a preconfigured target color map to obtain color data of the fourth stroke portion.

[0215] In an optional embodiment, the device is further used for:

[0216] Determining a total illumination color corresponding to a target stroke position in the stroke portion according to current illumination information;

[0217] Converting the total light color to light intensity;

[0218] Mapping the light intensity into a preset light intensity range to obtain a target light intensity corresponding to the target stroke position;

[0219] According to the target light intensity corresponding to the target stroke position, the color corresponding to the target stroke position is adjusted.

[0220] In an exemplary embodiment of the present disclosure, a model can be rendered in response to a rendering instruction to obtain color data of the model; the model can be expanded for the first time to obtain a first model; color data of the first hollow part can be generated based on the first model; the model can be expanded for the second time to obtain a second model; color data of the second hollow part can be generated based on the second model; the model can be expanded for the third time to obtain a third model; color data of the first stroke part can be generated based on the third model; the model can be expanded for the fourth time to obtain a fourth model; color data of the second stroke part can be generated based on the fourth model; and a model with a hollow ink stroke effect can be displayed according to the color depth data of the model, the color depth data of the first hollow part, the color depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part. In the present disclosure, a first hollow portion is generated to leave a certain distance between the stroke and the model, thereby achieving a hollow stroke effect and enhancing the spatial sense of the stroke; a second hollow portion is generated to give the side of the stroke facing the model a dry brushstroke effect in the ink painting style; the stroke is achieved by generating the first stroke portion; and the second stroke portion is generated to give the side of the stroke facing away from the model a dry brushstroke effect in the ink painting style.

[0221] Next, an electronic device provided by an embodiment of the present disclosure is introduced. Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. The electronic device 800 may be equipped with a display device in a game described in an embodiment of the present disclosure, so as to realize the functions in an embodiment of the present disclosure. Specifically, the electronic device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (the number of processors 803 in the electronic device 800 may be one or more, Figure 5 In the example of FIG. 801 , the processor 803 may include an application processor 8031 ​​and a communication processor 8032. In some embodiments of the present disclosure, the receiver 801, the transmitter 802, the processor 803 and the memory 804 may be connected via a bus or other means.

[0222] The memory 804 may include a read-only memory and a random access memory, and provides instructions and data to the processor 803. A portion of the memory 804 may also include a non-volatile random access memory (NVRAM). The memory 804 stores processor and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0223] The processor 803 controls the operation of the execution device. In a specific application, the various components of the execution device are coupled together through a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are referred to as bus systems in the figure.

[0224] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 803, or implemented by the processor 803. The processor 803 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 803. The above processor 803 can be a general processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 803 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present disclosure. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 804, and the processor 803 reads the information in the memory 804 and completes the steps of the above method in combination with its hardware.

[0225] The receiver 801 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the execution device. The transmitter 802 can be used to output digital or character information through the first interface; the transmitter 802 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 802 can also include a display device such as a display screen.

[0226] In the embodiment of the present disclosure, the application processor 8031 ​​in the processor 803 is used to execute the display method in the game in the embodiment of the present disclosure. It should be noted that the specific manner in which the application processor 8031 ​​executes each step is based on the same concept as the various method embodiments in the present disclosure, and the technical effects it brings are the same as the various method embodiments in the present disclosure. For specific contents, please refer to the description in the method embodiments shown in the above disclosure, and no further description will be given here.

[0227] The disclosed embodiment also provides a chip for running instructions, which is used to execute the technical solution of the display method in the game in the above embodiment.

[0228] The embodiment of the present disclosure also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a processor, the processor executes the technical solution of the display method in the game in the above embodiment.

[0229] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, is used to execute the technical solution of the display method in the game in the above embodiments.

[0230] The computer readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or dedicated server.

[0231] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0232] Although the present disclosure is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present disclosure. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure shall be based on the scope defined by the claims of the present disclosure.

Claims

1. A display method in a game, characterized in that: The game includes a virtual model, and the method includes: In response to a rendering instruction for the virtual model, rendering the virtual model to obtain color data of the virtual model; Performing a first vertex expansion on the virtual model to obtain a first model; generating color data of a first hollow portion between the virtual model and the stroke portion based on the first model; Performing a second vertex expansion on the virtual model to obtain a second model; wherein the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion; generating color data of a second hollow portion located between the stroke portion and the first hollow portion based on the second model; Performing a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some of the vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion; generating color data of a first stroke portion among the stroke portions based on the third model; Performing a fourth vertex expansion on the virtual model to obtain a fourth model; wherein the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion; generating color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model; The virtual model with a hollow ink stroke effect is displayed according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

2. The method according to claim 1, characterized in that The method of displaying the virtual model with a hollow ink stroke effect according to the color data and depth data of the virtual model, the color data and depth data of the first hollowed-out part, the color data and depth data of the second hollowed-out part, the color data of the first stroke part, and the color data of the second stroke part comprises: Performing a fifth vertex expansion on the virtual model to obtain a fifth model; wherein the expansion distance of the fifth vertex expansion is greater than the expansion distance of the third vertex expansion; generating color data of a third stroke portion of the stroke portion located on a side of the second stroke portion away from the virtual model based on the fifth model; The virtual model having a hollow ink stroke effect and the stroke part having a wet brushstroke effect is displayed according to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, and the color data of the third stroke part.

3. The method according to claim 2, characterized in that The method of displaying the virtual model having a hollow ink stroke effect and a wet brush stroke effect on the stroke portion according to the color data and depth data of the virtual model, the color data and depth data of the first hollow portion, the color data and depth data of the second hollow portion, the color data of the first stroke portion, the color data of the second stroke portion, and the color data of the third stroke portion comprises: Generate a first image according to the color data and depth data of the virtual model, the color data and depth data of the first hollowed-out portion, the color data and depth data of the second hollowed-out portion, the color data of the first stroked portion, the color data of the second stroked portion, and the color data of the third stroked portion; generating a rendering target for representing the outline of the third stroke portion according to the depth data of the third stroke portion; superimposing noise on the rendering target to obtain a second image; Performing blur processing on the first image to obtain the third image; Mixing the first image and the third image based on the second image to obtain mixed color data; According to the mixed color data, the virtual model is displayed with a hollow ink stroke effect, and the stroke portion has a wet brushstroke effect and an ink smudge effect.

4. The method according to claim 2, characterized in that: The method of displaying the virtual model having a hollow ink stroke effect and a wet brush stroke effect on the stroke portion according to the color data and depth data of the virtual model, the color data and depth data of the first hollow portion, the color data and depth data of the second hollow portion, the color data of the first stroke portion, the color data of the second stroke portion, and the color data of the third stroke portion comprises: Performing a sixth vertex expansion on the virtual model to obtain a sixth model; wherein the expansion distance of the sixth vertex expansion is greater than the expansion distance of the third vertex expansion; generating color data of a fourth stroke portion of the stroke portion located on a side of the third stroke portion away from the virtual model based on the sixth model; the fourth stroke portion has a Fresnel transparent effect; According to the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, the color data of the second stroke part, the color data of the third stroke part, and the color data of the fourth stroke part, the virtual model with a hollow ink stroke effect and the stroke part with a wet brushstroke effect and an ink smudge effect is displayed.

5. The method according to claim 1, characterized in that The rendering of the virtual model to obtain color data of the virtual model includes: Configuring the transparency of the virtual model to be opaque; Performing backface culling on the virtual model; The front face of the virtual model is rendered according to the current illumination information and a preconfigured basic color map to obtain color data of the virtual model.

6. The method according to claim 5, characterized in that The step of rendering the front face of the virtual model according to the current illumination information and the preconfigured basic color map to obtain the color data of the virtual model includes: Periodically shifting the UV of the virtual model; Sample the pre-configured base color map according to the offset virtual model's UV; Process the sampled color data according to the current illumination information to obtain processed color data; The processed color data is mapped to the front face of the virtual model to obtain the color data of the virtual model.

7. The method according to claim 1, characterized in that The method further comprises: emitting sheet-like particles at a target position of the virtual model; Configuring UV flow effect for the surface flake particles; The sheet-like particles configured with UV flow effects are rendered and displayed.

8. The method according to claim 1, characterized in that Generating color data of the first hollowed-out portion based on the first model includes: Configure the transparency of the first model to be completely transparent; Configure the color of the first model to be a preset color; The colors of the first model are transparently mixed based on the transparency of the first model to obtain color data of the first hollowed-out part.

9. The method according to claim 1, characterized in that: Generating color data of the second hollowed-out portion based on the second model includes: Configure the transparency of the second model to be completely transparent; Configure the color of the second model to be a preset color; A transparency test is performed on the color of the second model based on a preconfigured noise map to obtain color data of the second hollowed-out portion.

10. The method according to claim 1, characterized in that Generating color data of the first stroke portion based on the third model includes: Configuring the transparency of the third model to be opaque; Performing front culling on the third model; The back surface of the third model is colored according to a preconfigured target color map to obtain color data of the first stroke portion.

11. The method according to claim 1, characterized in that: Generating color data of the second stroke portion based on the fourth model includes: Configuring the transparency of the fourth model to be opaque; Performing front culling on the fourth model; Coloring the back surface of the fourth model according to a preconfigured target color map to obtain the color of the fourth model; A transparency test is performed on the color of the fourth model based on a preconfigured noise map to obtain color data of the second stroke portion.

12. The method according to claim 2, characterized in that: Generating color data of the third stroke portion based on the fifth model includes: determining a transparency of the fifth model according to a preconfigured noise map; Performing front face culling on the fifth model; Coloring the back surface of the fifth model according to a preconfigured target color map to obtain the color of the fifth model; The color of the fifth model is transparently mixed based on the transparency of the fifth model to obtain color data of the third stroke portion.

13. The method according to claim 4, characterized in that Generating color data of the fourth stroke portion based on the sixth model includes: determining a Fresnel effect transparency of the sixth model; Performing front culling on the sixth model; The back surface of the sixth model is colored according to a preconfigured target color map to obtain color data of the fourth stroke portion.

14. The method according to claim 1, characterized in that The method further comprises: Determining a total illumination color corresponding to a target stroke position in the stroke portion according to current illumination information; Converting the total light color to light intensity; Mapping the light intensity into a preset light intensity range to obtain a target light intensity corresponding to the target stroke position; According to the target light intensity corresponding to the target stroke position, the color corresponding to the target stroke position is adjusted.

15. A display device in a game, characterized in that: The game includes a virtual model, and the device includes: A rendering module, configured to render the virtual model in response to a rendering instruction for the virtual model, and obtain color data of the virtual model; A first vertex expansion module, used for performing a first vertex expansion on the virtual model to obtain a first model; A first generating module, configured to generate color data of a first hollow portion located between the virtual model and the stroke portion based on the first model; A second vertex expansion module is used to perform a second vertex expansion on the virtual model to obtain a second model; the expansion distance of the second vertex expansion is greater than the expansion distance of the first vertex expansion; A second generating module, configured to generate color data of a second hollow portion located between the stroke portion and the first hollow portion based on the second model; A third vertex expansion module, configured to perform a third vertex expansion on the virtual model to obtain a third model; the expansion distance of at least some of the vertices of the virtual model during the third vertex expansion is greater than the expansion distance during the second vertex expansion; A third generating module, configured to generate color data of a first stroke portion in the stroke portions based on the third model; A fourth vertex expansion module, used for performing a fourth vertex expansion on the virtual model to obtain a fourth model; the expansion distance of the fourth vertex expansion is greater than the expansion distance of the third vertex expansion; a fourth generating module, configured to generate color data of a second stroke portion of the stroke portion located on a side of the first stroke portion away from the virtual model based on the fourth model; A display module is used to display the virtual model with a hollow ink stroke effect based on the color data and depth data of the virtual model, the color data and depth data of the first hollow part, the color data and depth data of the second hollow part, the color data of the first stroke part, and the color data of the second stroke part.

16. An electronic device, characterized in that: include: A processor, a memory, and computer program instructions stored on the memory and executable on the processor; When the processor executes the computer program instructions, the display method in the game as described in any one of claims 1 to 14 is implemented.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to implement the display method in the game as described in any one of claims 1 to 14 above.

Citation Information

Patent Citations

  • Model rendering method and device

    CN112070873A

  • Model rendering method and device and electronic equipment

    CN116051716A

  • Image stroking processing method and device, storage medium and electronic device

    CN118279211A

  • Method and device for generating outer contour stroking effect and electronic equipment

    CN118397157A

  • Interactive ink and wash style real-time 3D romance and method for realizing cartoon

    CN1991915A