Stroke display method and device, medium, electronic equipment and program product

By stroke the outer contour of the virtual object in the image space and overlaying it on the virtual scene screen, the problem of the virtual object's stroke effect becoming thinner when the line of sight distance changes, achieving consistency and clarity of the stroke effect.

CN119680189APending Publication Date: 2025-03-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411814690.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In UGC-type games, the stroke effect of virtual objects becomes thinner when the line of sight distance changes, making it difficult for players to clearly see the stroke effect at a larger line of sight distance.

Method used

By stroke the outer contour of the virtual object in the image space corresponding to the virtual scene picture, and overlay the stroke effect on the virtual scene picture, ensuring that the width of the stroke remains unchanged when the virtual scene is scaled.

Benefits of technology

The stroke effect is consistent when scaling the virtual scene, ensuring that players can always clearly see the selected state effect of the virtual object.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119680189A_ABST
    Figure CN119680189A_ABST
Patent Text Reader

Abstract

The invention relates to a stroking display method and device, a medium, electronic equipment and a program product, and relates to the technical field of computers, and the method comprises the following steps: displaying a virtual scene picture, responding to a selection operation for a virtual object in a virtual scene, stroking the outer contour of the virtual object in an image space corresponding to the virtual scene picture, and displaying a stroking result. According to the embodiment of the invention, the outer contour stroke of the virtual object is obtained, and the outer contour stroke of the virtual object is displayed on the virtual scene picture in an overlapping manner, so that when the virtual scene is zoomed, the width of the outer contour stroke is not influenced and is always kept consistent, and the consistency of the stroke effect is ensured.
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 stroke display method, device, medium, electronic device and program product. Background Art

[0002] In UGC (User Generated Content) type games, players or game developers can freely edit game scenes. In the process of editing game scenes, displaying the selected state effect of virtual objects (Entity) is of great significance for players to clearly understand the virtual objects currently being operated. Generally speaking, the selected state effect of virtual objects in virtual scenes can be presented by tracing the outer contour of the selected virtual objects to improve the visibility of virtual objects in game scenes.

[0003] In the related art, to display the stroke effect in the game scene, the model needs to be rendered twice. In the first rendering, the vertex coordinates of the model are first expanded outward along the normal direction and rendered using the stroke color. In the second rendering, the original vertices of the model are rendered normally. Then, the result of the second rendering is used to cover the part that is repeated with the result of the first rendering, so that the width of the expanded vertices that are not covered in the result of the first rendering is used as the stroke effect.

[0004] However, the width of the stroke obtained in this way will change with the change of the sight distance for the game scene. When the sight distance is large, the player may not even be able to see the stroke effect clearly. Summary of the invention

[0005] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0006] In a first aspect, the present disclosure provides a stroke display method, comprising: Displaying a virtual scene screen; In response to a selection operation on a virtual object in the virtual scene, in an image space corresponding to the virtual scene screen, stroking an outer contour of the virtual object to obtain an outer contour stroke of the virtual object; The outer contour stroke of the virtual object is superimposed and displayed on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

[0007] In a second aspect, the present disclosure provides a stroke display device, comprising: A first display module is configured to display a virtual scene image; A stroking module is configured to, in response to a selection operation on a virtual object in the virtual scene, stroke an outer contour of the virtual object in an image space corresponding to the virtual scene image to obtain an outer contour stroke of the virtual object; The second display module is configured to overlay and display the outer contour stroke of the virtual object on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

[0008] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0009] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.

[0010] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0011] Based on the above technical solution, by displaying a virtual scene picture, in response to a selection operation on a virtual object in the virtual scene, the outer contour of the virtual object is stroked in the image space corresponding to the virtual scene picture to obtain the outer contour stroke of the virtual object, and the outer contour stroke of the virtual object is superimposed and displayed on the virtual scene picture. This ensures that when the virtual scene is scaled, the width of the outer contour stroke will not be affected and will always remain consistent, thereby ensuring the consistency of the stroking effect.

[0012] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flowchart of a stroke display method according to some embodiments.

[0014] Figure 2 is a schematic diagram showing that a virtual object is at least partially obscured according to some embodiments.

[0015] Figure 3 is a flowchart of a stroke display method according to some other embodiments.

[0016] Figure 4 is a schematic diagram of a virtual scene screen according to some embodiments.

[0017] Figure 5 is a schematic diagram of a first image according to some embodiments.

[0018] Figure 6 is a schematic diagram of a second image according to some embodiments.

[0019] Figure 7 is a schematic diagram showing an outer contour stroke according to some embodiments.

[0020] Figure 8 yes Figure 3 A detailed flow chart of step 330 is shown.

[0021] Fig. 9 is a schematic diagram of a sampling range according to some embodiments.

[0022] Fig.10 is a schematic diagram of a second pixel point according to some embodiments.

[0023] Fig.11 is a schematic diagram of a virtual scene screen according to some embodiments.

[0024] Fig.12 is a schematic diagram of a first image according to some embodiments.

[0025] Fig.13 is a schematic diagram of an outer contour stroke according to some embodiments.

[0026] Fig.14 is a schematic diagram showing an outer contour stroke according to some embodiments.

[0027] Fig.15 is a schematic diagram illustrating a Gaussian blur effect according to some embodiments.

[0028] Fig.16 is a schematic diagram showing an outer contour stroke according to some other embodiments.

[0029] Fig.17 It is a schematic structural diagram of a stroke display device according to some embodiments.

[0030] Fig.18 is a schematic diagram of the structure of an electronic device according to some embodiments. DETAILED DESCRIPTION

[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

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

[0033] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0034] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0035] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

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

[0037] Figure 1 FIG. 1 is a flow chart of a method for displaying a stroke according to some embodiments. Figure 1 As shown, the embodiment of the present disclosure provides a stroke display method, which can be executed by an electronic device, specifically, by a stroke display device, which can be implemented by software and / or hardware and configured in the electronic device. Figure 1 As shown, the method may include the following steps.

[0038] In step 110, a virtual scene screen is displayed.

[0039] Here, the virtual scene screen includes a virtual scene. A virtual scene is a virtual scene displayed or provided when an application is running on an electronic device, wherein the virtual scene may refer to a game scene, such as a two-dimensional game scene, a three-dimensional game scene, and a virtual reality scene.

[0040] It should be understood that the virtual scene image may be an image obtained by capturing the virtual scene with a virtual camera.

[0041] In step 120 , in response to a selection operation on a virtual object in a virtual scene, an outer contour of the virtual object is stroked in an image space corresponding to the virtual scene image to obtain an outer contour stroke of the virtual object.

[0042] Here, the selection operation for the virtual object in the virtual scene may be a click operation, a box selection operation, etc. for the virtual object in the virtual scene. The virtual object may refer to an element used to construct an environment in the virtual scene. For example, the virtual object may be a model of a building, a tree, etc. in the virtual scene.

[0043] Outer contour stroke refers to an additional visual effect added to the outer contour line of a virtual object. After a virtual object in a virtual scene is selected, the virtual object is in a selected state. In order to show that the virtual object is in a selected state in the virtual scene, an outer contour stroke can be added to the virtual object to highlight the selected virtual object in the virtual scene.

[0044] The image space of the virtual scene picture is a two-dimensional space, which is a space composed of the width and height of the virtual scene picture. The image space corresponding to the virtual scene picture refers to an image space that is consistent with the image space of the virtual scene picture.

[0045] It should be noted that the size of the image space of the virtual scene picture can be determined by the size of the screen used to display the virtual scene picture. Therefore, tracing the outer contour of the virtual object in the image space corresponding to the virtual scene picture can also be understood as tracing the outer contour of the virtual object in the screen space.

[0046] The virtual object may be rendered into an image space corresponding to the virtual scene image, and then in the image space, based on a preset stroke width, the outer contour of the virtual object may be stroked to obtain the outer contour stroke of the virtual object.

[0047] It is worth noting that stroking the outer contour of the virtual object in the image space corresponding to the virtual scene picture does not mean directly stroking the outer contour of the virtual object in the virtual scene picture, but stroking the outer contour of the virtual object in the image space in an image space consistent with the image space of the virtual scene picture.

[0048] It should be understood that, in the embodiment of the present disclosure, the obtained outer contour stroke of the virtual object may be an image including the outer contour stroke of the virtual object.

[0049] In step 130 , an outer contour stroke of the virtual object is superimposed and displayed on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

[0050] Here, the outer contour stroke of the virtual object in the selected state may be superimposed on the virtual scene screen, thereby displaying the outer contour stroke of the virtual object in the selected state.

[0051] As some examples, the obtained outer contour stroke of the virtual object may be superimposed on the upper layer of the virtual scene screen for display.

[0052] As some further examples, the obtained outer contour stroke of the virtual object may be fused to an upper layer of the virtual scene picture, so that the outer contour stroke of the virtual object is displayed by displaying the fused virtual scene picture.

[0053] That is to say, in the embodiment of the present disclosure, the outer contour stroke of the virtual object can be superimposed and displayed by one image (the fused virtual scene picture), or the outer contour stroke of the virtual object can be superimposed and displayed by two images (the virtual scene picture and the outer contour stroke).

[0054] It is worth noting that since the outer contour stroke of the virtual object is obtained by stroking the outer contour of the virtual object in the image space corresponding to the virtual scene image, even if the size of the displayed virtual object changes, the width of the outer contour stroke of the virtual object before and after the size change is still the preset stroke width, so that the width of the outer contour stroke of the virtual object remains unchanged when the virtual scene is scaled.

[0055] For example, when the virtual scene is enlarged, the virtual object will also be enlarged accordingly, which is equivalent to the visual distance between the player and the virtual object becoming smaller. When the virtual scene is reduced, the virtual object will also be reduced accordingly, which is equivalent to the visual distance between the player and the virtual object becoming larger. At this time, based on the stroke display method provided by the embodiment of the present disclosure, since the outer contour stroke is obtained in the image space corresponding to the virtual scene screen, the outer contour stroke of the virtual object is related to the image space of the virtual scene screen, even if the virtual scene in the virtual scene screen changes, it will not affect the width of the outer contour stroke of the virtual object. Therefore, by superimposing the outer contour stroke of the virtual object obtained from the image space on the virtual scene screen, the width of the outer contour stroke of the enlarged virtual object can be consistent with the width of the outer contour stroke of the reduced virtual object in the player's vision, so that the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

[0056] It is worth noting that if the virtual object is outlined in the geometric space of the virtual scene, the outline is equivalent to the line in the virtual scene. When the virtual scene is zoomed in or out, the outline will also be zoomed in or out accordingly, so that the width of the outline changes with the distance of sight. When the distance of sight gradually increases, the user may not be able to see the outline of the virtual object. Moreover, the outline is also affected by perspective, resulting in a larger width of the outline near and a smaller width of the outline far away.

[0057] Based on the stroke display method provided by the embodiment of the present disclosure, when the player scales the virtual scene, the scaled virtual scene will also be presented through the virtual scene screen. Since the outer contour stroke is obtained in the image space corresponding to the virtual scene screen, even if the player scales the virtual scene, the width of the outer contour stroke will remain consistent, thereby ensuring the consistency of the outer contour stroke.

[0058] Therefore, by displaying the virtual scene picture, in response to the selection operation of the virtual object in the virtual scene, the outer contour of the virtual object is stroked in the image space corresponding to the virtual scene picture, the outer contour stroke of the virtual object is obtained, and the outer contour stroke of the virtual object is superimposed and displayed on the virtual scene picture. This ensures that when the virtual scene is scaled, the width of the outer contour stroke will not be affected and will always remain consistent, thereby ensuring the consistency of the stroking effect.

[0059] In some practicable implementations, when the virtual object is at least partially blocked, the outer contour stroke of the virtual object is a complete outer contour stroke of the virtual object.

[0060] Here, at least partially blocking the virtual object may mean that part or all of the virtual object is blocked. Figure 2 is a schematic diagram showing a virtual object being at least partially obscured according to some embodiments. Figure 2 As shown, in the virtual scene 201, the first virtual object 202 is blocked by the second virtual object 203 and the third virtual object 204. In this scene, the outer contour stroke 205 of the first virtual object 202 is the complete outer contour stroke of the first virtual object 202.

[0061] It should be noted that the complete outer contour stroke of the virtual object refers to the outer contour stroke obtained by stroking the complete outer contour line of the virtual object. Even if the virtual object is at least partially blocked in the virtual scene, the obtained outer contour stroke is still the complete outer contour stroke of the virtual object.

[0062] Therefore, through the above implementation, even if the virtual object in the selected state in the virtual scene is partially or completely blocked by other virtual objects, the complete outer contour stroke of the virtual object in the selected state can still be displayed, so that the player can clearly identify the virtual object in the virtual scene.

[0063] Figure 3 FIG. 1 is a flow chart of a method for displaying a stroke according to other embodiments. Figure 3 As shown, the following steps may be included.

[0064] In step 310, a virtual scene screen is displayed.

[0065] Here, the detailed description of step 310 can refer to the relevant description of step 110 in the above embodiment, which will not be repeated here.

[0066] In step 320 , the virtual object is rendered into a first image, wherein the first image is an image constructed based on an image space corresponding to the virtual scene screen.

[0067] Here, the virtual object in the selected state in the virtual scene can be rendered separately to the first image. The first image can be an image constructed based on the image space corresponding to the virtual scene screen. In other words, the width and height of the first image are consistent with the width and height of the virtual scene screen.

[0068] It should be understood that the size of the virtual object in the first image is consistent with the size, display angle, etc. of the virtual object in the virtual scene picture.

[0069] In Unity, you can use the LayerMask function provided by Unity to render the selected virtual object separately into the first image. You can set the selected virtual object as the stroke layer, and use filteringSettings in the DrawRenderers function to filter the layers to be drawn.

[0070] Of course, you can also use the CommandBuffer function provided by Unity to specify the virtual object in the selected state, so that the selected virtual object can be rendered into the first image. The CommandBuffer function stores a series of rendering commands, such as setting a rendering target or drawing a specific grid. Through the CommandBuffer function, you can insert and execute custom rendering commands at specific points in Unity's built-in rendering pipeline, thereby specifying the rendering of specific virtual objects to control the rendering process in a more fine-grained manner.

[0071] It is worth noting that in the embodiments of the present disclosure, the specific implementation method of rendering the virtual object to the first image is not limited, and the virtual object can be rendered to the first image using any game engine or any achievable rendering method.

[0072] Figure 4 is a schematic diagram of a virtual scene screen according to some embodiments. Figure 4 As shown, in the virtual scene picture 401, the virtual object 402 is a virtual object in a selected state.

[0073] Figure 5 is a schematic diagram of a first image according to some embodiments. Figure 5 As shown, a virtual object 402 in a virtual scene is rendered in a first image 403 .

[0074] It is worth noting that even if the virtual object in the virtual scene is blocked, the virtual object in the virtual scene will still be completely rendered in the first image. By rendering the virtual object to the first image, not only the outer contour stroke of the virtual object can be obtained through the first image, but also the complete outer contour stroke of the virtual object can be obtained.

[0075] In some embodiments, the virtual object is rendered to the first image by a solid color, and the color of the first image is different from the solid color.

[0076] The pure color referred to in the embodiments of the present disclosure is a material, and the pure color can be used as the material of the virtual object, and then the virtual object of the pure color material is rendered in the first image. For example, the pure color can be white, and the color of the first image can be black. Of course, the pure color can also be other colors, which can be set according to actual conditions.

[0077] It should be noted that rendering a virtual object to a first image using a solid color means using a solid color as a rendering material for the virtual object, and then rendering the virtual object of the solid color material to the first image. Since a solid color does not contain complex texture details, the inner contour of the virtual object in the first image will be weakened. The inner contour refers to the edge line inside the virtual object, which defines the shape and boundary of the internal structure of the virtual object. For example, the inner contour can be a hole, a groove, or a dividing line between different surfaces inside the virtual object. Moreover, by rendering the virtual object to the first image using a solid color, it is convenient to use the color channel to distinguish between pixels belonging to the virtual object and pixels that do not belong to the virtual object in the first image.

[0078] like Figure 5 As shown, the virtual object 402 is rendered in a completely black first image 403 using a white material.

[0079] In other embodiments, when the number of selected virtual objects is multiple, the multiple virtual objects are rendered to the first image using the same solid color to obtain an outer contour stroke corresponding to the overall outer contour formed by the multiple virtual objects through the first image, and the color of the first image is different from the solid color.

[0080] The number of selected virtual objects is multiple, which means that the number of virtual objects in the virtual scene is multiple. The multiple virtual objects are rendered to the first image using the same solid color. Since the multiple virtual objects use the same solid color, there will be no color difference in the overlapping parts, so that the outer contour stroke corresponding to the overall outer contour formed by the multiple virtual objects can be obtained through the first image.

[0081] It should be noted that the overall outer contour formed by the multiple virtual objects may refer to the outer contour curve formed together when the multiple virtual objects are combined together. When the multiple virtual objects include overlapping virtual objects, the overall outer contour corresponding to the overlapping virtual objects is a closed curve formed by connecting all vertices of the overlapping virtual objects in a certain order. When the multiple virtual objects include non-overlapping virtual objects, the overall outer contour of the multiple non-overlapping virtual objects is composed of the outer contour lines of each individual virtual object. Therefore, when the multiple virtual objects include overlapping virtual objects and non-overlapping virtual objects, the overall outer contour formed by the multiple virtual objects may include a closed curve formed by the overlapping virtual objects and the outer contour lines formed individually by each non-overlapping virtual object.

[0082] In step 330 , a second image including an outer contour stroke of the virtual object is obtained according to the first image.

[0083] Here, the pixel positions that need to be stroked can be calculated in the first graphic, and then based on the pixel positions, the second image including the stroke of the outer contour of the virtual object is drawn.

[0084] It should be noted that the second image may be an image constructed based on the image space corresponding to the virtual scene screen. In other words, the width and height of the second image may be consistent with the width and height of the virtual scene screen and the first image.

[0085] Figure 6 is a schematic diagram of a second image according to some embodiments. Figure 6 As shown, the second image 405 includes an outer contour stroke 404 .

[0086] It is worth noting that the area other than the outer contour stroke in the second image may be in a transparent state. Of course, the second image may also only include the pixel points of the outer contour stroke.

[0087] In step 340 , the second image is displayed superimposed on the virtual scene screen.

[0088] Here, the second image can be merged into the virtual scene screen to overlay and display the second image on the virtual scene screen. Figure 6 The outer outline stroke 404 is shown merged into Figure 4 In the virtual scene screen shown.

[0089] Figure 7 FIG. 1 is a schematic diagram showing an outer contour stroke according to some embodiments. Figure 7 As shown, the outer contour stroke 404 of the virtual object 402 is displayed in the virtual scene picture 401.

[0090] Therefore, through the above implementation, when the virtual scene is scaled, the width of the outer contour stroke will not be affected and will always remain consistent, thereby ensuring the consistency of the stroke effect. In addition, since the virtual object is rendered separately to the first image, and the outer contour stroke of the virtual object is superimposed on the upper layer of the virtual scene image, even if the virtual object is blocked in the virtual scene, the complete outer contour stroke of the virtual object can be displayed.

[0091] Figure 8 yes Figure 3 Detailed flow chart of step 330 is shown. Figure 8 As shown, in some possible implementations, the following steps may be included.

[0092] In step 331 , based on the color channel to which the virtual object belongs, a first pixel point that does not belong to the virtual object is determined in the first image.

[0093] Here, in the above embodiment, the virtual object is rendered into a first image different from the pure color through a solid color. Therefore, the first pixel point that does not belong to the virtual object can be determined in the first image through the color channel to which the solid color of the virtual object belongs and the color channel to which the background color of the first image belongs.

[0094] like Figure 5 As shown, the white virtual object 402 and the background color (black) in the first image 403 belong to different color channels, and the first pixel point that does not belong to the virtual object 402 can be determined in the first image 403 through the color channel.

[0095] For each pixel in the first image, whether the pixel is a pixel belonging to the virtual object can be determined based on the color channel to which the pixel belongs. If the color channel of the pixel is the color channel to which the virtual object belongs, the pixel is a pixel belonging to the virtual object. If the color channel of the pixel is not the color channel to which the virtual object belongs, the pixel is the first pixel that does not belong to the virtual object.

[0096] It is worth noting that, through the color channel, it is possible to distinguish in the first image whether each pixel of the first image is inside or outside the virtual object, thereby accurately tracing the outer contour of the virtual object.

[0097] In step 332, for each first pixel point, at least one pixel point is sampled in the first image within a sampling range with the first pixel point as the center and a preset stroke width as the radius.

[0098] Here, after the first pixel point is determined, for each first pixel point, it can be determined whether the first pixel point is a second pixel point that needs to be stroked.

[0099] For each determined first pixel point, at least one pixel point is sampled in the first image by taking the first pixel point as the center and the preset stroke width as the radius of the sampling range. The preset stroke width can be set according to actual conditions. For example, the preset stroke width can be 1 pixel, 2 pixels, etc.

[0100] Fig. 9 FIG. 4 is a schematic diagram showing a sampling range according to some embodiments. Fig. 9 As shown, a sampling range 902 is constructed with the first pixel point 901 as the center and the stroke width as the radius, and a plurality of pixel points are sampled from the first image through the sampling range 902 .

[0101] It should be understood that some or all of the pixels within the sampling range are sampled pixels.

[0102] In step 333, when the sampled pixel points include pixel points belonging to the virtual object, the first pixel point is determined as the second pixel point.

[0103] Here, if at least one of the sampled pixels belongs to a virtual object, it means that the first pixel is an edge point adjacent to the outer contour line of the virtual object. In this case, the first pixel is determined as the second pixel that needs to be stroked.

[0104] Fig.10 is a schematic diagram of a second pixel according to some embodiments. Fig.10 As shown, the gray pixel is the second pixel that needs to be stroked.

[0105] In step 334, a second image is generated according to the position information of the second pixel point, and the pixel points corresponding to the second pixel point in the second image include a stroke color.

[0106] Here, after all second pixel points are determined in the first image, the second image is generated based on the position information of the second pixel points in the first image. Exemplarily, on a transparent image belonging to the same image space as the first image, pixel points in the transparent image that match the position information of the second pixel points can be colored with a preset stroke color to obtain a second image including the outer contour stroke of the virtual object.

[0107] In some embodiments, the pixel points corresponding to the second pixel point in the initial image may be colored according to the position information of the second pixel point, and Gaussian blur processing may be performed on the colored pixel points based on a Gaussian blur algorithm to obtain a second image.

[0108] The initial image may be an image whose width and height are consistent with the width and height of the first image. Exemplarily, the initial image may refer to a transparent image. After obtaining the position information of the second pixel, the pixel corresponding to the second pixel in the initial image is colored using a preset stroke color, and the colored pixel is Gaussian blurred using a Gaussian blur algorithm.

[0109] The Gaussian blur algorithm is used to make the blur effect of the colored pixel diffuse to the side away from the virtual object. The side away from the virtual object refers to the external space outside the outer contour of the virtual object and does not belong to the virtual object. The Gaussian blur algorithm makes the blur effect diffuse to the outside of the virtual object, which can optimize the stroke effect without affecting the rendering of the virtual object itself.

[0110] The Gaussian blur algorithm diffuses the blur effect of the colored pixels toward the side away from the virtual object, thereby reducing the jaggedness of the outer contour stroke and making the outer contour stroke effect smoother and more natural.

[0111] Thus, through the above implementation, the virtual object is rendered to the first image, and by distinguishing the pixels that do not belong to the virtual object, the outer contour of the virtual object can be accurately and clearly drawn, avoiding drawing the inner contour line inside the virtual object.

[0112] The following is combined with Fig.11 To Attachment Fig.16 The stroke display method provided in the embodiment of the present disclosure is illustrated by way of example.

[0113] Fig.11 FIG. 1 is a schematic diagram of a virtual scene screen according to some embodiments. Fig.11 As shown, in response to a selection operation on a virtual object in a virtual scene, a corresponding virtual scene image is acquired.

[0114] Fig.12 is a schematic diagram of a first image according to some embodiments. Fig.12 As shown, in response to a selection operation on a virtual object in a virtual scene, a virtual object 1202 that needs to be stroked in the virtual scene is rendered into a first image 1201 using a solid color.

[0115] Fig.13 FIG. 4 is a schematic diagram of an outer contour stroke according to some embodiments. Fig.13 As shown, through Fig.12 The first image 1201 shown is used to obtain a second image 1301 including an outer contour stroke 1302 corresponding to the virtual object 1202.

[0116] Fig.14 FIG. 1 is a schematic diagram showing an outer contour stroke according to some embodiments. Fig.11 , Fig.13 and Fig.14 As shown, Fig.13 The outer contour stroke 1302 shown is merged into Fig.11 In the virtual scene picture shown, the outer contour stroke 1302 corresponding to the virtual object 1202 is displayed in the virtual scene picture.

[0117] Fig.15 FIG. 4 is a schematic diagram showing a Gaussian blur effect according to some embodiments. Fig.15 As shown, when drawing the outer contour stroke, a directional blur effect calculation is performed using a Gaussian blur algorithm, so that the blur effect of the outer contour stroke diffuses toward the side away from the virtual object.

[0118] Fig.16 is a schematic diagram showing an outer contour stroke according to some other embodiments. Fig.16 As shown, Fig.15The outer contour stroke after Gaussian blur processing is merged into the virtual scene image to reduce the jagged feeling of the outer contour stroke, making the outer contour stroke effect smoother and more natural.

[0119] Fig.17 FIG. 1 is a schematic diagram of a structure of a stroke display device according to some embodiments. Fig.17 As shown, the embodiment of the present disclosure provides a stroke display device 1700, and the stroke display device 1700 includes: The first display module 1701 is configured to display a virtual scene image; The stroking module 1702 is configured to, in response to a selection operation on a virtual object in the virtual scene, stroke an outer contour of the virtual object in an image space corresponding to the virtual scene image to obtain an outer contour stroke of the virtual object; The second display module 1703 is configured to overlay and display the outer contour stroke of the virtual object on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

[0120] Optionally, when the virtual object is at least partially blocked, the outer contour stroke of the virtual object is a complete outer contour stroke of the virtual object.

[0121] Optionally, the stroke module 1702 is specifically configured to: Rendering the virtual object to a first image, wherein the first image is an image constructed based on an image space corresponding to the virtual scene screen; Obtaining, according to the first image, a second image including an outer contour stroke of the virtual object; The second display module 1703 is specifically configured as follows: The second image is displayed superimposed on the virtual scene screen.

[0122] Optionally, the stroke module 1702 is specifically configured to: The virtual object is rendered into a first image by a solid color, and the color of the first image is different from the solid color.

[0123] Optionally, the stroke module 1702 is specifically configured to: When the number of selected virtual objects is multiple, the multiple virtual objects are rendered to a first image using the same solid color to obtain an outer contour stroke corresponding to the overall outer contour formed by the multiple virtual objects through the first image, and the color of the first image is different from the solid color.

[0124] Optionally, the stroke module 1702 is specifically configured to: Based on the color channel to which the virtual object belongs, determining a first pixel point that does not belong to the virtual object in the first image; For each of the first pixel points, sampling at least one pixel point in the first image within a sampling range with the first pixel point as the center and a preset stroke width as the radius; If the sampled pixel points include a pixel point belonging to the virtual object, determining the first pixel point as a second pixel point; A second image is generated according to the position information of the second pixel point, wherein the pixel points in the second image corresponding to the second pixel point include a stroke color.

[0125] Optionally, the stroke module 1702 is specifically configured as follows: According to the position information of the second pixel point, the pixel points in the initial image corresponding to the second pixel point are colored, and the colored pixel points are Gaussian blurred based on a Gaussian blur algorithm to obtain the second image, wherein the Gaussian blur algorithm is used to make the blur effect of the colored pixel points diffuse toward the side away from the virtual object.

[0126] The logic of the method executed by each functional module in the above-mentioned stroke display device 1700 can refer to the part of the method related to the above-mentioned embodiment, and will not be repeated here.

[0127] Reference below Fig.18 , which shows a schematic diagram of the structure of an electronic device (e.g., terminal device) 1800 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.18 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0128] like Fig.18As shown, the electronic device 1800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1802 or a program loaded from a storage device 1808 to a random access memory (RAM) 1803. In the RAM 1803, various programs and data required for the operation of the electronic device 1800 are also stored. The processing device 1801, the ROM 1802, and the RAM 1803 are connected to each other via a bus 1804. An input / output (I / O) interface 1805 is also connected to the bus 1804.

[0129] Typically, the following devices may be connected to the I / O interface 1805: an input device 1806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1809. The communication device 1809 may allow the electronic device 1800 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.18 The electronic device 1800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

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

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

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

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

[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: displays a virtual scene screen; in response to a selection operation on a virtual object in the virtual scene, strokes the outer contour of the virtual object in an image space corresponding to the virtual scene screen to obtain the outer contour stroke of the virtual object; and displays the outer contour stroke of the virtual object on the virtual scene screen in a superimposed manner, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

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

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

[0137] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

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

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

[0140] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

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

[0142] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A stroke display method, characterized in that: include: Displaying a virtual scene screen; In response to a selection operation on a virtual object in the virtual scene, in an image space corresponding to the virtual scene screen, stroking an outer contour of the virtual object to obtain an outer contour stroke of the virtual object; The outer contour stroke of the virtual object is superimposed and displayed on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

2. The method according to claim 1, characterized in that When the virtual object is at least partially blocked, the outer contour stroke of the virtual object is a complete outer contour stroke of the virtual object.

3. The method according to claim 1, characterized in that The step of stroking the outer contour of the virtual object in the image space corresponding to the virtual scene screen to obtain the outer contour stroke of the virtual object includes: Rendering the virtual object to a first image, wherein the first image is an image constructed based on an image space corresponding to the virtual scene screen; Obtaining, according to the first image, a second image including an outer contour stroke of the virtual object; The step of superimposing and displaying the outer contour stroke of the virtual object on the virtual scene screen includes: The second image is displayed superimposed on the virtual scene screen.

4. The method according to claim 3, characterized in that The rendering of the virtual object to the first image comprises: The virtual object is rendered into a first image by a solid color, and the color of the first image is different from the solid color.

5. The method according to claim 3, characterized in that: The rendering of the virtual object to the first image comprises: When the number of selected virtual objects is multiple, the multiple virtual objects are rendered to a first image using the same solid color to obtain an outer contour stroke corresponding to the overall outer contour formed by the multiple virtual objects through the first image, and the color of the first image is different from the solid color.

6. The method according to any one of claims 3 to 5, characterized in that The step of obtaining, according to the first image, a second image including an outer contour stroke of the virtual object comprises: Based on the color channel to which the virtual object belongs, determining a first pixel point that does not belong to the virtual object in the first image; For each of the first pixel points, sampling at least one pixel point in the first image within a sampling range with the first pixel point as the center and a preset stroke width as the radius; If the sampled pixel points include a pixel point belonging to the virtual object, determining the first pixel point as a second pixel point; A second image is generated according to the position information of the second pixel point, wherein the pixel points in the second image corresponding to the second pixel point include a stroke color.

7. The method according to claim 6, characterized in that Generating a second image according to the position information of the second pixel point includes: According to the position information of the second pixel point, the pixel points in the initial image corresponding to the second pixel point are colored, and the colored pixel points are Gaussian blurred based on a Gaussian blur algorithm to obtain the second image, wherein the Gaussian blur algorithm is used to make the blur effect of the colored pixel points diffuse toward the side away from the virtual object.

8. A stroke display device, characterized in that: include: A first display module is configured to display a virtual scene image; A stroking module is configured to, in response to a selection operation on a virtual object in the virtual scene, stroke an outer contour of the virtual object in an image space corresponding to the virtual scene image to obtain an outer contour stroke of the virtual object; The second display module is configured to overlay and display the outer contour stroke of the virtual object on the virtual scene screen, wherein the width of the outer contour stroke remains unchanged when the virtual scene is scaled.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.