Game scene rendering method and system

By detecting the mapping relationship between game characters and light sources in real time, and calculating the projected area to render the shadow of game characters, the problem of insufficient shadow rendering in game scene rendering is solved, and the authenticity and user experience of game characters are improved.

CN120502097AActive Publication Date: 2025-08-19JIANGXI YUNYOU NETWORK TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510736888.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-08-19
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

In the prior art, the game scene rendering method fails to render the shadow of game characters in real time and dynamically, resulting in the reduced realism of the rendered game characters and poor user experience.

Method used

By real-time detection of the target game character controlled by the game user and the target simulation light source in the game scene, calculate its mapping relationship, and calculate the shadow size of the game character based on the projected area, so as to achieve real-time and dynamic rendering of the game character.

Benefits of technology

It enhances the authenticity and user experience of the game characters, and enhances the immersion and realism of the game by rendering the shadow of the game characters in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120502097A_ABST
    Figure CN120502097A_ABST
Patent Text Reader

Abstract

The invention provides a game scene rendering method and system.The method comprises the steps that when it is detected that a game is started in real time, a target game role controlled by a game user in real time is detected in real time, and a game scene corresponding to the target game role is detected in real time; a target simulation light source correspondingly existing in the game scene is detected in real time, and the mapping relation between the target simulation light source and the target game role is detected in real time based on a preset rule; according to the mapping relation, the projection area correspondingly generated by the target simulation light source on the target game role is calculated in real time, the size corresponding to a target shadow of the target game role is correspondingly calculated according to the projection area, and rendering of the shadow of the target game role is correspondingly completed. According to the method, the shadow of the game role of the user can be dynamically simulated in real time, and the use experience of the user is correspondingly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of scene rendering technology, and in particular to a game scene rendering method and system. Background Art

[0002] With the advancement of science and technology and the rapid development of productivity, the Internet and computer technology have become popular in people's daily lives, and can enable people to play games, shop, learn and other activities on the Internet, greatly facilitating people's lives.

[0003] Among them, people have developed various types of games through computer technology. Specifically, some games will render corresponding scenes inside the game in order to simulate the real environment, so that users can have an immersive feeling and attract more game users.

[0004] Furthermore, in the process of rendering game scenes, most of the existing technologies directly render various types of game characters. In this process, the rendering of the shadow part of the game character is often ignored, that is, the shadow of the game character is not simulated in real time and dynamically, which correspondingly reduces the realism of the rendered game character and reduces the user experience. Summary of the Invention

[0005] Based on this, the purpose of the present invention is to provide a game scene rendering method and system to solve the problem that the existing technology cannot render the shadow of the game character in real time and dynamically, which correspondingly reduces the realism of the rendered game character.

[0006] The first aspect of the embodiment of the present invention proposes: A method for rendering a game scene, wherein the method comprises: When the game is started, the target game character controlled by the game user is detected in real time, and the game scene corresponding to the target game character is detected in real time; Detecting the corresponding target simulated light source in the game scene in real time, and detecting the mapping relationship between the target simulated light source and the target game character in real time based on preset rules; The projection area of the target simulated light source on the target game character is calculated in real time according to the mapping relationship, and the size of the target shadow of the target game character is calculated according to the projection area to complete the rendering of the shadow of the target game character.

[0007] The beneficial effect of the present invention is that by determining the target game character controlled by the game user in real time, the corresponding processing object can be clearly identified. Based on this, in order to perform real-time rendering, it is also necessary to determine in real time the game scene corresponding to the current target game character. Based on this, it is only necessary to determine in real time the target simulated light source in the current scene, and the mapping relationship between the current game character and the current simulated light source can be immediately determined, and the projection area of the current target game character can finally be calculated in real time according to the mapping relationship. At the same time, a shadow adapted to the current target game character can be projected synchronously, so that the shadow of each game character can be rendered in real time and dynamically, which correspondingly improves the realism of the game character and improves the user experience.

[0008] Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on preset rules includes: When the target simulated light source is detected in real time, a relative straight line between the target simulated light source and the target game character is detected in real time; Detecting a target straight line between the target simulated light source and the ground in real time, and determining in real time whether the relative straight line coincides with the target straight line; If it is determined in real time that the relative straight line coincides with the target straight line, then it is correspondingly determined that the target simulated light source is located directly above the target game character, and the target simulated light source will change dynamically.

[0009] Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on a preset rule further includes: If it is determined in real time that the relative straight line does not coincide with the target straight line, then it is correspondingly determined that the target simulated light source is tilted relative to the target game character; The altitude angle of the target simulated light source relative to the ground is calculated in real time according to the relative straight line and the target straight line, and the mapping relationship between the target simulated light source and the target game character is detected in real time according to the altitude angle.

[0010] Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time according to the altitude angle includes: When the altitude angle is acquired in real time, a first identifier is added to the target simulated light source and a second identifier is added to the target game character; A corresponding mapping data chain is created in real time according to the first identifier, the second identifier and the altitude angle, and the mapping data chain is set to correspond to the mapping relationship.

[0011] Furthermore, the step of calculating the size of the target shadow of the target game character according to the projection area to render the shadow of the target game character includes: When the projection area is determined in real time, the height and width corresponding to the target game character are detected in real time; A target projection coefficient adapted to the target game character is determined in real time according to the projection area, and rendering of the shadow of the target game character is completed according to the target projection coefficient, the height, and the width.

[0012] Furthermore, the step of rendering the shadow of the target game character according to the target projection coefficient, the height, and the width includes: When the target projection coefficient is obtained in real time, a target outline adapted to the target game character is drawn in real time according to the height and the width; The target outline is adaptively stretched or shortened according to the target projection coefficient to render the shadow of the target game character in real time.

[0013] Furthermore, the expression of the algorithm for adaptively stretching or shortening the target contour according to the target projection coefficient is:

[0014] Wherein, S represents the shadow of the target game character, D represents the size of the target outline, K represents the target projection coefficient, θ represents the inclination angle of the projection surface, A represents the atmospheric attenuation factor, T represents the object transparency factor, and C represents the calibration constant.

[0015] The second aspect of the embodiment of the present invention proposes: A game scene rendering system, wherein the system comprises: A detection module is used to detect in real time when the game is started, detect in real time the target game character controlled by the game user, and detect in real time the game scene corresponding to the target game character; A processing module is used to detect the corresponding target simulated light source in the game scene in real time, and detect the mapping relationship between the target simulated light source and the target game character in real time based on preset rules; The calculation module is used to calculate the corresponding projection area generated by the target simulated light source on the target game character in real time according to the mapping relationship, and calculate the corresponding size of the target shadow of the target game character according to the projection area, so as to complete the rendering of the shadow of the target game character.

[0016] Furthermore, the processing module is specifically configured to: When the target simulated light source is detected in real time, a relative straight line between the target simulated light source and the target game character is detected in real time; Detecting a target straight line between the target simulated light source and the ground in real time, and determining in real time whether the relative straight line coincides with the target straight line; If it is determined in real time that the relative straight line coincides with the target straight line, then it is correspondingly determined that the target simulated light source is located directly above the target game character, and the target simulated light source will change dynamically.

[0017] Furthermore, the processing module is specifically configured to: If it is determined in real time that the relative straight line does not coincide with the target straight line, then it is correspondingly determined that the target simulated light source is tilted relative to the target game character; The altitude angle of the target simulated light source relative to the ground is calculated in real time according to the relative straight line and the target straight line, and the mapping relationship between the target simulated light source and the target game character is detected in real time according to the altitude angle.

[0018] Furthermore, the processing module is specifically configured to: When the altitude angle is acquired in real time, a first identifier is added to the target simulated light source and a second identifier is added to the target game character; A corresponding mapping data chain is created in real time according to the first identifier, the second identifier and the altitude angle, and the mapping data chain is set to correspond to the mapping relationship.

[0019] Furthermore, the calculation module is specifically used to: When the projection area is determined in real time, the height and width corresponding to the target game character are detected in real time; A target projection coefficient adapted to the target game character is determined in real time according to the projection area, and rendering of the shadow of the target game character is completed according to the target projection coefficient, the height, and the width.

[0020] Furthermore, the calculation module is specifically used to: When the target projection coefficient is obtained in real time, a target outline adapted to the target game character is drawn in real time according to the height and the width; The target outline is adaptively stretched or shortened according to the target projection coefficient to render the shadow of the target game character in real time.

[0021] Furthermore, the expression of the algorithm for adaptively stretching or shortening the target contour according to the target projection coefficient is:

[0022] Wherein, S represents the shadow of the target game character, D represents the size of the target outline, K represents the target projection coefficient, θ represents the inclination angle of the projection surface, A represents the atmospheric attenuation factor, T represents the object transparency factor, and C represents the calibration constant.

[0023] The third aspect of the embodiment of the present invention proposes: A computer comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the game scene rendering method described above when executing the computer program.

[0024] The fourth aspect of the embodiments of the present invention proposes: A readable storage medium stores a computer program thereon, wherein the program, when executed by a processor, implements the game scene rendering method as described above.

[0025] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flowchart of a game scene rendering method provided by the first embodiment of the present invention; Figure 2 This is a structural block diagram of a game scene rendering system provided by the third embodiment of the present invention.

[0027] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0028] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0029] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0031] See also Figure 1 , shown is the game scene rendering method provided by the first embodiment of the present invention. The game scene rendering method provided by this embodiment can render the shadow of the game character in real time and dynamically, thereby improving the realism of the game character and improving the user experience.

[0032] Specifically, this embodiment provides: A method for rendering a game scene, wherein the method comprises: Step S10, when the game is detected to be started in real time, detecting in real time the target game character controlled by the game user in real time, and detecting in real time the game scene corresponding to the target game character; Among them, it should be noted that existing simulation games will render corresponding game scenes inside the game, specifically, elements such as houses, trees and the sun. Correspondingly, in order to enable users to have a corresponding game experience, the corresponding game characters will be simulated in real time, and the corresponding fun will be obtained by manipulating the game characters in real time. In this process, in order to improve the realism of the game characters, it is necessary to render the corresponding shadows generated by the current game characters in the current game scene, that is, the shadows generated by the current game characters in real time. Based on this, in order to achieve this function, the server set in the background will perform real-time detection after detecting that the user starts the game in real time, and will detect the target game character controlled by the current game user in real time in real time. Correspondingly, in order to facilitate subsequent rendering, it is also necessary to synchronously detect the game scene in which the current game character exists in real time, and dynamically render the shadow of the current game character according to the changes in the current game scene in real time, so as to facilitate subsequent processing.

[0033] Step S20: detecting the corresponding target simulated light source in the game scene in real time, and detecting the mapping relationship between the target simulated light source and the target game character in real time based on a preset rule; Among them, it should be noted that after the corresponding game scene is detected in real time through the above steps, in order to facilitate subsequent rendering, it is also necessary to detect in real time the target simulated light source corresponding to the interior of the current game scene. At the same time, the server set up in the background can immediately detect the real-time mapping relationship between the current target simulated light source and the current target game character according to pre-set rules, that is, the real-time connection between the current target simulated light source and the current target game character is detected in real time to facilitate subsequent processing.

[0034] Step S30, calculating in real time the projection area of the target simulated light source on the target game character according to the mapping relationship, and calculating the size of the target shadow of the target game character according to the projection area, so as to complete the rendering of the shadow of the target game character.

[0035] Among them, it should be noted that after the required mapping relationship is obtained in real time through the above steps, the projection area of the current target simulated light source generated in real time on the current target game character can be directly calculated according to the mapping relationship. Among them, it can be understood that when light is irradiated on an object, the larger the area of the object that blocks the light, the larger the corresponding shadow will be, and vice versa. Based on this, after the required projection area is calculated in real time, the size of the target shadow generated corresponding to the current target game character will be calculated in real time, and the rendering of the shadow of the current target game character can be finally completed in real time according to the size, so that the shadow corresponding to the current target game character can be simulated in real time and dynamically, thereby effectively improving the realism of the current target game character, and correspondingly improving the current user's experience.

[0036] Second embodiment Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on preset rules includes: When the target simulated light source is detected in real time, a relative straight line between the target simulated light source and the target game character is detected in real time; Detecting a target straight line between the target simulated light source and the ground in real time, and determining in real time whether the relative straight line coincides with the target straight line; If it is determined in real time that the relative straight line coincides with the target straight line, then it is correspondingly determined that the target simulated light source is located directly above the target game character, and the target simulated light source will change dynamically.

[0037] Among them, it should be noted that after the target simulated light source and the target game character appearing in the same game scene are respectively detected through the above steps, in order to be able to objectively and accurately detect the real-time connection between the current target simulated light source and the current target game character, specifically, the present invention will first detect the relative straight line between the current target simulated light source and the current target game character, and correspondingly, it will also detect the target straight line between the current target simulated light source and the ground in real time. Based on this, the present invention will judge in real time whether the current relative straight line and the current target straight line overlap. Specifically, if so, it can directly indicate that the current target simulated light source exists directly above the current target game character, and there is no need for subsequent shadow rendering. Correspondingly, rendering is required for subsequent processing.

[0038] Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on a preset rule further includes: If it is determined in real time that the relative straight line does not coincide with the target straight line, then it is correspondingly determined that the target simulated light source is tilted relative to the target game character; The altitude angle of the target simulated light source relative to the ground is calculated in real time according to the relative straight line and the target straight line, and the mapping relationship between the target simulated light source and the target game character is detected in real time according to the altitude angle.

[0039] Among them, it should be noted that if it is judged in real time that the above-mentioned relative straight line and the above-mentioned target straight line do not coincide with each other, it can be directly determined that there is a certain angle between the current target simulated light source and the current target game character, that is, the current target simulated light source is inclined relative to the current target game character. Based on this, since a corresponding angle will be generated between the two current straight lines in real time, the present invention can calculate the altitude angle generated by the current target simulated light source relative to the ground in real time based on the current relative straight line and the current target straight line, and use the current altitude angle as the judgment basis to create a mapping relationship between the current target simulated light source and the current target game character in real time to facilitate subsequent processing.

[0040] Furthermore, the step of detecting the mapping relationship between the target simulated light source and the target game character in real time according to the altitude angle includes: When the altitude angle is acquired in real time, a first identifier is added to the target simulated light source and a second identifier is added to the target game character; A corresponding mapping data chain is created in real time according to the first identifier, the second identifier and the altitude angle, and the mapping data chain is set to correspond to the mapping relationship.

[0041] Among them, it should be noted that after the altitude angle of the target simulated light source is determined in real time through the above steps, in order to facilitate subsequent tracking and judgment, a first identifier will be immediately added to the current target simulated light source, and correspondingly, a second identifier will be immediately added to the current target game character. Based on this, the corresponding mapping data chain can be created in real time according to the current first identifier, the second identifier and the current altitude angle, and the current mapping data chain can be set to the required mapping relationship, so that the current target game character and the current target simulated light source can be tracked in real time according to the mapping relationship, and real-time rendering can be performed. In this process, corresponding changes can be made according to the changing states of the two to enhance the realism of the game character for subsequent processing.

[0042] Furthermore, the step of calculating the size of the target shadow of the target game character according to the projection area to render the shadow of the target game character includes: When the projection area is determined in real time, the height and width corresponding to the target game character are detected in real time; A target projection coefficient adapted to the target game character is determined in real time according to the projection area, and rendering of the shadow of the target game character is completed according to the target projection coefficient, the height, and the width.

[0043] Among them, it should be noted that after the altitude angle of the current target simulated light source is determined in real time through the above steps, the projection area corresponding to the current target simulated light source on the current target game character can be synchronously detected at this time. At the same time, in order to facilitate subsequent processing, the height and width of the current target game character also need to be synchronously detected at this time. Among them, it should be pointed out that the size of the projection area corresponding to the current target simulated light source can affect the size of the shadow rendered subsequently. Based on this, in order to facilitate subsequent rendering, the present invention will determine the target projection coefficient adapted to the current target game character in real time based on the current projection area. Among them, it should be pointed out that the size of the target projection coefficient is between 0-2. Specifically, when the target projection coefficient is greater than 0 and less than 1, the corresponding compression processing will be performed. Correspondingly, when the target projection coefficient is greater than 1 and less than 2, the corresponding stretching processing will be performed. Based on this, the subsequent rendering can be effectively completed to facilitate subsequent processing.

[0044] Furthermore, the step of rendering the shadow of the target game character according to the target projection coefficient, the height, and the width includes: When the target projection coefficient is obtained in real time, a target outline adapted to the target game character is drawn in real time according to the height and the width; The target outline is adaptively stretched or shortened according to the target projection coefficient to render the shadow of the target game character in real time.

[0045] Among them, it should be noted that after the required target projection coefficient is finally obtained through the above steps, in order to complete the subsequent rendering, the outline of the current target game character will be immediately drawn within the above height and width range, that is, the target outline of the current target game character will be depicted in real time. Based on this, the current target outline will be adaptively stretched or shortened according to the above target projection coefficient, so that the shadow of the current target game character can be rendered in real time and dynamically, and will change with the change of light source, thereby improving the realism of the game character and improving the user experience.

[0046] Furthermore, the expression of the algorithm for adaptively stretching or shortening the target contour according to the target projection coefficient is:

[0047] Wherein, S represents the shadow of the target game character, D represents the size of the target outline, K represents the target projection coefficient, θ represents the inclination angle of the projection surface, A represents the atmospheric attenuation factor, T represents the object transparency factor, and C represents the calibration constant.

[0048] See also Figure 2 , the third embodiment of the present invention provides: A game scene rendering system, wherein the system comprises: A detection module is used to detect in real time when the game is started, detect in real time the target game character controlled by the game user, and detect in real time the game scene corresponding to the target game character; A processing module is used to detect the corresponding target simulated light source in the game scene in real time, and detect the mapping relationship between the target simulated light source and the target game character in real time based on preset rules; The calculation module is used to calculate the corresponding projection area generated by the target simulated light source on the target game character in real time according to the mapping relationship, and calculate the corresponding size of the target shadow of the target game character according to the projection area, so as to complete the rendering of the shadow of the target game character.

[0049] Furthermore, the processing module is specifically configured to: When the target simulated light source is detected in real time, a relative straight line between the target simulated light source and the target game character is detected in real time; Detecting a target straight line between the target simulated light source and the ground in real time, and determining in real time whether the relative straight line coincides with the target straight line; If it is determined in real time that the relative straight line coincides with the target straight line, then it is correspondingly determined that the target simulated light source is located directly above the target game character, and the target simulated light source will change dynamically.

[0050] Furthermore, the processing module is specifically configured to: If it is determined in real time that the relative straight line does not coincide with the target straight line, then it is correspondingly determined that the target simulated light source is tilted relative to the target game character; The altitude angle of the target simulated light source relative to the ground is calculated in real time according to the relative straight line and the target straight line, and the mapping relationship between the target simulated light source and the target game character is detected in real time according to the altitude angle.

[0051] Furthermore, the processing module is specifically configured to: When the altitude angle is acquired in real time, a first identifier is added to the target simulated light source and a second identifier is added to the target game character; A corresponding mapping data chain is created in real time according to the first identifier, the second identifier and the altitude angle, and the mapping data chain is set to correspond to the mapping relationship.

[0052] Furthermore, the calculation module is specifically used to: When the projection area is determined in real time, the height and width corresponding to the target game character are detected in real time; A target projection coefficient adapted to the target game character is determined in real time according to the projection area, and rendering of the shadow of the target game character is completed according to the target projection coefficient, the height, and the width.

[0053] Furthermore, the calculation module is specifically used to: When the target projection coefficient is obtained in real time, a target outline adapted to the target game character is drawn in real time according to the height and the width; The target outline is adaptively stretched or shortened according to the target projection coefficient to render the shadow of the target game character in real time.

[0054] Furthermore, the expression of the algorithm for adaptively stretching or shortening the target contour according to the target projection coefficient is:

[0055] Wherein, S represents the shadow of the target game character, D represents the size of the target outline, K represents the target projection coefficient, θ represents the inclination angle of the projection surface, A represents the atmospheric attenuation factor, T represents the object transparency factor, and C represents the calibration constant.

[0056] A fourth embodiment of the present invention provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the game scene rendering method described above when executing the computer program.

[0057] A fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the game scene rendering method as described above.

[0058] In summary, the game scene rendering method and system provided by the above embodiments of the present invention can simulate the shadow of the game character in real time and dynamically, thereby improving the realism of the game character and enhancing the user experience.

[0059] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0060] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0061] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting, or processing it in another suitable manner as necessary, and then storing it in a computer memory.

[0062] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof may be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.

[0063] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0064] The above-described embodiments merely illustrate several embodiments of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A game scene rendering method, characterized in that: The method comprises: When the game is started, the target game character controlled by the game user is detected in real time, and the game scene corresponding to the target game character is detected in real time; Detecting the corresponding target simulated light source in the game scene in real time, and detecting the mapping relationship between the target simulated light source and the target game character in real time based on preset rules; The projection area of the target simulated light source on the target game character is calculated in real time according to the mapping relationship, and the size of the target shadow of the target game character is calculated according to the projection area to complete the rendering of the shadow of the target game character.

2. The game scene rendering method according to claim 1, characterized in that: The step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on preset rules includes: When the target simulated light source is detected in real time, a relative straight line between the target simulated light source and the target game character is detected in real time; Detecting a target straight line between the target simulated light source and the ground in real time, and determining in real time whether the relative straight line coincides with the target straight line; If it is determined in real time that the relative straight line coincides with the target straight line, then it is correspondingly determined that the target simulated light source is located directly above the target game character, and the target simulated light source will change dynamically.

3. The game scene rendering method according to claim 2, characterized in that: The step of detecting the mapping relationship between the target simulated light source and the target game character in real time based on a preset rule further includes: If it is determined in real time that the relative straight line does not coincide with the target straight line, then it is correspondingly determined that the target simulated light source is tilted relative to the target game character; The altitude angle of the target simulated light source relative to the ground is calculated in real time according to the relative straight line and the target straight line, and the mapping relationship between the target simulated light source and the target game character is detected in real time according to the altitude angle.

4. The game scene rendering method according to claim 3, characterized in that: The step of detecting the mapping relationship between the target simulated light source and the target game character in real time according to the altitude angle comprises: When the altitude angle is acquired in real time, a first identifier is added to the target simulated light source and a second identifier is added to the target game character; A corresponding mapping data chain is created in real time according to the first identifier, the second identifier and the altitude angle, and the mapping data chain is set to correspond to the mapping relationship.

5. The game scene rendering method according to claim 1, wherein: The step of calculating the size of the target shadow of the target game character according to the projection area to render the shadow of the target game character includes: When the projection area is determined in real time, the height and width corresponding to the target game character are detected in real time; A target projection coefficient adapted to the target game character is determined in real time according to the projection area, and rendering of the shadow of the target game character is completed according to the target projection coefficient, the height, and the width.

6. The game scene rendering method according to claim 5, characterized in that: The step of rendering the shadow of the target game character according to the target projection coefficient, the height, and the width includes: When the target projection coefficient is obtained in real time, a target outline adapted to the target game character is drawn in real time according to the height and the width; The target outline is adaptively stretched or shortened according to the target projection coefficient to render the shadow of the target game character in real time.

7. The game scene rendering method according to claim 6, characterized in that: The expression of the algorithm for adaptively stretching or shortening the target contour according to the target projection coefficient is: Wherein, S represents the shadow of the target game character, D represents the size of the target outline, K represents the target projection coefficient, θ represents the inclination angle of the projection surface, A represents the atmospheric attenuation factor, T represents the object transparency factor, and C represents the calibration constant.

8. A game scene rendering system, characterized in that: The system comprises: A detection module is used to detect in real time when the game is started, detect in real time the target game character controlled by the game user, and detect in real time the game scene corresponding to the target game character; A processing module is used to detect the corresponding target simulated light source in the game scene in real time, and detect the mapping relationship between the target simulated light source and the target game character in real time based on preset rules; The calculation module is used to calculate the corresponding projection area generated by the target simulated light source on the target game character in real time according to the mapping relationship, and calculate the corresponding size of the target shadow of the target game character according to the projection area, so as to complete the rendering of the shadow of the target game character.

9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the game scene rendering method according to any one of claims 1 to 7 is implemented.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the game scene rendering method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Shadow rendering apparatus and control method thereof

    CN105913481A

  • Game scene recognition method and device, electronic equipment and storage medium

    CN119445162A

  • Virtual model rendering method, device and equipment and computer readable storage medium

    CN119488709A

  • Game program, recording medium with the game program recorded thereon, and computer

    JP2009140135A

  • Dynamic soft shadow

    US20190347849A1

Cited By

  • Animation scene light and shadow dynamic rendering method and system

    CN121259162A