Multi-light source real-time character rendering system and method applied to animation games

CN122435108BActive Publication Date: 2026-10-09北京龙创悦动网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610572498.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-27
Publication Date
2026-10-09
Estimated Expiration
2046-04-27

AI Technical Summary

Technical Problem

[0004]为了解决现有技术通过基于物理距离的硬性剔除方法进行多光源实时角色渲染的画面平滑度与通透感还原效果较差的技术问题,本发明的目的在于提供一种应用于动漫游戏的多光源实时角色渲染系统及方法,所采用的技术方案具体如下:

Benefits of technology

本发明获取当前帧下动态光源的各空间与属性参数,并综合角色受光坐标相对于光源和摄像机的位置偏差情况、配置衰减半径以及初始光照强度来精准量化每个动态光源的透射贡献度,从而科学地划分保留渲染光源与超量待分配光源,有效避免了现有技术中仅按距离剔除导致远距离关键逆光光源被误删的缺陷,保障了动漫皮肤材质特有的光线透射视觉表现;进一步地,本发明摒弃了直接清零超量光源能量的硬性手段,而是通过构建超量待分配光源的待分配光强向量以及保留渲染光源的接收容量配额向量作为边际约束,并结合光源间的相对距离与位置透射相似情况构建方向偏差代价矩阵,随后进行迭代结算得出光强转移分配矩阵,在严格控制参与渲染光源数量的同时,将超量光源的初始光照能量按照物理空间与照射方向的相近程度无损且合理地转移至保留光源中,确保了场景总光照强度的前后守恒,从根本上消除了光源生灭瞬间引发的无序明暗闪跳,使得多光源实时角色渲染的画面平滑度与通透感还原效果更高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122435108B_ABST
    Figure CN122435108B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of game rendering, in particular to a multi-light-source real-time character rendering system and method applied to an animation game. Firstly, the transmission contribution degree of each dynamic light source is accurately quantified by comprehensively considering the position deviation of the light receiving coordinates of a character relative to light sources and a camera, configuring an attenuation radius and an initial light intensity, so that the reserved rendering light sources and the excess to-be-allocated light sources are scientifically divided; the to-be-allocated light intensity vector of the excess to-be-allocated light sources and the receiving capacity quota vector of the reserved rendering light sources are constructed as marginal constraints, a direction deviation cost matrix is constructed in combination with the relative distance between the light sources and the position transmission similarity, then the light intensity transfer allocation matrix is obtained through iteration settlement, the number of the rendering light sources is strictly controlled, the initial light energy of the excess light sources is transferred to the reserved light sources according to the similarity degree of the physical space and the illumination direction, and the picture smoothness and the high-transparency restoration effect of the multi-light-source real-time character rendering are higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game rendering technology, specifically to a multi-light source real-time character rendering system and method for use in animation and games. Background Technology

[0002] In real-time character rendering with multiple light sources in video games, the skin texture of anime-style characters commonly uses a subsurface scattering model for shading calculations to simulate the visual transparency of light penetration. When a large number of particle effects with dynamic light sources are generated instantaneously in the scene, the integral calculation overhead inside the shader increases dramatically with the number of light sources, easily exceeding the single-frame computing power limit of the graphics hardware and causing screen stuttering. Existing technologies typically use a hard culling method based on physical distance for real-time character rendering with multiple light sources. This involves setting a maximum threshold for the number of light sources at the rendering business logic layer and directly performing hard culling based on the physical distance of dynamic light sources from the camera or target character, retaining only a small number of nearby light sources for shading calculations.

[0003] However, existing technologies directly reset the initial illumination energy of excess light sources to zero when removing them, and do not consider the critical weight of the illumination angle of different light sources (especially the backlight direction) on the transparency of subsurface scattering. This makes it impossible to maintain the balance of the total input illumination intensity before and after the light source is removed while limiting the number of calculation loops of the graphics processor. This not only easily causes disordered brightness flickering of the total brightness of the screen at the moment the light source is created and destroyed, but also easily deletes key dynamic light sources that are far away but happen to be in the backlight. As a result, the existing technology has poor screen smoothness and transparency restoration effect when performing real-time character rendering with multiple light sources by hard removal methods based on physical distance. Summary of the Invention

[0004] To address the problem of poor image smoothness and transparency reproduction in existing technologies that use physical distance-based hard culling methods for real-time multi-light source character rendering, the present invention aims to provide a real-time multi-light source character rendering system and method for animation and games. The specific technical solution adopted is as follows: The first aspect of this invention provides a multi-source real-time character rendering method for animation and games, comprising: When rendering a multi-light source scene in real time, the light source space coordinates, initial light intensity, configuration attenuation radius, character light coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame are read from the scene manager. Based on the positional deviation of the character's illuminated coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity, the transmission contribution of each dynamic light source is determined; based on the transmission contribution, all dynamic light sources are divided into reserved rendering light sources and excess light sources to be allocated. Arrange the initial illumination intensities of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensities; construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates. The direction deviation cost matrix is ​​iteratively calculated using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints to determine the light intensity transfer allocation matrix; real-time character rendering of multiple light sources is performed based on the light intensity transfer allocation matrix.

[0005] Furthermore, the process of obtaining the transmission contribution includes: Based on the vector corresponding to the character's illuminated coordinates minus the light source's spatial coordinates, determine the illumination incident vector for each dynamic light source; based on the vector corresponding to the camera's world coordinates minus the character's illuminated coordinates, determine the gaze reference vector; based on the directional similarity between the illumination incident vector and the gaze reference vector, determine the transmission weight for each dynamic light source. The distance attenuation factor for each dynamic light source is determined based on the ratio between the magnitude of the incident light vector and the configured attenuation radius. The initial illumination intensity is weighted and fused based on the transmission weight and the distance attenuation factor to determine the transmission contribution of each dynamic light source.

[0006] Furthermore, the process of obtaining the transmission weight includes: The incident light vector is normalized to determine the unit light vector; the line-of-sight reference vector is normalized to determine the unit line-of-sight vector; the cosine similarity between the unit light vector and the unit line-of-sight vector is input into the ReLU function to output the transmission weight of each dynamic light source.

[0007] Furthermore, the process of dividing all dynamic light sources into reserved rendering light sources and excess unallocated light sources based on the transmission contribution includes: Arrange all dynamic light sources in descending order of their corresponding transmission contribution to determine the dynamic light source sequence; select the first few initial dynamic light sources in the dynamic light source sequence with the maximum preset number of lighting cycles as reserved rendering light sources; and select the other dynamic light sources besides the reserved rendering light sources as excess light sources to be allocated.

[0008] Furthermore, the process of obtaining the light intensity vector to be assigned includes: Arrange the initial illumination intensities of all excess light sources to be assigned in descending order to determine the light intensity vector to be assigned.

[0009] Furthermore, the process of obtaining the receiving capacity quota vector includes: Calculate the sum of the initial illumination intensities of all excess light sources to be allocated, and determine the total intensity of the excess light sources; Calculate the sum of the transmission contributions of all retained rendering light sources to determine the total retention contribution; If the sum of the retention contributions is equal to 0, then the receiving capacity quota of each retained rendering light source is determined according to the ratio between the sum of the excess light source intensities and the total number of retained rendering light sources. If the total retention contribution is greater than 0, then the corresponding contribution weight is determined based on the ratio between the transmission contribution of each retained rendering light source and the total retention contribution; the total intensity of the excess light sources is weighted based on the contribution weight to determine the receiving capacity quota of each retained rendering light source. Arrange the receive capacity quotas of all reserved rendering light sources in descending order of their corresponding initial light intensities to determine the receive capacity quota vector.

[0010] Furthermore, the process of obtaining the direction deviation cost matrix includes: The Euclidean distance between the light space coordinates of each excess light source to be allocated and the light space coordinates of each reserved rendering light source is standardized to determine the corresponding distance reference coefficient. The cosine similarity between the illumination unit vector of each excess light source to be allocated and the illumination unit vector of each reserved rendering light source is used as the judgment similarity; the judgment similarity is negatively correlated to determine the corresponding directional deviation coefficient. When the similarity is greater than or equal to 0, the comprehensive deviation cost between the corresponding excess light source to be allocated and the corresponding reserved rendering light source is determined based on the average value between the distance reference coefficient and the direction deviation coefficient. When the similarity is less than 0, the preset maximum blocking constant is used as the comprehensive deviation value between the corresponding excess light source to be allocated and the corresponding reserved rendering light source. Construct a direction deviation cost matrix, where the rows of the direction deviation cost matrix represent each excess light source to be allocated, the columns of the direction deviation cost matrix represent each reserved rendering light source, and the element value of each element position of the direction deviation cost matrix is ​​the comprehensive deviation cost between the excess light source to be allocated in the corresponding row and the reserved rendering light source in the corresponding column.

[0011] Furthermore, the process of obtaining the light intensity transfer allocation matrix includes: The element values ​​at each position in the direction deviation cost matrix are subjected to exponential negative correlation mapping to construct the Gibbs kernel matrix; Initialize a row scaling vector consistent with the number of excess light sources to be allocated, and a column scaling vector consistent with the number of reserved rendering light sources, and set the initial element values ​​of both the row scaling vector and the column scaling vector to 1.0; Using the light intensity vector to be allocated as the row constraint and the receiving capacity quota vector as the column constraint, the row scaling vector and the column scaling vector are iterated by alternating row and column scaling using the Gibbs kernel matrix until the preset convergence condition is met, and the iteration stops, and the final row scaling vector and the final column scaling vector are output. The light intensity transfer distribution matrix is ​​determined by performing matrix multiplication operations based on the final row scaling vector, the final column scaling vector, and the Gibbs kernel matrix.

[0012] Furthermore, the process of performing real-time character rendering from multiple light sources based on the light intensity transfer allocation matrix includes: Calculate the sum of all element values ​​in the column corresponding to each retained rendering light source in the light intensity transfer allocation matrix to determine the corresponding compensation light intensity; Based on the sum of the compensated light intensity and the corresponding initial light intensity, determine the total reconstructed light intensity of each retained rendering light source; extract the corresponding historical light intensity value from the previous frame's independent light constant buffer block of the current frame, and interpolate and mix the total reconstructed light intensity with the historical light intensity value to determine the target reconstructed light intensity; The spatial coordinates of all retained rendering light sources and their corresponding target reconstructed light intensities are overwritten into a pre-allocated independent lighting constant buffer block for the target character's material. Based on the light source data in the independent lighting constant buffer block, the fragment shader is called to perform a fixed number of subsurface scattering integral operations to generate and output the rendering of the current frame.

[0013] Secondly, the present invention provides a multi-light source real-time character rendering system for animation and games, the system comprising: The data acquisition module is used to read the light source space coordinates, initial light intensity, configuration attenuation radius, character lighting coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame from the scene manager when rendering multi-light source scenes in real time. The first determining module is used to determine the transmission contribution of each dynamic light source based on the positional deviation of the character's light-receiving coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity; and to divide all dynamic light sources into reserved rendering light sources and excess light sources to be allocated based on the transmission contribution. The second determining module is used to arrange the initial illumination intensity of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensity; and construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates. The character rendering module is used to iteratively calculate the direction deviation cost matrix using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints to determine the light intensity transfer allocation matrix; and to perform real-time character rendering with multiple light sources based on the light intensity transfer allocation matrix.

[0014] Thirdly, the present invention provides a computer device including a memory and a processor. The memory is used to store computer program code, and the processor is used to call and run the computer program code from the memory to perform the method as described in the first aspect or any embodiment of the first aspect of the present invention.

[0015] Fourthly, the present invention provides a computer program product comprising computer program code, which, when executed, performs the method as described in the first aspect or any embodiment of the first aspect of the present invention.

[0016] Fifthly, the present invention provides a computer-readable storage medium storing computer program code that, when executed, performs the method as described in the first aspect or any embodiment of the first aspect of the present invention.

[0017] The present invention has the following beneficial effects: This invention acquires the spatial and attribute parameters of dynamic light sources in the current frame and, by comprehensively considering the positional deviation of the character's light-receiving coordinates relative to the light source and camera, the configuration attenuation radius, and the initial illumination intensity, accurately quantifies the transmission contribution of each dynamic light source. This scientifically distinguishes between retained rendering light sources and excess light sources to be allocated, effectively avoiding the shortcomings of existing technologies that only remove light sources based on distance, leading to the accidental deletion of critical backlight sources at a distance. This ensures the unique visual performance of light transmission in anime skin materials. Furthermore, this invention abandons the rigid method of directly zeroing out the energy of excess light sources, instead constructing a light source to be allocated for excess light sources. The strong vector and the receiving capacity quota vector of the reserved rendering light source are used as marginal constraints. The direction deviation cost matrix is ​​constructed by combining the relative distance between the light sources and the similarity of positional transmission. Then, the light intensity transfer allocation matrix is ​​obtained by iterative calculation. While strictly controlling the number of light sources participating in the rendering, the initial light energy of the excess light sources is transferred to the reserved light sources in a lossless and reasonable manner according to the similarity of physical space and illumination direction. This ensures the conservation of the total light intensity of the scene before and after, fundamentally eliminating the disordered brightness and darkness flicker caused by the instant of light source birth and death. This makes the smoothness and transparency of the real-time character rendering with multiple light sources higher. Attached Figure Description

[0018] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart of a multi-light source real-time character rendering method for animation games provided in one embodiment of the present invention; Figure 2 This is a structural diagram of a multi-light source real-time character rendering system for animation and games, provided in one embodiment of the present invention. Figure 3 This is a schematic diagram of a computer device structure provided in one embodiment of the present invention. Detailed Implementation

[0020] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of the multi-source real-time character rendering system and method for animation and games proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment, and specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0022] The following description, in conjunction with the accompanying drawings, details the specific solution of a multi-source real-time character rendering system and method for animation and games provided by the present invention.

[0023] This invention provides a multi-source real-time character rendering method for animation and games. Please refer to [link / reference]. Figure 1 The diagram illustrates a flowchart of a multi-light source real-time character rendering method for animation games, provided by an embodiment of the present invention. The method includes: Step S101: When rendering a multi-light source scene in real time, read the light source space coordinates, initial light intensity, configuration attenuation radius, character light coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame from the scene manager.

[0024] When rendering multi-light source scenes in real time, as the game engine's graphics rendering pipeline enters a new frame's logical processing cycle, the system first needs to capture a snapshot of the instantaneous spatial position and physical parameters of the current frame from the front-end scene manager to establish a data benchmark for lighting calculations. Specifically, the system sends a data query command to the scene manager to extract the camera world coordinates of the current main camera in 3D space. These coordinates will serve as the absolute reference benchmark for subsequently determining the light transmission angle and visual direction. Simultaneously, for the character to be rendered in the scene, considering that anime character models are typically composed of complex 3D meshes, directly reading the root nodes of local bones such as the soles of the feet as the light-receiving points would lead to height deviations in the overall lighting calculations. Therefore, the system extracts the 3D rendering bounding box data corresponding to the target character in the current frame from the scene manager, calculates the geometric center point of the bounding box, and uses the obtained 3D coordinates of the center point as the character's uniformly proxied lighting coordinates, thereby ensuring the physical accuracy of the light convergence point.

[0025] After establishing the spatial reference for the camera and characters, the system continues to perform frustum clipping analysis through the scene manager, capturing all luminous entities currently within the main camera's frustum to pinpoint the set of dynamic light sources participating in graphics processing in the current frame. For each dynamic light source in this set, the system iterates through and reads its underlying lighting component properties to accurately obtain the light source's absolute position information in the 3D virtual world, i.e., its spatial coordinates. To accurately quantify the light source's brightness scale and control its energy diffusion boundary in space, the system also simultaneously reads the original emitted lumen value assigned to the light source by the front-end engine at the moment of particle or effect generation as the initial illumination intensity, and extracts the furthest effective distance from which the illumination completely decays to zero from the configuration data as the configuration decay radius. Through these steps, the system completely acquires the instantaneous position and physical properties of each key rendering object within a single frame's lifecycle, constructing the basic dataset for the current rendering logic frame, providing reliable data input for subsequent precise evaluation of light intensity transfer and transmission contribution.

[0026] It should be noted that, in order to prevent the light source and the character's lighting coordinates from being extremely overlapping due to particle effects clipping, which could cause division by zero anomalies in subsequent lighting vector unitization calculations, the system will perform a spatial validity check after obtaining the spatial coordinates of each dynamic light source; if it is determined that the spatial coordinates of a certain light source are inside the 3D rendering bounding box of the target character, the light source corresponding to the spatial coordinates of that light source will not be considered in the subsequent analysis.

[0027] Step S102: Determine the transmission contribution of each dynamic light source based on the positional deviation of the character's lighting coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity; divide all dynamic light sources into reserved rendering light sources and excess light sources to be allocated based on the transmission contribution.

[0028] After completing the real-time acquisition of initial data and establishing the basic dataset of dynamic light sources for the current frame, the system needs to deeply quantify the visual performance value of each light source in the process of restoring the transparency of animation materials. Because existing technologies only perform hard culling based on physical distance, critical backlighting sources are easily mistakenly deleted due to their distance from the camera, causing a momentary break in the transparency of the character's skin edges. Therefore, this embodiment of the invention comprehensively considers the positional deviations of the character's light-receiving coordinates relative to the spatial coordinates of the light sources and the world coordinates of the camera, thereby accurately capturing the incident direction and transmission direction of light behind the object. It also combines this with the configuration of the attenuation radius to attenuate the spatial energy distribution of the initial illumination intensity, thus scientifically determining the transmission contribution of each dynamic light source. Through this quantitative evaluation step, the system can extract a transmission contribution scalar with unique ranking value from multi-dimensional spatial attributes, providing an objective decision-making basis for accurately preserving backlighting sources with high restoration value without increasing the computing power load of the graphics hardware, effectively ensuring the visual continuity of transparency restoration during the real-time rendering of the character.

[0029] After accurately determining the transmission contribution of each dynamic light source, considering the objective upper limit of the graphics processor's single-frame rendering computation load, allowing all dynamic light sources in the scene to directly participate in shading calculations would easily lead to hardware overload and screen stuttering. However, directly removing light sources exceeding the upper limit using existing technology would disrupt the continuity of screen brightness. Therefore, all dynamic light sources are rationally divided into retained rendering light sources and excess light sources to be allocated based on their transmission contribution. This scientific division method based on comprehensive contribution aims to establish clear energy sender and receiver camps for subsequent lighting energy transfer and allocation. This ensures that key light sources with high transmission performance value are prioritized for retention while strictly controlling the number of rendering pipeline cycles. This lays a solid foundation for completely overcoming the disordered brightness flickering problem caused by multiple light source iterations, and further helps to significantly improve the smoothness and transparency of the screen during real-time character rendering with multiple light sources.

[0030] Step S103: Arrange the initial illumination intensities of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensity; construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates.

[0031] After classifying the dynamic light sources, to ensure that the initial illumination energy of excess light sources is not directly lost during culling, thus preventing abrupt changes in the overall brightness of the rendered image, it is necessary to summarize the initial illumination intensity of all excess light sources to be allocated and determine the light intensity vector to be allocated. By accurately constructing this light intensity vector, the initial emission energy carried by all redundant light sources blocked from entering the graphics pipeline can be precisely locked, allowing them to participate as a unified energy source in the subsequent optimal transmission and allocation process. The core engineering significance of this step lies in transforming the originally discretely distributed light sources to be culled into row boundary vectors with physical constraints. This mathematically guarantees that every piece of culled illumination energy is traceable in the subsequent recombination process, fundamentally providing the necessary total energy benchmark for achieving lossless and smooth recombination of illumination energy in multi-dynamic light source scenes.

[0032] After locking the light intensity vector to be allocated, to prevent local pixel overexposure caused by receiver overload during subsequent light energy transfer, it is necessary to determine and construct a receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and its corresponding initial light intensity. The construction of this receiving capacity quota vector essentially establishes a receiving limit with differentiated weights for the reserved rendering light source camp, allowing light sources with higher rendering value and transmission intensity to carry more compensation energy. Through this quota mechanism, the landing point of transferred energy can be scientifically constrained according to the visual presentation requirements of the animation material in the current frame, thereby precisely controlling the intensity distribution ratio of each light source after recombination. This not only greatly enhances the rationality of the light intensity distribution but also provides a crucial algorithmic basis for maintaining the detail and layering of the illuminated surface of the character in complex lighting environments.

[0033] After establishing the marginal constraints of the total amount sent and the limit received, to avoid erroneously transferring lighting energy to light sources with excessively large spatial spans or diametrically opposed illumination angles, which could lead to physics-insensitive shadow transitions on the illuminated surface, a direction deviation cost matrix needs to be constructed based on the relative distances between each reserved rendering light source and each excess light source to be allocated, as well as the similarity of their positional transmission relative to the character's lighting coordinates. By comprehensively evaluating the geometric Euclidean distance deviation in 3D space and the angular dispersion between illumination vectors, this cost matrix can accurately quantify the visual difference resistance between each pair of light source nodes and impose a significant numerical barrier on energy backflow across the illuminated hemisphere. This step forces the energy to be allocated to only approach the reserved light source with the closest spatial location and the most compatible illumination direction, thus mathematically simulating the smooth diffusion logic of light in 3D space. This is crucial for ensuring the spatial consistency of edge transmission in animation rendering.

[0034] Step S104: Iteratively calculate the direction deviation cost matrix using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints to determine the light intensity transfer allocation matrix; perform real-time character rendering for multiple light sources based on the light intensity transfer allocation matrix.

[0035] After constructing the two marginal constraint vectors and a deviation cost matrix, to find the globally optimal lighting allocation path under complex multi-source constraints, it is necessary to iteratively calculate the direction deviation cost matrix using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints, thus determining the light intensity transfer allocation matrix. By introducing an iterative algorithm with alternating row and column scaling weights to perform convergent solution of the deviation cost matrix, the specific energy components transferred from each excess light source to each retained light source can be finally analyzed, and the abstract spatial resistance is transformed into a concrete physical allocation scheme. The generation of this allocation matrix marks the transformation of the lighting reorganization strategy from theoretical design to an executable numerical matrix. It not only achieves strict energy conservation equality constraints on a macroscopic level, but also finely balances the intensity ratio of each light source on a microscopic level, thus providing deterministic data-driven support for thoroughly solving the problem of image brightness flickering.

[0036] After finalizing the light intensity transfer allocation matrix, in order to transform the abstract matrix values ​​into graphics hardware-readable memory input parameters and drive the fragment shader to perform physically correct shading integration, real-time multi-light source character rendering is required based on the light intensity transfer allocation matrix. This step involves adding the compensation energy parsed from the matrix to the initial parameters of the retained light sources, and combining inter-frame smoothing filtering and physical truncation mechanisms to finally encapsulate the reconstructed data. This allows the light source data containing compensation energy to be accurately overwritten into independent illumination constant buffer blocks, thereby guiding the graphics processor to perform subsurface scattering calculations under strictly controlled computational load. This final execution stage completely solidifies all the complex energy conservation and reconstruction logic of the preceding steps into the final rendering output, fundamentally achieving a deep unification of multi-light source dynamic scenes and anime-like visual transparency without increasing the computational load per frame. This results in a higher level of smoothness and transparency reproduction in real-time multi-light source character rendering.

[0037] Preferably, in some possible implementations of the embodiments of the present invention, the process of obtaining the transmission contribution includes: The system determines the incident light vector for each dynamic light source by subtracting the light source's spatial coordinates from the character's illuminated coordinates. It also determines the view reference vector by subtracting the character's illuminated coordinates from the camera's world coordinates. Finally, it determines the transmission weight of each dynamic light source based on the directional similarity between the incident light vector and the view reference vector. Specifically, the incident light vector is normalized to determine the illumination unit vector; the view reference vector is normalized to determine the view unit vector; and the cosine similarity between the illumination unit vector and the view unit vector is input into a ReLU function to output the transmission weight of each dynamic light source. Since the unique subsurface scattering effect (visual transparency) of anime skin materials primarily relies on the penetration of light from backlighting positions, the system can accurately quantify front lighting and backlighting states by calculating the cosine similarity between the light incident direction and the camera's view direction. When the cosine similarity is close to 1, it indicates that the light source is in an excellent backlighting position directly behind the character. By introducing the ReLU function as a truncation method, the system forcibly sets the transmission weight of light sources located on the same side with front lighting (cosine similarity less than or equal to 0) to zero. This mechanism preserves the absolute numerical advantage of backlighting sources in subsequent scoring and effectively prevents backlighting sources that can produce a sense of key edge transmission from being treated as ordinary redundant light sources during the lighting culling stage.

[0038] The distance attenuation factor for each dynamic light source is determined based on the ratio between the magnitude of the incident light vector and the configured attenuation radius. The transmission contribution of each dynamic light source is determined by weighted fusion of the initial illumination intensity based on the transmission weight and the distance attenuation factor. Simply relying on the transmission direction cannot objectively represent the actual light energy received by the illuminated surface, as illumination intensity decreases sharply with increasing geometric distance in real physical space. Therefore, the system calculates the initial attenuation rate of light energy diffusion with distance by solving the geometric ratio of the current spatial distance from the light source to the character to its configured attenuation radius, thus obtaining the distance attenuation factor. Furthermore, the system multiplies and fuses the initial illumination intensity (representing original brightness), the distance attenuation factor (representing spatial propagation loss), and the transmission weight (representing optical penetration value), scientifically reducing the multi-dimensional spatial and directional attributes and mapping them to a quantifiable scalar with unique ranking reference value: the transmission contribution. The larger this value, the higher the brightness of the light source itself, the closer it is to the character, and the more positive the backlight angle, thus increasing its rendering value in restoring the character's transparency in the current frame.

[0039] In one specific implementation of this invention, the process of obtaining the transmission contribution is expressed by the formula: ;in, For dynamic light source Transmission contribution; For dynamic light source The cosine similarity between the illumination unit vector and the line-of-sight unit vector; This is the ReLU activation function, which outputs 0 when the input value is less than or equal to 0, and outputs the input value when the input value is greater than 0. For dynamic light source Transmission weight; For dynamic light source The magnitude of the incident light vector, i.e., the dynamic light source. The distance between the spatial coordinates of the light source and the coordinates of the character receiving light; For dynamic light source Configuration attenuation radius; For dynamic light source Distance attenuation factor; For dynamic light source The initial light intensity. The square of the geometrical spatial proportion of the distance between the light source and the character to its effective attenuation radius is used to characterize the initial attenuation rate of light energy diffusion with distance. This is further expressed by subtracting the real number 1 from the value of 1. This causes the proportion of remaining light energy attenuating more severely as the distance increases, resulting in a smaller distance attenuation factor, which characterizes the effective light energy coverage per unit space. The purpose of introducing the ReLU activation function here is to force a zeroing operation on redundant light sources outside the effective attenuation radius. Because when... When the attenuation radius is exceeded, the subtraction operation inside the parentheses will produce a negative result. Introducing the ReLU activation function can prevent negative energy from entering the subsequent multiplication weight calculation from the mathematical level, thereby avoiding the risk of abnormal pixel color calculation of the material shader due to the generation of negative light intensity.

[0040] Preferably, in some possible implementations of the embodiments of the present invention, the process of dividing all dynamic light sources into reserved rendering light sources and excess light sources to be allocated according to the transmission contribution includes: All dynamic light sources are arranged in descending order of their corresponding transmission contribution to determine the dynamic light source sequence. The first few initial dynamic light sources in the dynamic light source sequence with the maximum preset illumination cycle count are designated as reserved rendering light sources. The remaining dynamic light sources are designated as excess light sources to be allocated. In one specific implementation of this invention, the maximum preset illumination cycle count is set to 8. This parameter is set based on the current graphics processor's single-frame computing power evaluation result or the game application's preset image quality level configuration. For example, this parameter is set to 8 at the very high image quality level, 6 at the medium image quality level, and 4 at the low image quality level. In another specific implementation of this invention, the maximum preset illumination cycle count is dynamically matched based on the graphics processor's computing power benchmark test results at the initial stage of scene loading. Devices with higher test scores are allocated a larger maximum preset illumination cycle count value, which is not further limited or elaborated here. It should be noted that dynamic light sources with the same transmission contribution are arranged sequentially in order of their generation timestamps from earliest to latest.

[0041] Because different platforms (such as mobile or PC) have fixed instruction times when calling fragment shaders to perform subsurface scattering integral calculations, the generation time of a single frame image can easily exceed the screen refresh cycle if the number of light sources involved in the calculation is not limited. Therefore, this embodiment of the invention pre-reads a specific maximum number of illumination cycles as a computational power cutoff criterion. After sorting the light sources according to their comprehensive transmission contribution, the system directly allows the top-ranked light sources to be reserved for rendering and receiving light intensity compensation, thus limiting a fixed number of memory slots for subsequent light intensity reorganization. Meanwhile, the lower-ranked light sources are placed in the excess allocation camp, completely isolating them from entering the graphics pipeline calculation. This not only establishes the source and target nodes of the subsequent optimal transmission algorithm, but also provides data structure support for ensuring the transparency of the image while locking the hardware computational power consumption boundary.

[0042] Preferably, in some possible implementations of this invention, the process of obtaining the light intensity vector to be allocated includes: arranging the initial illumination intensities of all excess light sources to be allocated in descending order to determine the light intensity vector to be allocated. The core purpose of this operation is not simply to focus on the order of the light intensity values, but to solidify the discrete initial illumination intensities of these eliminated light sources into one-dimensional row boundary constraints required by the subsequent optimal transmission algorithm when performing matrix iterative calculations. By establishing this light intensity vector to be allocated, the algorithm locks a rigid total energy output at the underlying mathematical structure, thereby ensuring that the initial luminous energy of each dynamic light source that must be eliminated is not directly discarded or omitted during the truncation process. This not only fundamentally eliminates the abnormal flickering of the image caused by the loss of total luminous flux in multi-light source scenes, but also establishes an unshakable transfer energy reference source for the subsequent accurate calculation of the illumination compensation matrix between excess light sources and retained light sources. It should be noted that the initial illumination intensity of the light intensity vector to be assigned here can be adjusted according to the specific implementation environment. However, it is necessary to maintain the same order of the excess light sources to be assigned in the subsequent matrix construction process as the order here. No further restrictions or elaborations will be made here.

[0043] Preferably, in some possible implementations of the embodiments of the present invention, the process of obtaining the receiving capacity quota vector includes: The sum of the initial illumination intensities of all excess light sources to be allocated is calculated to determine the total intensity of the excess light sources. It should be noted that when the total intensity of the excess light sources equals 0, meaning the initial lumen values ​​of the excess light sources are low or their effective light energy has been completely attenuated due to excessive distance, it indicates that there is no redundant energy requiring transfer within the current frame. In this case, the system does not need to perform subsequent complex matrix iteration calculations and directly maintains the original parameters of the rendering light sources for subsequent rendering, thus effectively saving unnecessary computational overhead in the real-time rendering pipeline.

[0044] Furthermore, it should be noted that if the total intensity of excess light sources is less than 0, it indicates a logical anomaly or a memory data verification error in the initial physical parameters of the dynamic light sources read from the scene manager in the current frame. Since light intensity should be a non-negative value in both physical and graphical terms, the system automatically activates the abnormal data protection mechanism, forcibly setting the total intensity of excess light sources to zero and skipping subsequent light intensity transfer and allocation calculations. This approach not only effectively prevents negative energy from causing algorithm non-convergence or logical collapse in subsequent matrix iterations but also ensures the robustness of the rendering pipeline against illegal input data from the front-end engine. This eliminates the risk of black screens or error-induced freezes due to data distortion at the underlying logic level, thus guaranteeing the stability of the rendering process.

[0045] The system calculates the sum of the transmission contributions of all retained rendering light sources to determine the total retention contribution. If the total retention contribution equals 0, the receiving capacity quota for each retained rendering light source is determined based on the ratio between the total intensity of excess light sources and the total number of retained rendering light sources. This degradation scheme is primarily designed for extreme lighting distribution scenarios (e.g., all retained light sources are positioned directly in front of the character, resulting in a transmission weight of 0). By employing a constant distribution strategy, the system ensures that the energy of the removed light sources can still be equally received by the retained light sources, thus maintaining the absolute conservation of the total input energy in multi-light source scenes under extreme conditions and ensuring the logical stability of the rendered image brightness.

[0046] If the total retained contribution is greater than 0, the corresponding contribution weight is determined based on the ratio between the transmission contribution of each retained rendering light source and the total retained contribution. The total intensity of excess light sources is then weighted based on these contribution weights to determine the receiving capacity quota for each retained rendering light source. By using the proportion of transmission contribution as a guide for allocation, the system achieves refined routing of lighting compensation energy. Retained light sources with higher rendering value and more correct backlighting angles will be assigned a larger receiving limit. This differentiated quota mechanism based on contribution not only maximizes the restoration of the transparency of anime materials but also scientifically restricts a single light source from receiving excessive energy using the quota upper limit, effectively avoiding the risk of abnormal overexposure of local pixels or highlight clipping caused by excessive light intensity stacking.

[0047] The receiving capacity quotas of all reserved rendering light sources are arranged in descending order of their corresponding initial illumination intensities to determine the receiving capacity quota vector. Echoing the construction logic of the light intensity vector to be allocated, this sorting operation is also to solidify the discrete quota values ​​into one-dimensional column boundary constraints required for the subsequent optimal transfer algorithm. By transforming the quota values ​​into a tightly structured one-dimensional array, the system sets a clear upper limit for the "receiving slot capacity" of the Sinkhorn algorithm at the mathematical level, transforming the originally abstract energy conservation equation into a column distribution constraint with engineering controllability. It should also be noted that the sorting rule here is mainly for building a unified data index. The sorting criteria can be adjusted in the specific implementation environment, but the column arrangement order of the corresponding reserved rendering light sources in the subsequent matrix construction process must be strictly consistent with this order. This ensures that the calculated light intensity transfer allocation matrix can accurately match the corresponding light source nodes when writing back energy, guaranteeing the rigor and accuracy of the physical allocation in the light intensity recombination process. Further limitations and elaborations are not provided here.

[0048] In one specific implementation of this invention, the process of obtaining the receiving capacity quota for each reserved rendering light source when the total retention contribution is greater than 0 is expressed by the following formula: ;in, To preserve the rendering light source The receiving capacity quota; To preserve the rendering light source Transmission contribution; To preserve the total number of rendering lights; For the first The transmission contribution of each preserved rendering light source; To retain the total contribution; The total number of excess light sources to be allocated; For the first The initial light intensity of the rendering light source is preserved; It represents the sum of the excess light source intensities.

[0049] Preferably, in some possible implementations of the embodiments of the present invention, the process of obtaining the direction deviation cost matrix includes: The Euclidean distance between the light space coordinates of each excess light source to be allocated and the light space coordinates of each reserved rendering light source is standardized to determine the corresponding distance reference coefficient. In a specific implementation of this invention, the process of obtaining the distance reference coefficient is expressed by the formula: ;in, For excess light sources to be allocated With Preserving Rendering Light Sources Distance reference coefficient between; For excess light sources to be allocated Light source space coordinates and preserved rendering light source The Euclidean distance between the spatial coordinates of the light source; To predetermine the spatial mesh size constant, this embodiment of the invention sets it to 5 meters, providing a normalized reference scale for spatial distance evaluation. This scale can be dynamically set based on the longest diagonal length of the 3D rendering bounding box of the character to be rendered. The formula selects the minimum value between the calculated ratio and the real number 1, ensuring the distance reference coefficient is strictly truncated and normalized to a value range of 0 to 1. This effectively prevents the coefficient from overflowing in the subsequent weighted summation due to excessive physical distance between the two light sources, thus completely overshadowing the influence of directional deviation weights. A larger distance reference coefficient indicates a greater physical distance between the excess light source and the retained light source in 3D space, resulting in higher spatial resistance costs for transferring light intensity between the two nodes.

[0050] The cosine similarity between the illumination unit vector of each excess light source to be allocated and the illumination unit vector of each retained rendering light source is used as the judgment similarity. A negative correlation mapping is performed on the judgment similarity to determine the corresponding direction deviation coefficient. Specifically, the judgment similarity is subtracted from the real number 1 to determine the corresponding direction deviation coefficient. By using the subtraction operation with the real number 1, the cosine similarity is flipped and mapped to a deviation scalar distributed in the interval between 0 and 2, avoiding negative values ​​that would affect subsequent calculations. The larger the direction deviation coefficient, the more significant the difference in the illumination directions of the two sources; when the illumination directions of the two light sources are completely consistent, the coefficient approaches 0, indicating that the resistance to the transfer and fusion of light energy in this directional dimension is minimal.

[0051] When the similarity is greater than or equal to 0, the comprehensive deviation cost between the corresponding excess light source to be allocated and the corresponding retained rendering light source is determined based on the average of the distance reference coefficient and the direction deviation coefficient. A similarity greater than or equal to 0 indicates that the excess light source to be allocated and the retained rendering light source are located within the same illuminated hemisphere of the target character, i.e., the angle between their illuminations is within 90 degrees. Under this condition, the system can comprehensively quantify the proximity of the two light sources in three-dimensional space and the degree of conformity in the illumination direction by performing an arithmetic average of the distance reference coefficient and the direction deviation coefficient. This allows the light intensity energy to smoothly converge towards the direction of the retained light source that is physically closest and has the most parallel illumination vector in subsequent iterative calculations. This multi-dimensional similarity trade-off not only simulates the natural proximity transfer characteristics of physical illumination in the same-side space, but also ensures that the recombined light intensity distribution can conform to the visual highlight distribution of the original scene to the greatest extent, guaranteeing the naturalness of the light and shadow transition on the character's surface.

[0052] When the similarity is less than 0, a preset maximum blocking constant is used as the comprehensive deviation cost between the corresponding excess light source to be allocated and the corresponding retained rendering light source. A similarity of less than 0 means that the illumination angle between the excess light source and the retained light source is greater than 90 degrees, that is, they are located on opposite sides of the illuminated surface of the target character. At this time, a customized maximum blocking constant is directly assigned (set to 10 to the power of 6 in this embodiment, which can be adjusted by the user). This can completely block the light intensity transfer path between these two points from a mathematical perspective, effectively preventing the disordered backflow of light energy between the illuminated surface and the backlit surface. This avoids the abnormal translation or local overexposure of the highlight spots on the front of the character due to the forced reception of energy from the backlight source, which goes against physical intuition.

[0053] A directional deviation cost matrix is ​​constructed, where the rows represent excess light sources to be allocated, and the columns represent retained rendering light sources. The element value at each position in the matrix represents the combined deviation cost between the excess light source in the corresponding row and the retained rendering light source in the corresponding column. By constructing this matrix, the system establishes a topological network at the underlying level that accurately depicts the resistance to energy transfer. This matrix not only integrates the spatial attenuation and directional dispersion characteristics from the physics of lighting but also internalizes a stringent cross-hemispherical blocking constant. This ensures that subsequent iterative calculations can forcefully guide the light energy to be culled along the path of least resistance, smoothly and losslessly integrating it into the retained light source with the most suitable spatial position and illumination angle. This results in higher smoothness and transparency in subsequent real-time multi-light source character rendering.

[0054] Preferably, in some possible implementations of the embodiments of the present invention, the process of obtaining the light intensity transfer allocation matrix includes: The Gibbs kernel matrix is ​​constructed by performing an exponential negative correlation mapping on the element values ​​at each position in the orientation deviation cost matrix. Specifically, for each comprehensive deviation cost value in the orientation deviation cost matrix, the system uses the negative exponentiation operation of the natural logarithm base to map it into a Gibbs kernel element representing the transfer tendency. The corresponding formulas include: ;in, The position of an element in the Gibbs kernel matrix The corresponding Gibbs nucleus element; The position of an element in the Gibbs kernel matrix The corresponding element values ​​in the orientation deviation cost matrix are in the same row and column as the Gibbs kernel matrix and the orientation deviation cost matrix, so the element positions correspond to each other. The value is a smoothing constant, ranging from 0.05 to 0.2. In this embodiment of the invention, it is preferably set to 0.1. It is used to control the entropy regularization degree of the optimal transmission solution, that is, to adjust the balance between the light intensity transfer scheme in seeking the path with the absolute least resistance and the relatively uniform diffusion of light intensity. It can be adjusted according to the specific implementation environment. This is an exponential function with the natural constant as its base. The formula establishes a nonlinear resistance filtering mechanism through negative exponential mapping: the smaller the overall deviation cost, the closer the corresponding Gibbs kernel element is to 1, indicating a higher tendency for light intensity to transfer along this path; while when the overall deviation cost is a preset maximum blocking constant, the Gibbs kernel element obtained through negative exponential operation will rapidly converge to a minimum value approaching 0. Through this mapping method, the system transforms the originally linear spatial and directional deviations into transfer weights with probabilistic distribution characteristics, not only mathematically blocking the cross-hemispherical equal-height resistance path, but also establishing an initial energy flow tendency network for subsequent row-column alternating scaling iterations.

[0055] Initialize the row scaling vector to match the number of excess light sources to be allocated, and the column scaling vector to match the number of reserved rendering light sources, and set the initial element values ​​of both the row scaling vector and the column scaling vector to 1.0; this initialization step builds the base state for the subsequent application of the Sinkhorn algorithm for iterative calculation, so that the scaling ratio of rows and columns is dynamically adjusted from the same starting point.

[0056] Using the light intensity vector to be allocated as the row constraint and the receiving capacity quota vector as the column constraint, the row scaling vector and column scaling vector are iterated alternately using the Gibbs kernel matrix until a preset convergence condition is met, at which point the iteration stops and the final row scaling vector and final column scaling vector are output. In a specific implementation of this invention, the preset convergence condition is set to the absolute value of the numerical difference between each element of the row scaling vector output in the current iteration and the row scaling vector output in the previous iteration being less than a preset error threshold (set to 0.001 in this embodiment, which can be adjusted according to the accuracy requirements in the specific implementation environment; the higher the accuracy requirement, the smaller the value). In addition, to prevent the real-time graphics pipeline from experiencing a sharp increase in single-frame rendering time due to the algorithm's failure to converge under extreme conditions, this embodiment sets an upper limit on the number of iterations. When the number of iterations reaches the preset upper limit, the loop is immediately interrupted and the current approximate solution is directly output, thereby maintaining the frame rate stability of the game screen while ensuring the accuracy of energy conservation. In one specific implementation of this invention, the preset upper limit of the number of iterations is set to 50. This can be adjusted according to the single-frame computing power margin of the graphics processor and the real-time frame rate requirements of the scene in the specific implementation environment. No further limitations or elaborations are made here.

[0057] Finally, matrix multiplication is performed based on the final row scaling vector, the final column scaling vector, and the Gibbs kernel matrix to determine the light intensity transfer distribution matrix. Specifically, the calculation formula for the element value at any position in the light intensity transfer distribution matrix includes: ;in, Excess light sources to be allocated in the intensity transfer allocation matrix With Preserving Rendering Light Sources The element value at the corresponding element position represents the excess light source to be allocated. Transfer to the reserved rendering light source The intensity transfer value; Excess light sources to be allocated in the final row scaling vector The corresponding element value; To preserve the rendering light source in the final column scaling vector The corresponding element value; Excess light sources to be allocated in the Gibbs kernel matrix With Preserving Rendering Light Sources The element value at the corresponding element position.

[0058] This analytical formula combines the kernel factor representing the original transfer tendency, the row multiplier representing the sender's energy conservation, and the column multiplier representing the receiver's capacity quota. In the calculated light intensity transfer allocation matrix, each non-zero element quantifies a specific light intensity scalar that a particular excess light source should transfer to a specific retained light source. This ensures that, while strictly adhering to row and column boundary distribution constraints, the eliminated light intensity is smoothly reorganized according to the principle of minimum visual resistance, providing the final decision data for subsequently driving the graphics hardware to perform physically correct illumination integration. It should be noted that, given a fixed cost matrix and boundary constraints, the process of obtaining the optimal transfer allocation solution through alternating row and column scaling based on the Sinkhorn algorithm is a technique well-known to those skilled in the art. Therefore, the internal mathematical derivation of the basic division update operator and scaling vector convergence will not be further defined or elaborated here.

[0059] Preferably, in some possible implementations of the embodiments of the present invention, the process of performing real-time character rendering based on a light intensity transfer allocation matrix includes: The sum of all element values ​​in the corresponding column of each retained rendering light source in the light intensity transfer allocation matrix is ​​calculated to determine the corresponding compensation light intensity. Based on the sum of the compensation light intensity and the corresponding initial illumination intensity, the total reconstituted light intensity of each retained rendering light source is determined. The historical light intensity value corresponding to the independent illumination constant buffer block of the previous frame is extracted, and the total reconstituted light intensity is interpolated and mixed with the historical light intensity value to determine the target reconstituted light intensity. Specifically: the current frame time weight coefficient and the historical frame time weight coefficient are set, and their sum is 1 (in this embodiment, the current frame time weight coefficient is set to 0.3, and the historical frame time weight coefficient is set to 0.7; these can be adjusted according to the requirements for transformation smoothness in the specific implementation environment). The total reconstituted light intensity is multiplied by the current frame time weight coefficient, and the historical light intensity value is multiplied by the historical frame time weight coefficient. The products of these two values ​​are then added together to obtain the target reconstituted light intensity. By introducing a time-series-based low-pass filtering mechanism, the frequent shifts in light energy between different retained light sources caused by the slight spatial displacement of the light source or camera can be effectively smoothed out, preventing high-frequency flickering of illuminated patches on the character's surface between frames.

[0060] The spatial coordinates of all retained rendering light sources and their corresponding target reconstructed light intensities are overwritten into a pre-allocated independent lighting constant buffer block for the target character's material. Based on the light source data in the independent lighting constant buffer block, the fragment shader is called to perform a fixed number of subsurface scattering integral calculations to generate and output the rendered image of the current frame. By accurately overwriting and isolating the reconstructed light source data in a dedicated memory block, not only is lighting pollution caused by global illumination replacement to non-anime materials (such as static terrain and ordinary vegetation) in the scene avoided, but the underlying pipeline also strictly ensures that the number of light sources participating in the shader integration cycle is always locked within the computing power limit (i.e., the preset maximum number of lighting cycles). After the target reconstructed light intensity is transferred and compensated, it is substituted into the subsurface scattering model. Because it absorbs the energy of the culled light sources, the spatial attenuation gradient of the pixel diffuse color becomes slower, and the rendered edge transmission effect has a wider coverage.

[0061] In summary, a multi-source real-time character rendering method for animation and games first obtains the spatial and attribute parameters of dynamic light sources in the current frame. Then, it comprehensively considers the positional deviation of the character's light-receiving coordinates relative to the light source and camera, the configured attenuation radius, and the initial illumination intensity to accurately quantify the transmission contribution of each dynamic light source. This scientifically distinguishes between retained rendering light sources and excess light sources to be allocated, effectively avoiding the defect in existing technologies where only distance-based culling leads to the accidental deletion of critical backlight sources at a distance, thus ensuring the unique light transmission visual performance of animation skin materials. Furthermore, this invention abandons the rigid method of directly zeroing out the energy of excess light sources, instead constructing... The unallocated light intensity vector of the excess light sources and the receiving capacity quota vector of the reserved rendering light sources are used as marginal constraints. A direction deviation cost matrix is ​​constructed by combining the relative distance and positional transmission similarity between light sources. Then, the light intensity transfer allocation matrix is ​​obtained through iterative calculation. While strictly controlling the number of light sources participating in the rendering, the initial illumination energy of the excess light sources is transferred to the reserved light sources in a lossless and reasonable manner according to the similarity of physical space and illumination direction. This ensures the conservation of the total illumination intensity of the scene before and after, fundamentally eliminating the disordered brightness and darkness flicker caused by the instant of light source birth and death. This makes the smoothness and transparency of the real-time character rendering with multiple light sources higher.

[0062] This invention also provides a multi-light source real-time character rendering system for animation and games; please refer to [link / reference]. Figure 2 The diagram shows a structural diagram of a multi-source real-time character rendering system for animation games provided by an embodiment of the present invention. The system includes: a data acquisition module 201, a first determination module 202, a second determination module 203, and a character rendering module 204.

[0063] The data acquisition module 201 is used to read the light source space coordinates, initial light intensity, configuration attenuation radius, character light coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame from the scene manager when rendering a multi-light source scene in real time. The first determining module 202 is used to determine the transmission contribution of each dynamic light source based on the positional deviation of the character's light-receiving coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity; and to divide all dynamic light sources into reserved rendering light sources and excess light sources to be allocated based on the transmission contribution. The second determining module 203 is used to arrange the initial illumination intensity of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the construction of the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensity; and construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates. The character rendering module 204 is used to iteratively calculate the direction deviation cost matrix with the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints, and determine the light intensity transfer allocation matrix; and to perform real-time character rendering with multiple light sources based on the light intensity transfer allocation matrix.

[0064] It should be noted that the system provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the multi-light source real-time character rendering system and the multi-light source real-time character rendering method for animation games provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0065] This invention also provides a computer device; please refer to [link / reference]. Figure 3 The illustration shows a schematic diagram of a computer device structure provided by an embodiment of the present invention. The computer device includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and running on the processor 302. When the processor 302 executes the computer program 303, the computer device can execute any of the multi-light source real-time character rendering methods for animation games described above.

[0066] This invention also provides a computer program product that, when run on a computer device, enables the computer device to execute any of the aforementioned multi-source real-time character rendering methods for animation and games.

[0067] This invention also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer device, the computer device can execute any of the aforementioned multi-source real-time character rendering methods for animation and games.

[0068] In the embodiments provided by the present invention, it should be understood that the computer device, computer program product and computer-readable storage medium provided are all used to execute the corresponding methods provided above, and therefore the beneficial effects they can achieve can be referred to the beneficial effects of the methods provided above, which will not be repeated here.

[0069] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0070] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A multi-source real-time character rendering method for animation and games, characterized in that, The method includes: When rendering a multi-light source scene in real time, the light source space coordinates, initial light intensity, configuration attenuation radius, character light coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame are read from the scene manager. Based on the positional deviation of the character's illuminated coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity, the transmission contribution of each dynamic light source is determined; based on the transmission contribution, all dynamic light sources are divided into reserved rendering light sources and excess light sources to be allocated. Arrange the initial illumination intensities of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensities; construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates. The direction deviation cost matrix is ​​iteratively calculated using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints to determine the light intensity transfer allocation matrix; real-time character rendering of multiple light sources is performed based on the light intensity transfer allocation matrix.

2. The multi-source real-time character rendering method for animation games according to claim 1, characterized in that, The process of obtaining the transmission contribution includes: Based on the vector corresponding to the character's illuminated coordinates minus the light source's spatial coordinates, determine the illumination incident vector for each dynamic light source; based on the vector corresponding to the camera's world coordinates minus the character's illuminated coordinates, determine the gaze reference vector; based on the directional similarity between the illumination incident vector and the gaze reference vector, determine the transmission weight for each dynamic light source. The distance attenuation factor for each dynamic light source is determined based on the ratio between the magnitude of the incident light vector and the configured attenuation radius. The initial illumination intensity is weighted and fused based on the transmission weight and the distance attenuation factor to determine the transmission contribution of each dynamic light source.

3. The multi-source real-time character rendering method for animation games according to claim 2, characterized in that, The process of obtaining the transmission weight includes: The incident light vector is normalized to determine the unit light vector; the line-of-sight reference vector is normalized to determine the unit line-of-sight vector; the cosine similarity between the unit light vector and the unit line-of-sight vector is input into the ReLU function to output the transmission weight of each dynamic light source.

4. The multi-source real-time character rendering method for animation games according to claim 1, characterized in that, The process of dividing all dynamic light sources into reserved rendering light sources and excess unallocated light sources based on the transmission contribution includes: Arrange all dynamic light sources in descending order of their corresponding transmission contribution to determine the dynamic light source sequence; select the first few initial dynamic light sources in the dynamic light source sequence with the maximum preset number of lighting cycles as reserved rendering light sources; and select the other dynamic light sources besides the reserved rendering light sources as excess light sources to be allocated.

5. The multi-source real-time character rendering method for animation games according to claim 1, characterized in that, The process of obtaining the light intensity vector to be assigned includes: Arrange the initial illumination intensities of all excess light sources to be assigned in descending order to determine the light intensity vector to be assigned.

6. The multi-source real-time character rendering method for animation games according to claim 1, characterized in that, The process of obtaining the receiving capacity quota vector includes: Calculate the sum of the initial illumination intensities of all excess light sources to be allocated, and determine the total intensity of the excess light sources; Calculate the sum of the transmission contributions of all retained rendering light sources to determine the total retention contribution; If the sum of the retention contributions is equal to 0, then the receiving capacity quota of each retained rendering light source is determined according to the ratio between the sum of the excess light source intensities and the total number of retained rendering light sources. If the total retention contribution is greater than 0, then the corresponding contribution weight is determined based on the ratio between the transmission contribution of each retained rendering light source and the total retention contribution; the total intensity of the excess light sources is weighted based on the contribution weight to determine the receiving capacity quota of each retained rendering light source. Arrange the receive capacity quotas of all reserved rendering light sources in descending order of their corresponding initial light intensities to determine the receive capacity quota vector.

7. The multi-source real-time character rendering method for animation games according to claim 3, characterized in that, The process of obtaining the direction deviation cost matrix includes: The Euclidean distance between the light space coordinates of each excess light source to be allocated and the light space coordinates of each reserved rendering light source is standardized to determine the corresponding distance reference coefficient. The cosine similarity between the illumination unit vector of each excess light source to be allocated and the illumination unit vector of each reserved rendering light source is used as the judgment similarity; the judgment similarity is negatively correlated to determine the corresponding directional deviation coefficient. When the similarity is greater than or equal to 0, the comprehensive deviation cost between the corresponding excess light source to be allocated and the corresponding reserved rendering light source is determined based on the average value between the distance reference coefficient and the direction deviation coefficient. When the similarity is less than 0, the preset maximum blocking constant is used as the comprehensive deviation value between the corresponding excess light source to be allocated and the corresponding reserved rendering light source. Construct a direction deviation cost matrix, where the rows of the direction deviation cost matrix represent each excess light source to be allocated, the columns of the direction deviation cost matrix represent each reserved rendering light source, and the element value of each element position of the direction deviation cost matrix is ​​the comprehensive deviation cost between the excess light source to be allocated in the corresponding row and the reserved rendering light source in the corresponding column.

8. The multi-source real-time character rendering method for animation games according to claim 1, characterized in that, The process of obtaining the light intensity transfer allocation matrix includes: The element values ​​at each position in the direction deviation cost matrix are subjected to exponential negative correlation mapping to construct the Gibbs kernel matrix; Initialize a row scaling vector consistent with the number of excess light sources to be allocated, and a column scaling vector consistent with the number of reserved rendering light sources, and set the initial element values ​​of both the row scaling vector and the column scaling vector to 1.0; Using the light intensity vector to be allocated as the row constraint and the receiving capacity quota vector as the column constraint, the row scaling vector and the column scaling vector are iterated by alternating row and column scaling using the Gibbs kernel matrix until the preset convergence condition is met, and the iteration stops, and the final row scaling vector and the final column scaling vector are output. The light intensity transfer distribution matrix is ​​determined by performing matrix multiplication operations based on the final row scaling vector, the final column scaling vector, and the Gibbs kernel matrix.

9. A multi-source real-time character rendering method for animation and games according to claim 1, characterized in that, The process of performing real-time character rendering based on the light intensity transfer allocation matrix includes: Calculate the sum of all element values ​​in the column corresponding to each retained rendering light source in the light intensity transfer allocation matrix to determine the corresponding compensation light intensity; Based on the sum of the compensated light intensity and the corresponding initial light intensity, determine the total reconstructed light intensity of each retained rendering light source; extract the corresponding historical light intensity value from the previous frame's independent light constant buffer block of the current frame, and interpolate and mix the total reconstructed light intensity with the historical light intensity value to determine the target reconstructed light intensity; The spatial coordinates of all retained rendering light sources and their corresponding target reconstructed light intensities are overwritten into a pre-allocated independent lighting constant buffer block for the target character's material. Based on the light source data in the independent lighting constant buffer block, the fragment shader is called to perform a fixed number of subsurface scattering integral operations to generate and output the rendering of the current frame.

10. A multi-light source real-time character rendering system for animation and games, characterized in that, The system includes: The data acquisition module is used to read the light source space coordinates, initial light intensity, configuration attenuation radius, character lighting coordinates of the character to be rendered, and camera world coordinates of each dynamic light source in the current frame from the scene manager when rendering multi-light source scenes in real time. The first determining module is used to determine the transmission contribution of each dynamic light source based on the positional deviation of the character's light-receiving coordinates relative to the light source's spatial coordinates and the camera's world coordinates, the configured attenuation radius, and the initial illumination intensity; and to divide all dynamic light sources into reserved rendering light sources and excess light sources to be allocated based on the transmission contribution. The second determining module is used to arrange the initial illumination intensity of all excess light sources to be allocated and determine the light intensity vector to be allocated; determine the receiving capacity quota vector based on the relative magnitude of the transmission contribution of each excess light source to be allocated and the corresponding initial illumination intensity; and construct the direction deviation cost matrix based on the relative distance between each reserved rendering light source and each excess light source to be allocated and the positional transmission similarity relative to the character's lighting coordinates. The character rendering module is used to iteratively calculate the direction deviation cost matrix using the light intensity vector to be allocated and the receiving capacity quota vector as marginal constraints to determine the light intensity transfer allocation matrix; and to perform real-time character rendering with multiple light sources based on the light intensity transfer allocation matrix.

Citation Information

Patent Citations

  • Video fusion method based on live-action three-dimensional scene and electronic equipment

    CN120088439A

  • Mobile phone energy consumption optimization method

    CN121008919A