Image rendering method, device, storage medium and electronic device

CN116899219BActive Publication Date: 2026-09-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310878036.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-17
Publication Date
2026-09-25
Estimated Expiration
2043-07-17

AI Technical Summary

Technical Problem

[0005]本公开至少部分实施例提供了一种图像渲染方法、装置、存储介质和电子装置,以至少解决相关技术中对游戏场景中的灯光进行灯光调试的效率较低的技术问题

Benefits of technology

[0010]在本公开至少部分实施例中,采用对图形用户界面进行划分,得到多个区域,并将多个区域对应的虚拟光源的数量分别渲染在多个区域上的方式,达到了在图形用户界面上直接显示虚拟光源的数量的目的,使得开发人员可以直观地在图形用户界面上看到不同区域内虚拟光源的数量,进一步可以基于直观看到的虚拟光源的数量,确定不同区域是否存在性能问题,从而实现了提高灯光调试效率,简化开发人员工作复杂度,提升游戏性能的技术效果,进而解决了相关技术中对游戏场景中的灯光进行灯光调试的效率较低的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116899219B_ABST
    Figure CN116899219B_ABST
Patent Text Reader

Abstract

The present disclosure discloses an image rendering method, device, storage medium and electronic device. The method comprises: dividing a graphical user interface to obtain a plurality of regions; determining the number of virtual light sources corresponding to the plurality of regions, wherein the virtual light source is used to represent a light source located in a virtual scene, and the plurality of regions are respectively located in the illumination range of the corresponding virtual light source; and rendering the number of virtual light sources corresponding to the plurality of regions on the plurality of regions respectively. The present disclosure solves the technical problem of low efficiency of light debugging in a game scene in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image rendering technology, and more specifically, to an image rendering method, apparatus, storage medium, and electronic device. Background Technology

[0002] Currently, in order to render more realistic and sufficient lighting information in game scenes, ForwardPlus lighting rendering technology can be used. This technology can divide the game scene into multiple regions and calculate all virtual light sources that may affect virtual objects in each region, thereby drawing the corresponding game scene based on the above information.

[0003] However, incorrect lighting of virtual objects in a game scene can lead to serious performance issues. To avoid this, developers can use lighting debugging methods to locate the problematic lights. During debugging, developers can determine whether performance issues exist in different areas based on the light placement information in the game scene, and then manually control the on / off state of all virtual light sources to pinpoint the problematic one. However, this debugging process is complex and time-consuming, resulting in low efficiency in lighting debugging.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This disclosure provides at least some embodiments of an image rendering method, apparatus, storage medium, and electronic device to at least address the technical problem of low efficiency in adjusting lighting in game scenes in related technologies.

[0006] According to one embodiment of this disclosure, an image rendering method is provided, comprising: dividing a graphical user interface to obtain multiple regions; determining the number of virtual light sources corresponding to the multiple regions, wherein the virtual light sources are used to represent light sources located in a virtual scene, and the multiple regions are respectively located within the illumination range of the corresponding virtual light sources; and rendering the number of virtual light sources corresponding to the multiple regions onto the multiple regions respectively.

[0007] According to one embodiment of this disclosure, an image rendering apparatus is also provided, comprising: a division module for dividing a graphical user interface to obtain multiple regions; a determination module for determining the number of virtual light sources corresponding to the multiple regions, wherein the virtual light sources are used to represent light sources located in a virtual scene, and the multiple regions are respectively located within the illumination range of the corresponding virtual light sources; and a rendering module for rendering the number of virtual light sources corresponding to the multiple regions onto the multiple regions respectively.

[0008] According to one embodiment of the present disclosure, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the methods described in any of the preceding claims when executed.

[0009] According to one embodiment of this disclosure, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory and the processor is configured to run the computer program to perform any of the methods described above.

[0010] In at least some embodiments of this disclosure, the graphical user interface is divided into multiple regions, and the number of virtual light sources corresponding to each region is rendered on the multiple regions respectively. This achieves the purpose of directly displaying the number of virtual light sources on the graphical user interface, allowing developers to intuitively see the number of virtual light sources in different regions on the graphical user interface. Furthermore, based on the intuitively seen number of virtual light sources, it is possible to determine whether there are performance problems in different regions. This achieves the technical effect of improving lighting debugging efficiency, simplifying the complexity of developers' work, and improving game performance, thereby solving the technical problem of low efficiency in lighting debugging of game scenes in related technologies. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this disclosure, illustrate exemplary embodiments of the present disclosure and are used to explain the disclosure, but do not constitute an undue limitation of the disclosure. In the drawings:

[0012] Figure 1 This is a hardware structure block diagram of a mobile terminal for an image rendering method according to an embodiment of the present disclosure.

[0013] Figure 2 This is a flowchart of an image rendering method according to one embodiment of the present disclosure;

[0014] Figure 3 This is a schematic diagram of a digital texture map according to one embodiment of the present disclosure;

[0015] Figure 4 This is a schematic diagram of an image rendering result according to one embodiment of the present disclosure;

[0016] Figure 5 This is a flowchart of an optional image rendering method according to one embodiment of the present disclosure;

[0017] Figure 6 This is a schematic diagram of an image rendering apparatus according to one embodiment of the present disclosure;

[0018] Figure 7 This is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0019] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.

[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] In one possible implementation, the inventors, after practical experience and careful research, found that the efficiency of adjusting lighting in game scenes remains low. Therefore, this disclosure proposes an image rendering method that divides the graphical user interface into multiple regions and renders the number of virtual light sources corresponding to each region separately. This achieves the goal of directly displaying the number of virtual light sources on the graphical user interface, allowing developers to intuitively see the number of virtual light sources in different regions. Furthermore, based on the intuitively seen number of virtual light sources, it can determine whether there are performance problems in different regions, thereby improving lighting adjustment efficiency, simplifying the workload of developers, and enhancing game performance. This solves the technical problem of low efficiency in adjusting lighting in game scenes in related technologies.

[0022] The methods and embodiments described above in this disclosure can be executed on mobile terminals, computer terminals, or similar computing devices. Taking a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device. Figure 1 This is a hardware structure block diagram of a mobile terminal for an image rendering method according to an embodiment of this disclosure. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and memory 104 for storing data. In one embodiment of this disclosure, it may also include: input / output device 108 and display device 110.

[0023] In some optional embodiments primarily focused on gaming scenarios, the aforementioned device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0024] In one embodiment of this disclosure, the image rendering method can run on a local terminal device or a server. When the image rendering method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0025] For example, the local terminal device may be a mobile terminal, a computer terminal, or a similar computing device, and may include a display screen and a processor. The display screen is used to present a graphical user interface, which includes a game scene. The processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.

[0026] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0027] According to one embodiment of this disclosure, an embodiment of an image rendering method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0028] In one possible implementation, this disclosure provides an image rendering method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system. Figure 2 This is a flowchart of an image rendering method according to one embodiment of the present disclosure, such as... Figure 2 As shown, the method includes the following steps:

[0029] Step S202: Divide the graphical user interface into multiple regions.

[0030] The aforementioned graphical user interface can be an interface displayed on a screen of a mobile terminal, computer terminal, or other device. Developers can use this interface to adjust the lighting in the game scene and achieve the purpose of game development.

[0031] In one optional embodiment, the graphical user interface (GUI) can be divided based on its row and column coordinates, specifically into multiple regions of equal size, as described above. For example, it can be...

[0032] Step S204: Determine the number of virtual light sources corresponding to multiple regions, wherein the virtual light source is used to represent the light source located in the virtual scene, and the multiple regions are respectively located within the illumination range of the corresponding virtual light source.

[0033] The aforementioned virtual light sources can be placed in virtual scenes, such as light sources in game scenes. Because the virtual light sources are placed in different positions in game scenes, and the illumination range of different virtual light sources is different, the amount of influence of virtual light sources on different areas varies.

[0034] In one optional embodiment, the area within the illumination range of a virtual light source can be determined based on the placement of the virtual light source in the game scene and the illumination range of the virtual light source. After determining the area within the illumination range of all virtual light sources in the game scene, the virtual light sources corresponding to different areas can be determined by statistically analyzing the above information, thereby determining the number of virtual light sources corresponding to different areas.

[0035] In another alternative embodiment, the illumination received by each of the multiple regions can be calculated to determine which virtual light sources the region falls within the illumination range of. These virtual light sources can then be used as the virtual light sources corresponding to the region. By counting the number of these virtual light sources, the number of virtual light sources corresponding to the region can be obtained.

[0036] Step S206: Render the number of virtual light sources corresponding to multiple regions onto the multiple regions respectively.

[0037] In one alternative embodiment, the number of virtual light sources corresponding to each region in multiple regions can be directly displayed in each of the multiple regions of the graphical user interface. That is, different numbers representing the number of virtual light sources can be directly displayed in different regions of the graphical user interface.

[0038] In another alternative embodiment, to avoid the high overhead of directly displaying numbers on the graphical user interface, images corresponding to the number of virtual light sources can be sampled from a digit texture map, where the digit texture map is a two-dimensional texture map recording images of multiple numbers. Then, image rendering is used to display different numbers in different areas of the graphical user interface.

[0039] In at least some embodiments of this disclosure, the graphical user interface is divided into multiple regions, and the number of virtual light sources corresponding to each region is rendered on the multiple regions respectively. This achieves the purpose of directly displaying the number of virtual light sources on the graphical user interface, allowing developers to intuitively see the number of virtual light sources in different regions on the graphical user interface. Furthermore, based on the intuitively seen number of virtual light sources, it is possible to determine whether there are performance problems in different regions. This achieves the technical effect of improving lighting debugging efficiency, simplifying the complexity of developers' work, and improving game performance, thereby solving the technical problem of low efficiency in lighting debugging of game scenes in related technologies.

[0040] In the above embodiments of this disclosure, the number of virtual light sources corresponding to multiple regions is rendered on multiple regions respectively, including: obtaining coordinate information corresponding to multiple regions; sampling a preset texture map based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions to obtain sampling results corresponding to multiple regions, wherein the preset texture map is used to represent different numbers; and rendering the sampling results corresponding to multiple regions on multiple regions respectively.

[0041] The aforementioned preset texture map can be as follows: Figure 3 The digital texture shown contains numbers 1-64, with 8 numbers per row, for a total of 8 rows.

[0042] In one optional embodiment, the multiple regions are divided according to the row and column values ​​of the graphical user interface. Therefore, the coordinate information corresponding to each region in the multiple regions can be determined first, that is, the row and column values ​​of each region. Then, the sampling result corresponding to each region can be obtained through the following steps: based on the coordinate information of the multiple regions and the number of virtual light sources corresponding to the multiple regions, the sampling texture coordinates corresponding to the multiple regions are determined; based on the sampling texture coordinates corresponding to the multiple regions, a preset texture map is sampled to obtain the sampling result corresponding to the multiple regions.

[0043] For example, as Figure 3 Taking the digital texture map shown as an example, the sampled texture coordinates NUV can be obtained using the following formula:

[0044] NUV=fract(UV*AB) / 8.0+VEC2((C-1)%8,C / 8)*0.125,

[0045] Where AB represents the coordinate information corresponding to each region, that is, the row and column values ​​of each region; C represents the number of virtual light sources corresponding to each region; UV represents the two-dimensional coordinate values ​​of the texture; fract() is a built-in function when the GPU executes the shader, which means taking the decimal part of the calculation result and discarding the integer part; VEC2() is a built-in variable when the GPU executes the shader, representing a structure composed of two float types.

[0046] Through the above embodiments, by sampling the digital texture map, the number of virtual light sources can be rendered without directly rendering the number of virtual light sources onto the graphical user interface, thus reducing the processor's runtime and computational load. Based on the region's coordinate information and the number of virtual light sources, the sampling texture coordinates are determined, achieving accurate sampling of the digital texture map and improving the accuracy of the sampling results rendered on the graphical user interface.

[0047] In the above embodiments of this disclosure, determining the number of virtual light sources corresponding to multiple regions includes: acquiring coordinate information of multiple regions; reading attribute information of virtual light sources corresponding to multiple regions from a preset storage space based on the coordinate information of multiple regions, wherein the preset storage space is used to store attribute information of virtual light sources corresponding to different regions; and determining the number of virtual light sources corresponding to multiple regions based on the attribute information of virtual light sources corresponding to multiple regions.

[0048] The aforementioned preset storage space can be used to store the attribute information of virtual light sources corresponding to different regions. For example, the attribute information of virtual light sources corresponding to different regions can be stored in an array. For instance, the attribute information of virtual light sources can be saved in the array Light(i), where i represents different regions. The attribute information can be the attributes, position, intensity, etc. of the virtual light source, but it is not limited to these and can also be other information.

[0049] In one optional embodiment, during the image rendering process, the array index storing the attribute information of the virtual light source, i.e., the specific value of i, can be calculated by the coordinates of each region. Then, by reading the data of the array corresponding to the array index, the attribute information of the virtual light source can be obtained. Finally, by counting the virtual light sources, the number of virtual light sources can be obtained.

[0050] Through the above embodiments, by pre-storing the attribute information of virtual light sources corresponding to different regions in a preset storage space, the attribute information of virtual light sources can be directly read from this space during the image rendering process, without having to perform calculations on the virtual light sources corresponding to different regions, thus achieving the effect of reducing the amount of computation in the image rendering process.

[0051] In the above embodiments of this disclosure, the method further includes: performing calculations on the illumination received by multiple regions to determine virtual light sources corresponding to the multiple regions; and storing the attribute information of the virtual light sources corresponding to the multiple regions into a preset storage space.

[0052] In one alternative embodiment, before image rendering, the illumination received by each pre-defined region can be calculated in advance. If a region is within the influence range of a certain illumination, the light object (including information such as the light's attributes, position, and intensity) is saved into the aforementioned array Light(i). By traversing all regions, the Light arrays of all regions can be saved in the array A = {Light(1), Light(2), Light(3), Light(i)...}.

[0053] Through the above embodiments, by calculating the illumination received by a region to determine the attribute information of the virtual light source, the effect of accurately determining the number of virtual light sources in different regions is achieved.

[0054] In the above embodiments of this disclosure, rendering the number of virtual light sources corresponding to multiple regions onto multiple regions respectively includes: determining rendering parameters corresponding to multiple regions based on the number of virtual light sources corresponding to multiple regions, wherein the rendering parameters are used to characterize whether there is a performance problem in each of the multiple regions; and rendering the number of virtual light sources corresponding to multiple regions onto multiple regions respectively according to the rendering parameters corresponding to multiple regions.

[0055] The rendering parameters mentioned above can be parameters such as rendering color, rendering size, and rendering style. In this embodiment of the disclosure, rendering color is used as an example for explanation, but it is not limited to this.

[0056] In one optional embodiment, the presence of a performance problem in each region can be determined based on the number of virtual light sources corresponding to each region in multiple regions. If no performance problem exists, the number of virtual light sources corresponding to each region can be rendered in the corresponding region according to preset rendering parameters. These preset rendering parameters can be general, default parameters for rendering images on a graphical user interface. If a performance problem exists, the number of virtual light sources corresponding to each region can be rendered in the corresponding region according to a highlighting method, so that developers can locate the region with the performance problem immediately.

[0057] For example, as Figure 4 The image rendering result shown is used as an example for illustration, such as... Figure 4 As shown, the graphical user interface can first be divided into 32 equally sized regions. After determining the number of virtual lights corresponding to each region, the number of virtual lights for each region can be rendered in the corresponding region. Secondly, based on the number of virtual lights for each region, it can be determined whether there are performance issues for that region. If there are no performance issues, the number of virtual lights for each region is rendered using the default color (e.g., black). Figure 4 As shown in the hollow cube; if performance issues arise, the number of virtual light sources corresponding to each area will be rendered according to the highlight color (e.g., red), such as... Figure 4 As shown in the solid square.

[0058] In the above embodiments of this disclosure, after rendering the number of virtual light sources corresponding to multiple regions onto multiple regions, the method further includes: responding to an operation command acting on a graphical user interface to determine the target region corresponding to the operation command; reading the attribute information of the virtual light source corresponding to the target region from a preset storage space based on the target coordinate information of the target region; and displaying the attribute information of the virtual light source corresponding to the target region on the graphical user interface.

[0059] The target area mentioned above can be any area in the multiple regions where performance issues exist. The operation instructions mentioned above can be generated by the developer clicking on the target area in the graphical user interface, or by the developer clicking on the corresponding control in the target area in the graphical user interface, but are not limited to these; they can also be generated by other operation methods.

[0060] In one alternative embodiment, to avoid the development and debugging difficulties caused by developers repeatedly trying to traverse all the lights, developers can determine whether there are performance issues in each area based on the color of the numbers rendered on the graphical user interface. If a developer finds a performance issue in a target area, the developer can click on the target area. At this time, the attribute information of the virtual light source corresponding to the target area can be read from the array A = {Light(1), Light(2), Light(3), Light(i)...} and displayed on the graphical user interface in a pop-up window. This allows developers to quickly set up and debug the virtual light source, avoiding the development and debugging difficulties caused by repeatedly trying to traverse all the virtual light sources.

[0061] For example, still using Figure 4 The image rendering result shown is used as an example for illustration, such as... Figure 4 As shown, after the developer clicks on the area in the upper right corner, the area in the upper right corner can be identified as the target area, and the attribute information of the virtual light source corresponding to the area can be read from the array A = {Light(1),Light(2),Light(3),Light(i)......}. For example, the attribute information of 5 virtual light sources can be read, namely Spot Light(2), Spot Light(1), Point Light(1), Spot Light(11) and Spot Light.

[0062] The following is combined Figure 5 A preferred embodiment of this disclosure will be described in detail below. Figure 5 The method may include the following steps:

[0063] Step S51: Divide the screen into regions of the same size composed of rows and columns;

[0064] Step S52: Calculate the amount of light and light objects received by each area, and form an array.

[0065] Optionally, the illumination received by each region can be calculated. If the region is within the influence range of a certain illumination, the light object (including the light's attributes, position, intensity, etc.) is saved into an array Light(i) (where i is the region number). All regions are traversed, and all the obtained Light arrays are saved in array A = {Light(1), Light(2), Light(3), Light(i)...}.

[0066] Step S53: Obtain the coordinates of a certain area on the current screen, and obtain the number of lights based on the array.

[0067] Optionally, during rendering, the index of array A can be calculated using screen coordinates, and the number of lights can be obtained.

[0068] Step S54: Calculate the sampled texture coordinates of the digital texture map using screen coordinates.

[0069] Alternatively, the NUV of digital image sampling can be calculated using the screen coordinates and number of lights in the area, according to the formula described above.

[0070] Step S55: Render the number of lights in the corresponding area of ​​the screen.

[0071] Optionally, after sampling the digital texture map according to the sampling texture coordinates, the sampled result can be rendered onto the screen, which can display in real time the amount of light influence on each area of ​​the current screen within its spatial range.

[0072] Step S56: Obtain the index of the light array corresponding to the area clicked by the mouse.

[0073] Step S57: Display a list of lights affected by the area on the screen (composed of objects containing basic attributes of the light tubes, such as position, intensity, and type).

[0074] Optionally, when the mouse clicks on the screen, the current screen space position of the mouse is obtained, and the corresponding light information is obtained according to array A. Then, the above-mentioned light list is generated and displayed on the screen.

[0075] The solutions provided by the above embodiments of this disclosure offer a digital display method to intuitively represent the number of lights and the list of lights illuminating different areas of the current screen. This allows developers to intuitively and accurately obtain the number of lights and the list of lights in a certain area on the screen, and to quickly locate lights with performance problems and adjust their parameters. This improves the speed of performance optimization for developers in large-area, high-quantity lighting game scenes, and is an effective tool to assist developers in completing lighting debugging.

[0076] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.

[0077] This embodiment also provides an image rendering apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0078] Figure 6 This is a structural block diagram of an image rendering apparatus according to one embodiment of the present disclosure, such as... Figure 6 As shown, the device includes:

[0079] The partitioning module 62 is used to divide the graphical user interface into multiple regions;

[0080] The determination module 64 is used to determine the number of virtual light sources corresponding to multiple regions, wherein the virtual light source is used to represent the light source located in the virtual scene, and the multiple regions are respectively located within the illumination range of the corresponding virtual light source;

[0081] Rendering module 66 is used to render the number of virtual light sources corresponding to multiple regions onto multiple regions respectively.

[0082] In the above embodiments of this disclosure, the rendering module 66 includes: a first acquisition unit, used to acquire coordinate information corresponding to multiple regions; a sampling unit, used to sample a preset texture map based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions, to obtain sampling results corresponding to multiple regions, wherein the preset texture map is used to represent different numbers; and a first rendering unit, used to render the sampling results corresponding to multiple regions onto multiple regions respectively.

[0083] In the above embodiments of this disclosure, the sampling unit includes: a determining subunit, used to determine the sampling texture coordinates corresponding to multiple regions based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions; and a sampling subunit, used to sample a preset texture map based on the sampling texture coordinates corresponding to multiple regions to obtain sampling results corresponding to multiple regions.

[0084] In the above embodiments of this disclosure, the determining module 64 includes: a second acquisition unit, used to acquire coordinate information of multiple regions; a reading unit, used to read attribute information of virtual light sources corresponding to multiple regions from a preset storage space based on the coordinate information of multiple regions, wherein the preset storage space is used to store attribute information of virtual light sources corresponding to different regions; and a first determining unit, used to determine the number of virtual light sources corresponding to multiple regions based on the attribute information of virtual light sources corresponding to multiple regions.

[0085] In the above embodiments of this disclosure, the device further includes: a calculation module, used to perform calculations on the illumination received by multiple regions to determine the virtual light sources corresponding to the multiple regions; and a storage module, used to store the attribute information of the virtual light sources corresponding to the multiple regions into a preset storage space.

[0086] In the above embodiments of this disclosure, the rendering module 66 includes: a second determining unit, configured to determine rendering parameters corresponding to multiple regions based on the number of virtual light sources corresponding to multiple regions, wherein the rendering parameters are used to characterize whether there is a performance problem in each of the multiple regions; and a second rendering unit, configured to render the number of virtual light sources corresponding to the multiple regions onto the multiple regions respectively according to the rendering parameters corresponding to the multiple regions.

[0087] In the above embodiments of this disclosure, the device further includes: a region determination module, used to determine the target region corresponding to the operation command in response to the operation command applied to the graphical user interface; a reading module, used to read the attribute information of the virtual light source corresponding to the target region from a preset storage space based on the target coordinate information of the target region; and a display module, used to display the attribute information of the virtual light source corresponding to the target region on the graphical user interface.

[0088] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0089] Embodiments of this disclosure also provide a computer-readable storage medium storing a computer program configured to perform the steps in any of the above method embodiments when executed.

[0090] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0091] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0092] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0093] The graphical user interface is divided into multiple regions.

[0094] The number of virtual light sources corresponding to multiple regions is determined, where virtual light sources are used to represent light sources located in the virtual scene, and multiple regions are located within the illumination range of their respective virtual light sources.

[0095] The number of virtual light sources corresponding to multiple regions is rendered on multiple regions respectively.

[0096] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining coordinate information corresponding to multiple regions; sampling a preset texture map based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions to obtain sampling results corresponding to multiple regions, wherein the preset texture map is used to represent different numbers; and rendering the sampling results corresponding to multiple regions onto multiple regions respectively.

[0097] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the sampling texture coordinates corresponding to multiple regions based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions; sampling a preset texture map based on the sampling texture coordinates corresponding to multiple regions to obtain sampling results corresponding to multiple regions.

[0098] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining coordinate information of multiple regions; reading attribute information of virtual light sources corresponding to multiple regions from a preset storage space based on the coordinate information of multiple regions, wherein the preset storage space is used to store attribute information of virtual light sources corresponding to different regions; and determining the number of virtual light sources corresponding to multiple regions based on the attribute information of virtual light sources corresponding to multiple regions.

[0099] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: performing calculations on the illumination received by multiple regions to determine the virtual light sources corresponding to the multiple regions; and storing the attribute information of the virtual light sources corresponding to the multiple regions into a preset storage space.

[0100] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining rendering parameters corresponding to multiple regions based on the number of virtual light sources corresponding to multiple regions, wherein the rendering parameters are used to characterize whether there is a performance problem in each of the multiple regions; and rendering the number of virtual light sources corresponding to the multiple regions onto the multiple regions respectively according to the rendering parameters corresponding to the multiple regions.

[0101] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: after rendering the number of virtual light sources corresponding to multiple regions onto multiple regions, in response to an operation instruction acting on a graphical user interface, determining the target region corresponding to the operation instruction; based on the target coordinate information of the target region, reading the attribute information of the virtual light source corresponding to the target region from a preset storage space; and displaying the attribute information of the virtual light source corresponding to the target region on the graphical user interface.

[0102] This embodiment of the computer-readable storage medium provides a technical solution. By adopting and implementing this solution, the desired objective is achieved, thereby realizing the technical effect and solving the technical problem of low efficiency in adjusting lighting in game scenes in related technologies.

[0103] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0104] In exemplary embodiments of this disclosure, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this disclosure may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps according to various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.

[0105] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present disclosure is not limited thereto. In the embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0106] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0107] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0108] Embodiments of this disclosure also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0109] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0110] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0111] The graphical user interface is divided into multiple regions.

[0112] The number of virtual light sources corresponding to multiple regions is determined, where virtual light sources are used to represent light sources located in the virtual scene, and multiple regions are located within the illumination range of their respective virtual light sources.

[0113] The number of virtual light sources corresponding to multiple regions is rendered on multiple regions respectively.

[0114] Optionally, the processor may also be configured to perform the following steps via a computer program: obtain coordinate information corresponding to multiple regions; sample a preset texture map based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions to obtain sampling results corresponding to multiple regions, wherein the preset texture map is used to represent different numbers; and render the sampling results corresponding to multiple regions onto multiple regions respectively.

[0115] Optionally, the processor may also be configured to perform the following steps via a computer program: determining the sampling texture coordinates of multiple regions based on the coordinate information of multiple regions and the number of virtual light sources corresponding to multiple regions; sampling a preset texture map based on the sampling texture coordinates of multiple regions to obtain the sampling results corresponding to multiple regions.

[0116] Optionally, the processor may also be configured to perform the following steps via a computer program: acquiring coordinate information of multiple regions; reading attribute information of virtual light sources corresponding to multiple regions from a preset storage space based on the coordinate information of multiple regions, wherein the preset storage space is used to store attribute information of virtual light sources corresponding to different regions; and determining the number of virtual light sources corresponding to multiple regions based on the attribute information of virtual light sources corresponding to multiple regions.

[0117] Optionally, the processor may also be configured to perform the following steps via a computer program: calculate the illumination received by multiple regions to determine the virtual light sources corresponding to the multiple regions; and store the attribute information of the virtual light sources corresponding to the multiple regions into a preset storage space.

[0118] Optionally, the processor may also be configured to perform the following steps via a computer program: determining rendering parameters for multiple regions based on the number of virtual light sources corresponding to multiple regions, wherein the rendering parameters are used to characterize whether there are performance problems in each of the multiple regions; and rendering the number of virtual light sources corresponding to the multiple regions onto the multiple regions according to the rendering parameters corresponding to the multiple regions.

[0119] Optionally, the processor may also be configured to perform the following steps via a computer program: after rendering the number of virtual light sources corresponding to multiple regions onto multiple regions, responding to operation instructions applied to the graphical user interface, determining the target region corresponding to the operation instructions; based on the target coordinate information of the target region, reading the attribute information of the virtual light source corresponding to the target region from a preset storage space; and displaying the attribute information of the virtual light source corresponding to the target region on the graphical user interface.

[0120] In the electronic device of this embodiment, a technical solution is provided. By adopting and implementing this solution, the desired objective is achieved, thereby realizing the technical effect and solving the technical problem of low efficiency in adjusting lighting in game scenes in related technologies.

[0121] Figure 7 This is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 7 As shown, the electronic device 700 is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0122] like Figure 7As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processor 710, at least one memory 720, a bus 730 connecting different system components (including memory 720 and processor 710), and a display 740.

[0123] The memory 720 stores program code that can be executed by the processor 710, causing the processor 710 to perform the steps described in the method section of the embodiments of this disclosure according to various exemplary implementations of this disclosure.

[0124] The memory 720 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include read-only memory (ROM) 7203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0125] In some instances, memory 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 720 may further include memory remotely located relative to processor 710, which can be connected to electronic device 700 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0126] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 710, or a local bus using any of the various bus structures.

[0127] The display 740 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 700.

[0128] Optionally, the electronic device 700 can also communicate with one or more external devices 800 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and / or any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 750. Furthermore, the electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 760. Figure 7 As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although... Figure 7 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0129] The aforementioned electronic device 700 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0130] Those skilled in the art will understand that Figure 7 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 700 may also include components that are more... Figure 7 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 720 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the image rendering method in this embodiment. The processor 710 executes various functional applications and data processing by running the computer program stored in the memory 720, thereby implementing the aforementioned image rendering method.

[0131] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0132] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0133] 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0134] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.

[0135] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a 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 all or part 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 a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0136] The above description is only a preferred embodiment of this disclosure. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of this disclosure, and these improvements and modifications should also be considered within the scope of protection of this disclosure.

Claims

1. An image rendering method, characterized in that, include: The graphical user interface is divided into multiple regions; The number of virtual light sources corresponding to the plurality of regions is determined, wherein the virtual light source is used to represent the light source located in the virtual scene, and the plurality of regions are respectively located within the illumination range of the corresponding virtual light source; Obtain the coordinate information corresponding to the multiple regions; Based on the coordinate information of the multiple regions and the number of virtual light sources corresponding to the multiple regions, the sampling texture coordinates corresponding to the multiple regions are determined; Based on the sampling texture coordinates corresponding to the multiple regions, a preset texture map is sampled to obtain the sampling results corresponding to the multiple regions, wherein the preset texture map is used to represent different numbers; The sampling results corresponding to the multiple regions are rendered onto the multiple regions respectively.

2. The image rendering method according to claim 1, characterized in that, Determining the number of virtual light sources corresponding to the multiple regions includes: Obtain the coordinate information of the multiple regions; Based on the coordinate information of the multiple regions, the attribute information of the virtual light sources corresponding to the multiple regions is read from the preset storage space, wherein the preset storage space is used to store the attribute information of the virtual light sources corresponding to different regions; Based on the attribute information of the virtual light sources corresponding to the multiple regions, the number of virtual light sources corresponding to the multiple regions is determined.

3. The image rendering method according to claim 2, characterized in that, The image rendering method further includes: Calculate the illumination received by the multiple regions to determine the virtual light sources corresponding to the multiple regions; The attribute information of the virtual light sources corresponding to the multiple regions is stored in the preset storage space.

4. The image rendering method according to claim 1, characterized in that, The number of virtual light sources corresponding to the multiple regions are rendered on the multiple regions respectively, including: Based on the number of virtual light sources corresponding to the multiple regions, the rendering parameters corresponding to the multiple regions are determined, wherein the rendering parameters are used to characterize whether there are performance problems in each of the multiple regions; According to the rendering parameters corresponding to the multiple regions, the number of virtual light sources corresponding to the multiple regions are rendered on the multiple regions respectively.

5. The image rendering method according to claim 1, characterized in that, After rendering the number of virtual light sources corresponding to the multiple regions onto the multiple regions, the image rendering method further includes: In response to an operation command applied to the graphical user interface, determine the target area corresponding to the operation command; Based on the target coordinate information of the target area, the attribute information of the virtual light source corresponding to the target area is read from the preset storage space; The attribute information of the virtual light source corresponding to the target area is displayed on the graphical user interface.

6. An image rendering apparatus, characterized in that, The image rendering method applied to any one of claims 1-5 includes: The partitioning module is used to divide the graphical user interface into multiple regions; A determining module is used to determine the number of virtual light sources corresponding to the plurality of regions, wherein the virtual light source is used to represent a light source located in a virtual scene, and the plurality of regions are respectively located within the illumination range of the corresponding virtual light source; The rendering module is used to render the number of virtual light sources corresponding to the multiple regions onto the multiple regions respectively.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the image rendering method according to any one of claims 1 to 5 when run by a processor.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the image rendering method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Moving image distribution server, moving image reproduction apparatus, control method, program and recording medium

    CN103329526A

  • Virtual light source processing method and device, medium and electronic equipment

    CN111260766A