Picture display method and device, computer device and storage medium
Patent Information
- Application Number
- CN202311212890.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-09-19
AI Technical Summary
一般的,射击游戏中包括有虚拟枪械、虚拟瞄准镜等,而在渲染虚拟瞄准镜时虚拟瞄准镜的准星一直位于虚拟瞄准镜的中心,使得虚拟瞄准镜的真实性较差,展示效果不佳
[0031]本公开提供了一种画面展示方法、装置、计算机设备及存储介质,在检测到虚拟场景内用于进行画面渲染的第一虚拟摄像机的位置调整时,基于第一虚拟摄像机的调整后位置信息、目标虚拟对象的展示位置和虚拟瞄准镜的镜面位置,确定准星贴图的准星对应的偏移后位置;并对虚拟瞄准镜上准星贴图进行调整操作,生成并展示虚拟瞄准镜内准星贴图的准星位于镜面的偏移后位置的调整后瞄准画面,其中调整后瞄准画面中所述准星与目标虚拟对象的至少部分区域重合。通过对准星贴图进行偏移的方式,实现了在虚拟场景内的虚拟瞄准镜中准星的偏移效果,使得虚拟瞄准镜中准星的位置会根据第一虚拟摄像机的变化而变化,即使得虚拟瞄准镜中准星的展示效果匹配展示场景中瞄准镜的光学效果,提高了虚拟瞄准镜的真实性和展示效果。
Smart Images

Figure CN117258281B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game technology, and more specifically, to a screen display method, apparatus, computer device, and storage medium. Background Technology
[0002] With the advancement of technology, Virtual Reality (VR) has developed rapidly and has been applied to various aspects, such as VR games. VR games include shooting games. Typically, shooting games include virtual weapons and virtual scopes. However, when rendering a virtual scope, the crosshair is always centered, resulting in poor realism and a subpar display effect. Summary of the Invention
[0003] This disclosure provides at least one screen display method, apparatus, computer device, and storage medium.
[0004] In a first aspect, embodiments of this disclosure provide a screen display method, including:
[0005] In response to triggering an aiming operation against a target virtual object within a virtual scene, a virtual scope and an initial aiming screen located on the inner surface of the virtual scope are displayed, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a portion of the target virtual object and the center position of the mirror surface.
[0006] When the position adjustment of the first virtual camera used for rendering the scene is detected in the virtual scene, the offset position of the crosshair of the crosshair texture is determined based on the adjusted position information of the first virtual camera, the display position of the target virtual object and the mirror position of the virtual scope.
[0007] The crosshair texture on the virtual sight is adjusted to generate and display an adjusted aiming screen in which the crosshair texture is located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a portion of the target virtual object.
[0008] In one optional implementation, determining the offset position of the crosshair texture based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual scope includes:
[0009] Based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined;
[0010] Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror is determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
[0011] In one optional implementation, the step of adjusting the reticle texture on the virtual sight to generate and display an adjusted aiming screen showing the reticle of the virtual sight texture at a position offset from the sight surface includes:
[0012] Determine the offset information of the offset position relative to the center position of the mirror surface;
[0013] For each pixel on the crosshair texture, based on the offset information and the texture coordinates of the pixel, the adjusted texture coordinates are determined, and the pixel information of the adjusted texture coordinates is replaced with the pixel information of the pixel to generate the offset crosshair texture;
[0014] The offset reticle texture is applied to the mirror surface of the virtual scope to generate and display an adjusted aiming screen in which the reticle texture of the virtual scope is located at the offset position on the mirror surface.
[0015] In one optional implementation, a second virtual camera is further provided within the virtual scene, and the second virtual camera follows the virtual sight; the initial aiming image is generated according to the following steps:
[0016] Using the second virtual camera, a virtual scene image including the target virtual object is determined within the virtual scene corresponding to the virtual aiming scope;
[0017] Based on the center position of the mirror, the crosshair texture is combined with the virtual scene image to obtain the initial aiming image.
[0018] In one optional implementation, the step of using the second virtual camera to determine the virtual scene image including the target virtual object corresponding to the virtual aiming scope within the virtual scene includes:
[0019] Using the second virtual camera, and based on the aiming direction of the virtual scope, a targeting scene matching the mirror size of the virtual scope is determined within the virtual scene, wherein the targeting scene includes at least a portion of the target virtual object;
[0020] The aiming scene is magnified according to the magnification of the virtual sight, and the virtual scene image that matches the size of the sight is determined from the magnified aiming scene.
[0021] In one optional implementation, the method further includes:
[0022] The first rendered image is determined based on the pose information of the first virtual camera;
[0023] Replace the partial rendering image displayed by the virtual sight in the first rendering image with the adjusted aiming image to generate the target rendering image;
[0024] Display the target rendered screen.
[0025] Secondly, embodiments of this disclosure also provide a screen display device, including:
[0026] The first display module is used to respond to an aiming operation against a target virtual object triggered in a virtual scene, and to display a virtual sight and an initial aiming screen located on the inner mirror of the virtual sight, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a part of the target virtual object and the center position of the mirror.
[0027] The determination module is used to determine the offset position of the crosshair of the crosshair texture based on the adjusted position information of the first virtual camera used for image rendering in the virtual scene, the display position of the target virtual object, and the mirror position of the virtual sight when the position adjustment of the first virtual camera is detected.
[0028] The second display module is used to adjust the crosshair texture on the virtual sight, generate and display the adjusted aiming screen with the crosshair of the crosshair texture in the virtual sight located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a part of the target virtual object.
[0029] Thirdly, embodiments of this disclosure also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.
[0030] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect or any possible implementation of the first aspect.
[0031] This disclosure provides a display method, apparatus, computer device, and storage medium. When the position adjustment of a first virtual camera used for rendering within a virtual scene is detected, the method determines the offset position of the crosshair in the crosshair map based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual scope. The method then adjusts the crosshair map on the virtual scope, generating and displaying an adjusted aiming image where the crosshair of the crosshair map is located at the offset position on the mirror surface. In the adjusted aiming image, the crosshair overlaps with at least a portion of the target virtual object. By offsetting the crosshair map, an offset effect of the crosshair in the virtual scope within the virtual scene is achieved, ensuring that the position of the crosshair in the virtual scope changes according to the changes in the first virtual camera. This makes the display effect of the crosshair in the virtual scope match the optical effect of the scope in the display scene, improving the realism and display effect of the virtual scope.
[0032] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0034] Figure 1 A flowchart illustrating a screen display method provided in some embodiments of this disclosure is shown;
[0035] Figure 2a This illustration shows a schematic diagram of the initial aiming screen in a screen display method provided in some embodiments of the present disclosure;
[0036] Figure 2b This illustration shows a schematic diagram of the adjusted aiming screen in a screen display method provided in some embodiments of the present disclosure;
[0037] Figure 3 This diagram illustrates the positional relationship between the mirror surfaces of the first virtual camera and the virtual aiming scope in the screen display method provided in some embodiments of this disclosure;
[0038] Figure 4The present disclosure shows a schematic diagram of the structure of a screen display device provided in some embodiments;
[0039] Figure 5 A schematic diagram of the structure of a computer device provided in some embodiments of this disclosure is shown. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0041] Research has found that shooting games include virtual firearms and virtual scopes. However, when rendering virtual scopes, the crosshair is always located in the center of the virtual scope, resulting in poor realism and unsatisfactory display effects.
[0042] Based on this, this disclosure provides a display method. When the position adjustment of the first virtual camera used for rendering within a virtual scene is detected, the method determines the offset position of the crosshair in the crosshair map based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual scope. The method then adjusts the crosshair map on the virtual scope, generating and displaying an adjusted aiming image where the crosshair of the crosshair map is located at the offset position on the mirror surface. In the adjusted aiming image, the crosshair overlaps with at least a portion of the target virtual object. By offsetting the crosshair map, the crosshair in the virtual scope is shifted, causing its position to change according to the changes in the first virtual camera. This ensures that the display effect of the crosshair in the virtual scope matches the optical effect of the scope in the display scene, improving the realism and display effect of the virtual scope.
[0043] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0044] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0045] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0046] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0047] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0048] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0049] To facilitate understanding of this embodiment, a screen display method disclosed in this disclosure will first be described in detail. The execution subject of the screen display method provided in this disclosure is generally a computer device with certain computing capabilities, such as a VR device. In some possible implementations, the screen display method can be implemented by a processor calling computer-readable instructions stored in memory.
[0050] See Figure 1 The diagram shown is a flowchart of a screen display method provided in an embodiment of this disclosure. The method includes steps S101 to S103, wherein:
[0051] S101. In response to triggering an aiming operation against a target virtual object in a virtual scene, a virtual sight and an initial aiming screen located on the inner surface of the virtual sight are displayed, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a portion of the target virtual object and the center position of the mirror surface.
[0052] Virtual scenes can be, for example, virtual reality scenes, that is, virtual scenes constructed through virtual reality technology. This disclosure does not impose specific limitations on the style, content, etc. of virtual scenes.
[0053] In practice, users can use VR devices to display virtual scenes and perform operations within those scenes, such as shooting, moving, and aiming.
[0054] The aiming operation is triggered within the virtual scene, that is, the user aims at the target virtual object through a virtual scope; for example, the aiming direction can be determined based on the pose of the first virtual camera and the pose of the virtual scope, and the nearest object aimed within that aiming direction is identified as the target virtual object. The first virtual camera is a camera constructed within the virtual scene for scene rendering, and the pose of the first virtual camera is determined based on the pose of the user using the VR device.
[0055] The virtual sight is a constructed 3D model that responds to aiming operations against virtual targets within a virtual scene, displaying the virtual sight. During implementation, the rendering position of the virtual sight can be determined based on the position of the virtual weapon in the virtual scene, and the 3D model of the virtual sight can be rendered at that position to achieve the display of the virtual sight.
[0056] And display the initial aiming screen located on the inner surface of the virtual scope, the initial aiming screen as follows: Figure 2a As shown, in the initial aiming screen, the crosshair 21 of the crosshair texture is aligned with the target virtual object (i.e., Figure 2a At least a portion of the area of the virtual sight (of the aircraft) coincides with the center of the mirror, meaning the crosshair of the virtual sight 20 is located at the center of the virtual sight.
[0057] During implementation, the aiming direction can be determined based on the pose of the first virtual camera and the virtual sight, and a local scene image within the aiming direction can be obtained. The local scene image and the crosshair texture located at the center of the mirror can be combined to obtain the initial aiming image, which can then be displayed through the virtual sight.
[0058] In one optional embodiment, a second virtual camera is further provided in the virtual scene, and the second virtual camera follows the virtual sight; the initial aiming image is generated according to the following steps, including: using the second virtual camera to determine the virtual scene image of the virtual sight in the virtual scene, which includes the target virtual object; and combining the crosshair texture with the virtual scene image based on the center position of the sight to obtain the initial aiming image.
[0059] This disclosure can also include a second virtual camera, which follows the virtual scope and is used to render the virtual scene image included within the virtual scope. By setting up a first virtual camera and a second virtual camera, the first virtual camera can be used to render the global scene image, and the second virtual camera can be used to render the local scene image within the virtual scope. When the user views the virtual scope, the image rendered by the second virtual camera can be displayed within the virtual scope. When the user views other scenes besides the virtual scope, the image rendered by the first virtual camera can be displayed. For example, when the virtual scope has a magnification, the magnified image can be displayed within the virtual scope, while other scenes remain normal, increasing the realism of the rendered scene image.
[0060] In practice, a second virtual camera can be used to determine the virtual scene view of a virtual scope within the virtual scene. Since the virtual scope is aiming at the target virtual object, the target virtual object is included in the virtual scene view. For example, based on the pose of the second virtual camera, a virtual scene view matching that pose can be determined from the overall virtual scene.
[0061] In one optional embodiment, determining the virtual scene image containing the target virtual object corresponding to the virtual scope within the virtual scene using the second virtual camera includes: using the second virtual camera to determine an aiming scene within the virtual scene that matches the mirror size of the virtual scope, based on the aiming direction of the virtual scope, wherein the aiming scene includes at least a portion of the target virtual object; magnifying the aiming scene according to the magnification of the virtual scope, and determining the virtual scene image matching the mirror size from the magnified aiming scene.
[0062] During implementation, a second virtual camera is used to determine the aiming scene within the virtual scene that matches the mirror size of the virtual scope, based on the aiming direction of the virtual scope. Since aiming is performed on the virtual object, the aiming scene includes at least a portion of the target virtual object. The aiming scene is then magnified according to the magnification of the virtual scope, resulting in a magnified aiming scene. Based on the mirror size of the virtual scope, and using the center of the aiming scene as a reference, a virtual scene image matching the mirror size is extracted from the magnified aiming scene.
[0063] By utilizing a second virtual camera, and based on the magnification of the virtual scope, a magnified virtual scene can be displayed within the virtual scope, enabling flexible display of the virtual scope's mirror image.
[0064] S102. When the position of the first virtual camera used for rendering the image within the virtual scene is adjusted, the offset position of the crosshair texture is determined based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight.
[0065] The position of the first virtual camera is detected in real time within the virtual scene. When the position adjustment of the first virtual camera is detected, the expression information of the observation line from the adjusted position of the first virtual camera to the display position of the target virtual object can be determined. Based on the mirror position of the virtual scope, the intersection point between the virtual scope and the observation line is determined, and this intersection point is determined as the offset position of the crosshair of the crosshair texture.
[0066] In one optional implementation, determining the offset position of the crosshair texture based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight includes: determining the observation direction information of the first virtual camera based on the adjusted position information of the first virtual camera and the display position of the target virtual object; determining the intersection point of the observation line indicated by the observation direction information and the mirror based on the mirror position of the virtual sight, and determining the intersection point as the offset position of the crosshair texture.
[0067] During implementation, based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined. For example, the adjusted position information and the display position of the target virtual object can include coordinate values in the three-dimensional coordinate system of the virtual scene. Subtracting the coordinate values included in the display position of the target virtual object from the coordinate values included in the adjusted position information of the first virtual camera yields the observation direction vector, which is determined as the observation direction information.
[0068] The mirror position of the virtual sight can include coordinate values in the three-dimensional coordinate system of the virtual scene. Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror can be determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
[0069] See Figure 3 As shown, Figure 3 The diagram shows that when the first virtual camera is in the first position, the crosshair coincides with the center of the mirror. When the first virtual camera moves to the second position, the offset position can be determined based on the position of the first virtual camera and the position of the target virtual object, so as to perform an offset operation on the crosshair map and achieve the effect of the crosshair coinciding with the offset position.
[0070] S103. Adjust the crosshair texture on the virtual sight to generate and display an adjusted aiming screen in which the crosshair texture of the virtual sight is located at the offset position on the sight surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a portion of the target virtual object.
[0071] After obtaining the offset position, adjustments can be made to the reticle texture on the virtual scope, such as offsetting it, so that the reticle in the reticle texture is moved from the center position to the offset position. This generates and displays the adjusted aiming view, where the reticle in the virtual scope is located at the offset position on the scope surface. In the adjusted aiming view, the reticle overlaps with at least a portion of the target virtual object. The adjusted aiming view is as follows: Figure 2b As shown.
[0072] In practice, after the positions of both the first and second virtual cameras have changed, the target virtual object can be re-determined based on the changed position of the second virtual camera, and the offset position can be determined based on the relevant positional relationship between the first and second virtual cameras. The offset position and adjusted aiming view can be found in the above description and will not be detailed here.
[0073] In one optional embodiment, the step of adjusting the reticle texture on the virtual sight to generate and display an adjusted aiming screen in which the reticle texture of the virtual sight is located at an offset position on the mirror surface includes: determining the offset information of the offset position relative to the center position of the mirror surface; for each pixel on the reticle texture, determining the adjusted texture coordinates based on the offset information and the texture coordinates of the pixel, and replacing the pixel information of the adjusted texture coordinates with the pixel information of the pixel to generate an offset reticle texture; applying the offset reticle texture to the mirror surface of the virtual sight to generate and display an adjusted aiming screen in which the reticle texture of the virtual sight is located at an offset position on the mirror surface.
[0074] During implementation, the crosshair map can be a UV material map. The offset information on the mirror surface can be determined based on the offset position and center position, and then converted to the UV coordinate system corresponding to the crosshair map to obtain the offset information in the UV coordinate system.
[0075] For example, the rendering of a virtual scene can be achieved using a game engine. The game engine can then determine the offset information in the UV coordinate system based on the offset information on the mirror surface. The game engine can then process the reticle map; that is, for each pixel on the reticle map, based on the offset information and the pixel's map coordinates, the adjusted map coordinates are determined, and the pixel information of the adjusted map coordinates is replaced with the pixel information of the pixel. After pixel replacement of each pixel on the reticle map, the offset reticle map is obtained. This offset reticle map is then used on the mirror surface of a virtual scope to generate and display an adjusted aiming screen where the reticle of the reticle map is located at the offset position on the mirror surface, thus realizing the reticle map offset operation.
[0076] Here, by replacing the pixel information of the pixels on the crosshair map based on the offset information, the crosshair map is adjusted, and then the crosshair is offset when the crosshair map is used in the virtual scope.
[0077] In one optional embodiment, the method further includes: determining a first rendering screen based on the pose information of the first virtual camera; replacing the partial rendering screen displayed by the mirror of the virtual aiming scope in the first rendering screen with the adjusted aiming screen to generate a target rendering screen; and displaying the target rendering screen.
[0078] During implementation, the first rendered image is determined based on the pose information of the first virtual camera. For example, a game engine can be used to render the virtual model within the rendering range of the first virtual camera in the virtual scene to obtain the first rendered image. Then, the partial rendered image displayed by the mirror of the virtual scope in the first rendered image is replaced with the adjusted aiming image to generate the target rendered image. That is, the adjusted aiming image in the target rendered image is rendered by the second virtual camera, while all other images besides the adjusted aiming image are rendered by the first virtual camera. This achieves separate rendering and display of the virtual scope's aiming image, improving the realism of the target rendered image.
[0079] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0080] Based on the same inventive concept, this disclosure also provides a screen display device corresponding to the screen display method. Since the principle of the device in this disclosure for solving the problem is similar to the screen display method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0081] Reference Figure 4 The diagram shown is a schematic representation of the architecture of a screen display device provided in an embodiment of this disclosure. The device includes: a first display module 401, a determining module 402, and a second display module 403; wherein:
[0082] The first display module 401 is used to respond to an aiming operation against a target virtual object triggered in a virtual scene, and to display a virtual sight and an initial aiming screen located on the inner mirror of the virtual sight, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a part of the target virtual object and the center position of the mirror.
[0083] The determining module 402 is used to determine the offset position of the crosshair of the crosshair texture based on the adjusted position information of the first virtual camera used for image rendering in the virtual scene, the display position of the target virtual object, and the mirror position of the virtual sight when the position adjustment of the first virtual camera used for image rendering in the virtual scene is detected.
[0084] The second display module 403 is used to adjust the crosshair texture on the virtual sight, generate and display the adjusted aiming screen with the crosshair of the crosshair texture in the virtual sight located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a part of the target virtual object.
[0085] In one optional embodiment, the determining module 402, when determining the offset position corresponding to the crosshair of the crosshair texture based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight, is used to:
[0086] Based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined;
[0087] Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror is determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
[0088] In one optional embodiment, the second display module 403, when adjusting the reticle texture on the virtual sight to generate and display the adjusted aiming screen where the reticle of the reticle texture in the virtual sight is offset from the sight surface, is used to:
[0089] Determine the offset information of the offset position relative to the center position of the mirror surface;
[0090] For each pixel on the crosshair texture, based on the offset information and the texture coordinates of the pixel, the adjusted texture coordinates are determined, and the pixel information of the adjusted texture coordinates is replaced with the pixel information of the pixel to generate the offset crosshair texture;
[0091] The offset reticle texture is applied to the mirror surface of the virtual scope to generate and display an adjusted aiming screen in which the reticle texture of the virtual scope is located at the offset position on the mirror surface.
[0092] In one optional embodiment, a second virtual camera is further provided within the virtual scene, and the second virtual camera follows the virtual aiming scope; the first display module 401 is used to generate the initial aiming image according to the following steps:
[0093] Using the second virtual camera, a virtual scene image including the target virtual object is determined within the virtual scene corresponding to the virtual aiming scope;
[0094] Based on the center position of the mirror, the crosshair texture is combined with the virtual scene image to obtain the initial aiming image.
[0095] In one optional embodiment, the first display module 401, when using the second virtual camera to determine the virtual scene image containing the target virtual object corresponding to the virtual aiming scope within the virtual scene, is used to:
[0096] Using the second virtual camera, and based on the aiming direction of the virtual scope, a targeting scene matching the mirror size of the virtual scope is determined within the virtual scene, wherein the targeting scene includes at least a portion of the target virtual object;
[0097] The aiming scene is magnified according to the magnification of the virtual sight, and the virtual scene image that matches the size of the sight is determined from the magnified aiming scene.
[0098] In one optional embodiment, the second display module 403 is further configured to:
[0099] The first rendered image is determined based on the pose information of the first virtual camera;
[0100] Replace the partial rendering image displayed by the virtual sight in the first rendering image with the adjusted aiming image to generate the target rendering image;
[0101] Display the target rendered screen.
[0102] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0103] Based on the same technical concept, this disclosure also provides a computer device. (See also...) Figure 5 The diagram shows the structure of a computer device 500 provided in this embodiment of the present disclosure, including a processor 501, a memory 502, and a bus 503. The memory 502 stores execution instructions and includes main memory 5021 and external memory 5022. The main memory 5021, also called internal memory, is used to temporarily store computational data in the processor 501 and data exchanged with external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the main memory 5021. When the computer device 500 is running, the processor 501 and the memory 502 communicate through the bus 503, causing the processor 501 to execute the following instructions:
[0104] In response to triggering an aiming operation against a target virtual object within a virtual scene, a virtual scope and an initial aiming screen located on the inner surface of the virtual scope are displayed, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a portion of the target virtual object and the center position of the mirror surface.
[0105] When the position adjustment of the first virtual camera used for rendering the scene is detected in the virtual scene, the offset position of the crosshair of the crosshair texture is determined based on the adjusted position information of the first virtual camera, the display position of the target virtual object and the mirror position of the virtual scope.
[0106] The crosshair texture on the virtual sight is adjusted to generate and display an adjusted aiming screen in which the crosshair texture is located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a portion of the target virtual object.
[0107] In an optional implementation, the instruction executed by processor 501, which determines the offset position of the crosshair map based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight, includes:
[0108] Based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined;
[0109] Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror is determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
[0110] In one optional implementation, the instruction executed by processor 501, which involves adjusting the crosshair texture on the virtual sight to generate and display an adjusted aiming screen showing the crosshair of the virtual sight texture at an offset position on the sight surface, includes:
[0111] Determine the offset information of the offset position relative to the center position of the mirror surface;
[0112] For each pixel on the crosshair texture, based on the offset information and the texture coordinates of the pixel, the adjusted texture coordinates are determined, and the pixel information of the adjusted texture coordinates is replaced with the pixel information of the pixel to generate the offset crosshair texture;
[0113] The offset reticle texture is applied to the mirror surface of the virtual scope to generate and display an adjusted aiming screen in which the reticle texture of the virtual scope is located at the offset position on the mirror surface.
[0114] In one optional implementation, the instructions executed by processor 501 further include a second virtual camera within the virtual scene, the second virtual camera following the virtual aiming scope; and generating the initial aiming image according to the following steps:
[0115] Using the second virtual camera, a virtual scene image including the target virtual object is determined within the virtual scene corresponding to the virtual aiming scope;
[0116] Based on the center position of the mirror, the crosshair texture is combined with the virtual scene image to obtain the initial aiming image.
[0117] In one optional implementation, the instructions executed by processor 501, wherein determining the virtual scene image including the target virtual object corresponding to the virtual aiming scope within the virtual scene using the second virtual camera, includes:
[0118] Using the second virtual camera, and based on the aiming direction of the virtual scope, a targeting scene matching the mirror size of the virtual scope is determined within the virtual scene, wherein the targeting scene includes at least a portion of the target virtual object;
[0119] The aiming scene is magnified according to the magnification of the virtual sight, and the virtual scene image that matches the size of the sight is determined from the magnified aiming scene.
[0120] In an optional implementation, the method further includes the following instructions executed by the processor 501:
[0121] The first rendered image is determined based on the pose information of the first virtual camera;
[0122] Replace the partial rendering image displayed by the virtual sight in the first rendering image with the adjusted aiming image to generate the target rendering image;
[0123] Display the target rendered screen.
[0124] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the screen display method described in the above-described method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0125] This disclosure also provides a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the screen display method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0126] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0129] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0131] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for displaying images, characterized in that, include: In response to triggering an aiming operation against a target virtual object within a virtual scene, a virtual scope and an initial aiming screen located on the inner surface of the virtual scope are displayed, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a portion of the target virtual object and the center position of the mirror surface. When the position adjustment of the first virtual camera used for rendering the scene is detected in the virtual scene, the offset position of the crosshair of the crosshair texture is determined based on the adjusted position information of the first virtual camera, the display position of the target virtual object and the mirror position of the virtual scope. The crosshair texture on the virtual sight is adjusted to generate and display an adjusted aiming screen in which the crosshair texture is located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a portion of the target virtual object.
2. The method according to claim 1, characterized in that, The step of determining the offset position of the crosshair texture based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight includes: Based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined; Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror is determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
3. The method according to claim 1, characterized in that, The step of adjusting the reticle texture on the virtual sight to generate and display an adjusted aiming screen showing the reticle of the virtual sight positioned after offset from the sight surface includes: Determine the offset information of the offset position relative to the center position of the mirror surface; For each pixel on the crosshair texture, based on the offset information and the texture coordinates of the pixel, the adjusted texture coordinates are determined, and the pixel information of the adjusted texture coordinates is replaced with the pixel information of the pixel to generate the offset crosshair texture; The offset reticle texture is applied to the mirror surface of the virtual scope to generate and display an adjusted aiming screen in which the reticle texture of the virtual scope is located at the offset position on the mirror surface.
4. The method according to claim 1, characterized in that, A second virtual camera is also set up within the virtual scene, and the second virtual camera follows the virtual sight; the initial aiming image is generated according to the following steps, including: Using the second virtual camera, a virtual scene image including the target virtual object is determined within the virtual scene corresponding to the virtual aiming scope; Based on the center position of the mirror, the crosshair texture is combined with the virtual scene image to obtain the initial aiming image.
5. The method according to claim 4, characterized in that, The step of using the second virtual camera to determine the virtual scene image, including the target virtual object, corresponding to the virtual aiming scope within the virtual scene includes: Using the second virtual camera, and based on the aiming direction of the virtual scope, a targeting scene matching the mirror size of the virtual scope is determined within the virtual scene, wherein the targeting scene includes at least a portion of the target virtual object; The aiming scene is magnified according to the magnification of the virtual sight, and the virtual scene image that matches the size of the sight is determined from the magnified aiming scene.
6. The method according to claim 1, characterized in that, The method further includes: The first rendered image is determined based on the pose information of the first virtual camera; Replace the partial rendering image displayed by the virtual sight in the first rendering image with the adjusted aiming image to generate the target rendering image; Display the rendered image of the target.
7. A display device, characterized in that, include: The first display module is used to respond to an aiming operation against a target virtual object triggered in a virtual scene, and to display a virtual sight and an initial aiming screen located on the inner mirror of the virtual sight, wherein the crosshair of the crosshair texture in the initial aiming screen coincides with at least a part of the target virtual object and the center position of the mirror. The determination module is used to determine the offset position of the crosshair of the crosshair texture based on the adjusted position information of the first virtual camera used for image rendering in the virtual scene, the display position of the target virtual object, and the mirror position of the virtual sight when the position adjustment of the first virtual camera is detected. The second display module is used to adjust the crosshair texture on the virtual sight, generate and display the adjusted aiming screen with the crosshair of the crosshair texture in the virtual sight located at the offset position on the mirror surface, wherein the crosshair in the adjusted aiming screen overlaps with at least a part of the target virtual object.
8. The apparatus according to claim 7, characterized in that, The determining module, when determining the offset position of the crosshair map based on the adjusted position information of the first virtual camera, the display position of the target virtual object, and the mirror position of the virtual sight, is used for: Based on the adjusted position information of the first virtual camera and the display position of the target virtual object, the observation direction information of the first virtual camera is determined; Based on the mirror position of the virtual sight, the intersection point of the observation line indicated by the observation direction information and the mirror is determined, and the intersection point is determined as the offset position of the crosshair of the crosshair texture.
9. A computer device, characterized in that, include: The computer device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the screen display method as described in any one of claims 1 to 6 are performed.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the screen display method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Information processing method and device, electronic equipment and storage medium
CN107168611A
Front sight control method and device in virtual scene, electronic equipment and storage medium
CN114344880A