Method and system for rendering light and shadow dynamics of animation scene

By establishing the relationship between light and shadow and dynamic response rules between elements in anime scenes, and optimizing light and shadow parameters, the problem of unrealistic and inconsistent light and shadow effects in existing technologies has been solved, achieving efficient and natural light and shadow rendering effects.

CN121259162BActive Publication Date: 2026-04-10CHENGDU HEIGE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU HEIGE TECHNOLOGY CO LTD
Filing Date
2025-10-09
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing methods for rendering lighting and shadows in anime scenes cannot effectively consider the interaction between static structural elements and dynamic character elements, resulting in a lack of realism and continuity in lighting and shadow effects. Furthermore, they are difficult to dynamically adjust according to the atmosphere type, leading to low efficiency and inconsistent lighting and shadow effects.

Method used

Establish the relationship between light and shadow between scene elements, generate dynamic light and shadow response rules, and optimize light and shadow parameters through multiple rounds of iteration to achieve dynamic adaptive adjustment of light and shadow effects. Generate inter-frame light and shadow transition parameters to ensure smooth light and shadow transition.

Benefits of technology

It achieves dynamic adaptive adjustment of lighting and shadow effects, improves rendering efficiency, ensures that the lighting and shadow effects match the scene atmosphere, eliminates lighting and shadow interference, and provides a more realistic and natural visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259162B_ABST
    Figure CN121259162B_ABST
Patent Text Reader

Abstract

The application provides an animation scene light and shadow dynamic rendering method and system, and relates to the technical field of animation production. First, the light and shadow correlation relationship between each scene element (including scene static structure elements and scene dynamic role elements) in an animation scene is established to obtain a scene element light and shadow correlation graph containing hierarchical division and correlation weight. Based on the scene element light and shadow correlation graph, light and shadow dynamic response rules are generated in combination with atmosphere types. According to the rules, initial light and shadow rendering schemes are generated in combination with current frame scene element state data and atmosphere type identifiers. The interactive influence of the light and shadow effects of each scene element in the initial light and shadow rendering scheme is analyzed. The final light and shadow rendering scheme is generated by adjusting and optimizing the light and shadow parameters through multiple rounds of iteration and is applied to the current frame rendering. Finally, the key light and shadow parameters of the current frame are extracted and analyzed for continuity with the previous frame. Frame-to-frame light and shadow transition parameters are generated for smooth connection of the next frame light and shadow, thereby bringing a smoother and more comfortable visual experience to the audience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of animation production, in particular to an animation scene light and shadow dynamic rendering method and system. BACKGROUND

[0002] In the field of animation production, scene light and shadow rendering is a key link to create a realistic atmosphere and enhance visual effects. However, the existing animation scene light and shadow rendering methods have many limitations. Traditional light and shadow rendering methods often handle each scene element in isolation, without fully considering the complex light and shadow interaction between scene static structural elements (such as buildings, terrain, etc.) and scene dynamic role elements (such as characters, animals, etc.). For example, when rendering a scene containing a character moving in front of a building, the existing method may simply set light and shadow parameters for the character and the building separately, without considering the influence of the character's action on the light and shadow of the building surface, and the blocking and reflection of the building structure on the light and shadow around the character, resulting in a lack of realism and coherence in the light and shadow effect.

[0003] At the same time, the existing light and shadow rendering methods are difficult to dynamically adjust according to the atmosphere type of the animation scene. Different atmosphere types (such as warm, tense, mysterious, etc.) require different light and shadow effects to highlight, but traditional methods lack effective rules to define how to accurately adjust light and shadow parameters when scene element state changes and atmosphere type switches. This makes it necessary to manually adjust a large number of parameters during production, which is not only inefficient, but also difficult to ensure the consistency and accuracy of the light and shadow effect. In addition, in terms of inter-frame light and shadow transition, existing technologies often cannot achieve smooth connection, resulting in light and shadow jumps in the animation when playing, affecting the visual experience of the audience. SUMMARY

[0004] In view of the above-mentioned problems, in combination with the first aspect of the present application, the embodiments of the present application provide an animation scene light and shadow dynamic rendering method, which comprises:

[0005] Establishing a light and shadow association relationship between each scene element in the animation scene to obtain a scene element light and shadow association graph, the scene elements including scene static structural elements and scene dynamic role elements, the light and shadow association relationship being used to describe the association mode of light and shadow interaction between different scene elements, and the scene element light and shadow association graph containing hierarchical division information of the scene elements and light and shadow association weights between different levels;

[0006] Based on the scene element light and shadow association graph, in combination with the atmosphere type that may appear in the animation scene, generating a light and shadow dynamic response rule, the light and shadow dynamic response rule being used to define the corresponding light and shadow adjustment mode when the scene element state changes and the atmosphere type switches;

[0007] According to the light and shadow dynamic response rule, scene element state data of a current frame of the animation scene and a current atmosphere type identifier are combined to generate an initial light and shadow rendering scheme, the scene element state data including position distribution information of scene static structure elements and action posture information of scene dynamic role elements, and the initial light and shadow rendering scheme including basic light and shadow parameters and atmosphere adaptation parameters of each scene element;

[0008] Based on the scene element light and shadow association graph, interaction influences between light and shadow effects corresponding to each scene element in the initial light and shadow rendering scheme are analyzed, including direct light and shadow interference and indirect light and shadow interference, to obtain a light and shadow interaction influence result, the light and shadow interaction influence result including an interference source identifier, an interfered element identifier, and an interference transmission path;

[0009] According to the light and shadow interaction influence result, a multi-round iteration adjustment mode is used to optimize light and shadow parameters in the initial light and shadow rendering scheme to generate a final light and shadow rendering scheme, and the final light and shadow rendering scheme is applied to rendering processing of the current frame of the animation scene.

[0010] Key light and shadow parameters in the final light and shadow rendering scheme of the current frame are extracted, and corresponding key light and shadow parameters in a previous frame rendering scheme are analyzed for continuity to generate inter-frame light and shadow transition parameters, the inter-frame light and shadow transition parameters being used for light and shadow smooth connection in next frame rendering.

[0011] In still another aspect, an embodiment of the present application further provides an animation scene light and shadow dynamic rendering system, characterized in that it comprises:

[0012] a processor; a machine readable storage medium for storing machine executable instructions of the processor; wherein the processor is configured to execute the above-mentioned animation scene light and shadow dynamic rendering method by executing the machine executable instructions.

[0013] In still another aspect, an embodiment of the present application further provides a computer program product, the computer program product comprising machine executable instructions stored in a computer readable storage medium, a processor of a computer device reading the machine executable instructions from the computer readable storage medium, and the processor executing the machine executable instructions so that the computer device executes the above-mentioned animation scene light and shadow dynamic rendering method.

[0014] Based on the above aspects, by establishing the light and shadow correlation relationship between each scene element in the animation scene, a scene element light and shadow correlation graph containing hierarchical division information and light and shadow correlation weights between different levels is obtained, which can comprehensively and accurately describe the correlation mode of the mutual influence of light and shadow between different scene elements. The light and shadow dynamic response rule generated based on the scene element light and shadow correlation graph can define the corresponding light and shadow adjustment mode of the scene element state change and the atmosphere type switching according to the possible atmosphere types of the animation scene, realize the dynamic adaptive adjustment of the light and shadow effect, and greatly improve the rendering efficiency without manual intervention, while ensuring the high consistency of the light and shadow effect and the scene atmosphere. According to the initial light and shadow rendering scheme generated based on the light and shadow dynamic response rule, combined with the analysis result of the interaction of the light and shadow effect of each scene element in the initial scheme, the multi-round iteration adjustment mode is used to optimize the light and shadow parameters, which can eliminate direct light and shadow interference and indirect light and shadow interference, generate a more accurate and reasonable final light and shadow rendering scheme, and make the light and shadow effect of the animation scene more realistic and natural. Finally, by extracting the key light and shadow parameters in the final light and shadow rendering scheme of the current frame and performing continuity analysis on the corresponding key light and shadow parameters in the rendering scheme of the previous frame, inter-frame light and shadow transition parameters are generated, the smooth connection of the light and shadow in the next frame rendering is realized, and a more smooth and comfortable visual experience is brought to the audience. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is the execution flow diagram of the animation scene light and shadow dynamic rendering method provided by the embodiment of the application. DETAILED DESCRIPTION

[0016] The application will be specifically described below in conjunction with the drawings of the specification, Figure 1 is the flow diagram of the animation scene light and shadow dynamic rendering method provided by an embodiment of the application, and the animation scene light and shadow dynamic rendering method will be described in detail below.

[0017] Step S110: Establish the light and shadow correlation relationship between each scene element in the animation scene to obtain a scene element light and shadow correlation graph, wherein the scene elements include scene static structure elements and scene dynamic role elements, the light and shadow correlation relationship is used to describe the correlation mode of the mutual influence of light and shadow between different scene elements, and the scene element light and shadow correlation graph contains hierarchical division information of the scene elements and light and shadow correlation weights between different levels.

[0018] In this embodiment, a general cartoon indoor scene is taken as an example for illustration. There are various scene elements in this scene, including fixed structural objects and movable character objects. The fixed structural objects include the basic framework part constituting the scene space, the support part for placing articles, and the device part providing basic lighting; the movable character objects include the core character performing the main activity in the scene, the secondary character performing the auxiliary activity, and other characters appearing temporarily. Establishing the light-shadow association relationship aims to clarify the rules of light-shadow action between these different types of elements, such as the illumination range and intensity variation of the lighting device on the surrounding structural objects, and the shadow pattern variation of the character objects on the ground during movement. By constructing the scene element light-shadow association graph, the hierarchical division of the elements and the weight relationship of the light-shadow influence between different levels of elements can be systematically presented.

[0019] Step S111: classifying the scene elements in the cartoon scene to distinguish between scene static structural elements and scene dynamic character elements, obtaining a scene element classification result, the scene static structural elements including architectural components, natural landscape elements, prop elements, the scene dynamic character elements including main character elements, secondary character elements, and temporarily appearing character elements.

[0020] In the above general cartoon indoor scene, the classification operation of the scene elements is first performed. In terms of scene static structural elements, architectural components include the top structure constituting the scene space boundary, the surrounding support structure, the bottom support structure, and the transition structure connecting the parts; prop elements include multi-layer storage structures for placing articles, seats and article placement planes for characters, fixed and movable lamps providing lighting functions, and small decorative arrangements and functional tool articles; natural landscape elements are not involved because the scene is an indoor environment. In terms of scene dynamic character elements, the main character elements are set as the characters performing the core task in the scene, the secondary character elements are the characters performing the auxiliary task in the scene, and the temporarily appearing character elements are the characters appearing temporarily in the scene and not affecting the main plot. In the classification process, each element is assigned a unique identification code, and the coding rule includes the feature prefix of the element type and the sequential serial number, for example, the code of the architectural component starts with a specific letter combination, and the code of the main character element starts with another specific letter combination, different prefixes are used to distinguish the large categories of elements, and the serial numbers are sequentially assigned according to the order of the elements appearing in the scene.

[0021] Step S112: Hierarchical division is performed on the scene elements in the scene element classification result, to divide the scene elements into core scene elements, secondary scene elements and background scene elements, the core scene elements are elements corresponding to visual focal points in the picture, the secondary scene elements are elements for assisting the core scene elements in expression, and the background scene elements are elements for constructing the spatial sense of the scene; the light-shadow correlation weight corresponding to the scene elements in different levels is determined, the light-shadow correlation weight of the core scene elements is greater than that of the secondary scene elements, and the light-shadow correlation weight of the secondary scene elements is greater than that of the background scene elements.

[0022] After the element classification is completed, the scene elements in the classification result are hierarchically divided. The core scene elements are selected from elements in the picture as visual focal points, that is, the main role elements performing the core task and the prop elements directly interacting with them, which occupy a prominent position in the picture and are the core of the plot expression; the secondary scene elements include auxiliary prop elements around the main role elements and secondary role elements performing auxiliary tasks, which constitute the direct environment of the core scene elements and are used to enrich the picture level and plot content; the background scene elements cover the boundary building components of the scene space, the decorative prop elements in the distance and the lighting devices providing the overall environmental atmosphere, which are used to construct the overall spatial sense and environmental keynote of the scene. The light-shadow correlation weight is set according to the level of the elements, the light-shadow correlation weight of the core scene elements is set to the highest level, the light-shadow correlation weight of the secondary scene elements is set to the middle level, and the light-shadow correlation weight of the background scene elements is set to the lowest level. In specific setting, the weight value interval of the core scene elements is higher than that of the secondary scene elements, and the weight value interval of the secondary scene elements is higher than that of the background scene elements, so as to distinguish the importance of the elements in different levels in the mutual influence of light and shadow through different weight intervals.

[0023] Step S113: Extract the light-shadow attribute of each scene element, the light-shadow attribute includes the reflection characteristic of the scene element to light and shadow, the absorption characteristic of the scene element to light and shadow, and the self-luminous characteristic of the scene element, the reflection characteristic includes the diffuse reflection ratio and the specular reflection ratio, the absorption characteristic includes the absorption ratio of different wavelengths of light, and the self-luminous characteristic includes the self-luminous intensity and the luminous color range.

[0024] After the classification and hierarchy division of the scene elements are completed, the light and shadow properties of each scene element are extracted. In terms of reflection characteristics, for the bottom support structure in the building component, if the surface is rough, the diffuse reflection ratio is set to a higher value and the specular reflection ratio is set to a lower value; if the surface is smooth, the diffuse reflection ratio is set to a lower value and the specular reflection ratio is set to a higher value. For the seat in the prop element, if the surface is cloth material, the diffuse reflection ratio is higher and the specular reflection ratio is lower; if the surface is metal material, the specular reflection ratio is higher and the diffuse reflection ratio is lower. The clothing materials of the main role elements are different, and the reflection characteristics are also different, for example, the diffuse reflection ratio of cotton clothing is high, and the specular reflection ratio of silk clothing is relatively high. In terms of absorption characteristics, the absorption ratios of different scene elements are different for different wavelengths of light, for example, the red object plane has a higher absorption ratio for blue wavelength light and a lower absorption ratio for red wavelength light; the green decorative arrangement has a high absorption ratio for red wavelength light and a low absorption ratio for green wavelength light. The light-emitting characteristics mainly target the lighting device type prop elements and the role elements with self-luminous ability. The self-luminous intensity is set to different ranges according to the types of the elements, and the light-emitting color range is set to include a range of color combinations according to the design of the elements, for example, a fixed lamp may emit warm yellow light, and its light-emitting color range is concentrated in the yellow wavelength region, while some main role elements with special abilities may emit blue light, and the light-emitting color range is concentrated in the blue wavelength region.

[0025] Step S114: analyze the spatial position relationship between each scene element and other scene elements, determine the light and shadow propagation path between different scene elements according to the spatial position relationship, if there is an occlusion scene element, mark the light and shadow propagation path as a blocked path, and record the identification and occlusion degree of the occlusion scene element, wherein the spatial position relationship includes distance interval, relative angle, and occlusion relationship, and the light and shadow propagation path is used to describe the path direction of the light and shadow from one scene element to another scene element.

[0026] After extracting the light shadow attribute, the spatial position relationship between each scene element and other scene elements is analyzed. The analysis of the spatial position relationship includes three aspects of distance interval, relative angle and occlusion relationship. The distance interval refers to the straight-line distance between two scene elements, which is obtained by calculating the modulus of the coordinate difference value of each element in the scene coordinate system. The relative angle refers to the angle between the horizontal direction and the vertical direction of one scene element relative to the reference point, which is obtained by calculating the arctangent value of the coordinate difference value. The occlusion relationship is to determine whether there is other scene element blocking the light shadow propagation between two scene elements, which is determined by checking whether the geometric model of other elements intersects in the direction of the line connecting the two elements. According to the spatial position relationship, the light shadow propagation path is determined, and the direction of the light shadow propagation path is from the light shadow emitting element to the light shadow receiving element. When there is an occlusion scene element between two scene elements, the light shadow propagation path is marked as a blocked path, and the identification and occlusion degree of the occlusion scene element are recorded. The occlusion degree is measured by the ratio of the projection area of the occlusion element on the propagation path to the total path cross-sectional area. The larger the ratio is, the higher the occlusion degree is.

[0027] Step S115: According to the light shadow attribute of each scene element, the light shadow propagation path between different scene elements and the hierarchical correlation weight of the scene element, the light shadow correlation degree between different scene elements is calculated, which is used to quantify the degree of mutual influence of light shadow between different scene elements. In the calculation process, the basis correlation value is first determined according to the light shadow attribute, then the basis correlation value is corrected according to the smoothness of the light shadow propagation path, and finally the final light shadow correlation degree is obtained combined with the hierarchical correlation weight.

[0028] After obtaining the light and shadow properties, light and shadow propagation paths and hierarchical correlation weights of the scene elements, the light and shadow correlation degrees between different scene elements are calculated. First, the basic correlation value is determined according to the light and shadow properties. The calculation of the basic correlation value considers the diffuse reflection ratio and the specular reflection ratio in the reflection characteristic, the absorption ratio of different wavelengths of light in the absorption characteristic, and the self-luminous intensity and luminous color range in the luminous characteristic. For the element with the luminous characteristic, the basic correlation value between the element and the receiving light and shadow element is determined according to the matching degree of the luminous intensity and the luminous color range with the absorption characteristic of the receiving element; for the element without the luminous characteristic but with the reflection characteristic, the basic correlation value is determined according to the reflection ratio and the positional relationship of the receiving element. Then, the basic correlation value is corrected according to the smoothness of the light and shadow propagation path. If the propagation path is a smooth path, the correction coefficient is greater than 1; if it is a blocked path, a correction coefficient less than 1 is set according to the blocking degree. The higher the blocking degree, the smaller the correction coefficient. The basic correlation value is multiplied by the correction coefficient to obtain the corrected correlation value. Finally, the corrected correlation value is multiplied by the proportional coefficient of the hierarchical correlation weight to obtain the final light and shadow correlation degree. The higher the hierarchical correlation weight of the element, the greater the proportional coefficient, so that the final light and shadow correlation degree can reflect the difference in the light and shadow influence degree between elements of different levels.

[0029] Step S116: Based on the light and shadow correlation degrees between different scene elements, a scene element light and shadow correlation graph is constructed. The scene element light and shadow correlation graph takes scene elements as nodes, the node attributes include scene element types, hierarchical identifiers and light and shadow properties, the light and shadow correlation degrees are taken as the attributes of the connecting edges between nodes, and the smoothness of the light and shadow propagation path and the blocking element identifier are also marked. At the same time, a hierarchical index is added to the scene element light and shadow correlation graph.

[0030] Based on the calculated light and shadow correlation degrees between different scene elements, a scene element light and shadow correlation graph is constructed. The scene element light and shadow correlation graph takes scene elements as nodes, the attributes of each node include the type, hierarchical identifier and light and shadow properties of the scene element. The type is the building component, prop element, main role element and the like obtained by classification, the hierarchical identifier is the identifier of the core, secondary or background level, and the light and shadow properties include reflection, absorption, luminous and other characteristic parameters. The connecting edges between nodes represent the light and shadow correlation relationship between scene elements, and the attributes of the connecting edges take the light and shadow correlation degree as the main parameter, and mark the smoothness of the light and shadow propagation path (smooth or blocked) and the blocking element identifier when blocked. In addition, a hierarchical index is added to the scene element light and shadow correlation graph. The hierarchical index is arranged in the order of core scene elements, secondary scene elements and background scene elements, and each level contains all nodes of the level. Through the hierarchical index, different levels of scene elements and their correlation relationships can be quickly located, which is convenient for subsequent query and application of the graph.

[0031] Step S120: Based on the scene element light shadow correlation graph, combined with the possible atmosphere types of the animation scene, a light shadow dynamic response rule is generated, which is used to define the corresponding light shadow adjustment mode when the scene element state changes and the atmosphere type switches.

[0032] After the scene element light shadow correlation graph is constructed, based on the graph, combined with the possible atmosphere types of the animation scene, a light shadow dynamic response rule is generated. The atmosphere type is a different situation mode set according to the plot requirements and emotional expression of the scene, and different atmosphere types correspond to different overall light shadow effects. The light shadow dynamic response rule is a rule set that specifies how to adjust the light shadow parameters of each scene element when the state of the scene element changes or the atmosphere type switches. Through the rule, the dynamic matching of light shadow effect and scene plot and atmosphere can be realized.

[0033] Step S121: Define the possible atmosphere types of the animation scene, each atmosphere type corresponding to a set of reference light shadow characteristics, the reference light shadow characteristics including overall light intensity range, main color range, light shadow contrast range and shadow softness parameter.

[0034] First, define the possible atmosphere types of the animation scene. According to the common plot requirements of general animation indoor scenes, set multiple different atmosphere types, such as daily activity atmosphere, tense atmosphere, warm atmosphere, mysterious atmosphere, etc. Each atmosphere type corresponds to a set of reference light shadow characteristics. The overall light intensity range specifies the light intensity interval of the scene as a whole under this atmosphere. The light intensity range of different atmosphere types is different, for example, the light intensity range of the daily activity atmosphere is at a moderate level, and the light intensity range of the tense atmosphere may be lower and fluctuate more. The main color range specifies the main color interval of the scene light under this atmosphere, for example, the main color range of the warm atmosphere may be concentrated in the warm color system, and the main color range of the mysterious atmosphere may be concentrated in the cold color system. The light shadow contrast range specifies the luminance difference interval of the bright and dark regions in the scene. The contrast range of the daily activity atmosphere is moderate, and the contrast range of the tense atmosphere may be larger to enhance the dramatic effect. The shadow softness parameter specifies the blur degree of the shadow edge in the scene. The shadow softness parameter of the warm atmosphere is higher, and the shadow edge is more blurred. The shadow softness parameter of the tense atmosphere is lower, and the shadow edge is more sharp.

[0035] Step S122: Extract the node attribute information of each scene element and the light shadow correlation degree information of the connection edge between the nodes in the scene element light shadow correlation graph. The node attribute information includes scene element type, level identifier, light shadow attribute, and connection edge information includes light shadow correlation degree and propagation path state.

[0036] From the constructed scene element light shadow association graph, relevant information is extracted, including node attribute information of each scene element and light shadow association degree information of the connection edge between nodes. In the extraction process of node attribute information, the scene element type is directly obtained from the node attribute, that is, the classification types such as building components, prop elements, main role elements, etc.; the level identifier obtains the level information of the core, secondary or background; and the light shadow attribute extracts the specific parameter values of the reflection characteristics, absorption characteristics and luminous characteristics. In the extraction of connection edge information, the light shadow association degree directly obtains the value calculated before; the propagation path state obtains the state identifier of unobstructed or obstructed, and if it is an obstructed state, the identifier information of the shielding element is also extracted. The extracted information is sorted according to the identifier of the scene element to form a structured data set, which is convenient for subsequent analysis of the light influence mode of the scene element under different atmosphere types.

[0037] Step S123: analyze the state change types that the scene dynamic role element may appear, including position change of the scene dynamic role element, action posture change of the scene dynamic role element, appearance change of the scene dynamic role element, the position change includes short distance movement and long distance movement, the action posture change includes limb action change and facial expression change, and the appearance change includes clothing color change and carrying prop change.

[0038] The state change types that the scene dynamic role element may appear are analyzed. The position change refers to the change of the spatial position of the role in the scene, the short distance movement refers to the position adjustment of the role in a small range, for example, the body of the main role moves forward and backward on the seat; the long distance movement refers to the position transfer of the role in a large range in the scene, for example, from one area of the scene to another area. The action posture change refers to the change of the body posture and action of the role, the limb action change includes the action of the arms, legs, trunk and other parts, for example, the action of the main role lifting the hand to take something; the facial expression change includes the shape change of the facial features, for example, the expressions of the main role such as surprise and smile. The appearance change refers to the change of the external image characteristics of the role, the clothing color change refers to the change of the color of the clothing worn by the role, which may be due to the need of the plot or the influence of the environment; the carrying prop change refers to the change of the type or state of the prop carried by the role, for example, from empty hands to holding a certain prop, or the prop changes from the closed state to the open state.

[0039] Step S124: For each state change type of the scene dynamic role element, combine the node attribute information and the light and shadow correlation degree information in the scene element light and shadow correlation graph to determine the range of affected scene elements corresponding to the state change type, and filter the affected scene elements from high to low according to the light and shadow correlation degree information, and the filtering process continues until the light and shadow correlation degree is lower than a preset correlation threshold. The range of affected scene elements includes scene elements directly affected by the state change and scene elements indirectly affected by the state change. The directly affected scene elements are the scene elements with the highest light and shadow correlation degree with the scene dynamic role element, and the indirectly affected scene elements are the scene elements that have light and shadow correlation with the directly affected scene elements.

[0040] For each state change type of the scene dynamic role element, combine the node attribute information and the light and shadow correlation degree information in the scene element light and shadow correlation graph to determine the range of affected scene elements. First, for the position change type, when the main role element moves a long distance, according to its new position after moving, find the scene elements within a certain range centered on the role in the scene element light and shadow correlation graph. These elements may be directly affected by the light and shadow changes caused by the movement of the role. Then, according to the light and shadow correlation degree information, filter the above elements from high to low, and preset a correlation threshold. When the light and shadow correlation degree is lower than the threshold, stop filtering. The directly affected scene elements are the elements with the highest light and shadow correlation degree with the scene dynamic role element, for example, the bottom support structure (ground) under the standing position of the role after moving. This element has the highest light and shadow correlation degree with the role and belongs to the directly affected element. The indirectly affected scene elements are the elements that have light and shadow correlation with the directly affected scene elements, for example, the furniture and the object plane around the ground. They have light and shadow correlation with the ground, and when the light and shadow of the ground changes due to the movement of the role, these elements will be indirectly affected.

[0041] Step S125: For each affected scene element in the range of affected scene elements, combine the reference light and shadow characteristics of different atmosphere types to determine the light and shadow adjustment dimension corresponding to the affected scene element. The light and shadow adjustment dimension includes light and shadow illumination intensity adjustment, light and shadow illumination range adjustment, light and shadow color attribute adjustment, light and shadow contrast adjustment, and shadow softness adjustment.

[0042] For each affected scene element within the affected scene element range, the corresponding light and shadow adjustment dimension is determined in combination with the reference light and shadow characteristics of different atmosphere types. For example, under the daily activity atmosphere, when the main character element changes in body movement (such as lifting hands to take things), the directly affected prop element (such as the object on the object plane) needs to be adjusted in light and shadow. According to the reference light and shadow characteristics of the daily activity atmosphere, the overall illumination intensity range is moderate, the main color tone range is warm color system, the light and shadow contrast range is moderate, and the shadow softness parameter is moderate. Therefore, the light and shadow adjustment dimension of the prop element may include illumination intensity adjustment, so that the illumination intensity slightly increases under the influence of character action; illumination range adjustment, adjusting the illumination range of light and shadow according to the amplitude of character action; color attribute adjustment, making the color more consistent with the main color tone range of warm color system; contrast adjustment, keeping in the moderate contrast range; shadow softness adjustment, maintaining the moderate shadow softness parameter. For different atmosphere types and affected scene elements, the corresponding adjustment dimension combination needs to be determined according to the specific reference light and shadow characteristics.

[0043] Step S126: For each atmosphere type, a corresponding relationship between scene dynamic character element state change type and affected scene element light and shadow adjustment mode is established, the light and shadow adjustment mode including adjustment dimension, adjustment direction and adjustment basis, the adjustment basis being an adjustment amplitude coefficient determined based on scene element light and shadow correlation degree, the higher the light and shadow correlation degree, the larger the adjustment amplitude coefficient.

[0044] For each atmosphere type, a corresponding relationship between scene dynamic character element state change type and affected scene element light and shadow adjustment mode is established. For each atmosphere type, all scene dynamic character element state change types are traversed, and for each affected scene element under each state change type, its light and shadow adjustment mode is determined. The adjustment dimension is the illumination intensity, illumination range, color attribute, contrast, shadow softness and the like determined before; the adjustment direction is determined according to the type of state change and the demand of atmosphere type, for example, the character moves to a region with stronger illumination, the illumination intensity adjustment direction of the affected element is increase, and vice versa; the adjustment basis is set as an adjustment amplitude coefficient determined based on scene element light and shadow correlation degree, the higher the light and shadow correlation degree of the affected scene element, the larger the adjustment amplitude coefficient, i.e. the larger the adjustment amount of light and shadow parameters. The above corresponding relationship is arranged into rule entries, each rule entry containing atmosphere type, state change type, affected scene element identifier, adjustment dimension, adjustment direction and adjustment amplitude coefficient, forming a complete light and shadow dynamic response rule set.

[0045] Step S130: According to the light and shadow dynamic response rule, the scene element state data of the current frame of the animation scene and the current atmosphere type identifier are combined to generate an initial light and shadow rendering scheme, the scene element state data includes position distribution information of scene static structure elements and action posture information of scene dynamic role elements, and the initial light and shadow rendering scheme includes basic light and shadow parameters of each scene element and atmosphere adaptation parameters.

[0046] According to the generated light and shadow dynamic response rule, the scene element state data of the current frame of the animation scene and the current atmosphere type identifier are combined to generate an initial light and shadow rendering scheme. The scene element state data provides specific state information of each scene element in the current frame, including the position distribution of scene static structure elements and the action posture of scene dynamic role elements, and the current atmosphere type identifier indicates the atmosphere type to be adopted in the current scene. By matching the above information with the light and shadow dynamic response rule, the light and shadow parameters of each scene element under the current state and atmosphere are determined, so as to generate an initial light and shadow rendering scheme, which includes the basic light and shadow parameters of each scene element and the atmosphere adaptation parameters for adapting to the current atmosphere.

[0047] Step S131: Analyzing the scene element state data of the current frame of the animation scene, extracting the position distribution information of the scene static structure elements and the action posture information of the scene dynamic role elements, the position distribution information including the spatial coordinates and relative layout relationship of each scene static structure element, and the action posture information including the limb angle, joint position and motion trend of the scene dynamic role elements.

[0048] The scene element state data of the current frame of the animation scene is analyzed, and the scene element state data is stored in a structured format and includes the current state information of all elements in the scene. For scene static structure elements, the position distribution information is extracted, and the position distribution information is represented by the spatial coordinates of each element in the three-dimensional coordinate system of the scene, and each element has a set of unique coordinate values to determine its position. At the same time, the relative layout relationship between elements is extracted, and the relative layout relationship is calculated by the difference between the coordinates of each element, such as the vertical distance between the top structure and the bottom support structure in the building component, and the relative position between the storage structure and the seat in the prop element. For scene dynamic role elements, the action posture information is extracted, the limb angle is represented by the included angle between each limb part and the trunk, such as the horizontal and vertical included angles between the arm and the trunk; the joint position is represented by the coordinates of the joint in the three-dimensional coordinate system, such as the coordinates of the shoulder joint, elbow joint, knee joint, etc.; and the motion trend is calculated according to the change of joint position in continuous multiple frames, which is used to judge the direction and speed of the role action.

[0049] Step S132: According to the scene element state data of the current frame, compare the scene element state data of the previous frame to determine whether the scene dynamic role element has a state change. If the scene dynamic role element has a state change, determine the state change type corresponding to the specific manifestation of the state change. If the scene dynamic role element does not have a state change, use the corresponding state change type of the previous frame and mark it as no change.

[0050] Compare the scene element state data of the current frame with the scene element state data of the previous frame, and focus on comparing the state information of the scene dynamic role element. During the comparison process, first compare the action posture information of the main role element, check whether the limb angle, joint position has changed, and whether the movement trend exists; then compare the position distribution information and action posture information of the secondary role element and the temporarily appearing role element. If the position distribution, action posture and other information of the scene dynamic role element changes compared with the previous frame, it is determined that there is a state change. According to the specific manifestation of the state change, determine the corresponding state change type, for example, if the joint position of the main role element moves in a large range and the spatial coordinate changes greatly, it is determined as long distance movement in position movement change; if only the limb angle changes and the position coordinate changes little, it is determined as limb movement change in action posture change. If the state information of the scene dynamic role element does not change compared with the previous frame, use the corresponding state change type of the previous frame and mark it as no change in the current frame.

[0051] Step S133: Obtain the current atmosphere type identifier of the current frame of the animation scene, and according to the current atmosphere type identifier, retrieve the light and shadow adjustment rule subset under the corresponding atmosphere type from the light and shadow dynamic response rule. The rule subset includes the affected scene element range and light and shadow adjustment mode corresponding to all state change types under the atmosphere type.

[0052] Obtain the current atmosphere type identifier of the current frame of the animation scene, which is determined by the plot development of the scene, for example, if the current frame plot is daily reading, the atmosphere type identifier is daily activity atmosphere. According to the identifier, query in the light and shadow dynamic response rule to find all rule entries corresponding to the atmosphere type, which constitute a light and shadow adjustment rule subset. The light and shadow adjustment rule subset includes the affected scene element range and light and shadow adjustment mode corresponding to all possible scene dynamic role element state change types under the atmosphere type, for example, under the daily activity atmosphere, the affected scene element range corresponding to the short distance movement state change type of the main role element includes surrounding furniture and object placing plane, and the light and shadow adjustment mode includes small amplitude adjustment of illumination intensity, local adjustment of illumination range, etc.

[0053] Step S134: According to the determined state change type, find the corresponding affected scene element range and the light and shadow adjustment dimension, adjustment direction and adjustment amplitude coefficient of each affected scene element from the rule subset.

[0054] According to the previously determined state change type of the scene dynamic role element, search in the retrieved light and shadow adjustment rule subset. In the search process, use the state change type as the index to match the corresponding rule entry in the rule subset. After finding the matched rule entry, extract the affected scene element range, i.e. all scene elements that need to be adjusted in light and shadow under this state change type. At the same time, extract the light and shadow adjustment dimension (such as illumination intensity, color attribute, etc.), adjustment direction (increase or decrease, bias to a certain color, etc.) and adjustment amplitude coefficient of each affected scene element. The adjustment amplitude coefficient is determined according to the light and shadow correlation degree of the scene element. The higher the correlation degree, the larger the coefficient. For example, if the state change type is the change of the main role element's limb movement (lifting hands to take something), find the corresponding affected scene element from the rule subset, which is a specific object on the object plane. Its light and shadow adjustment dimension is illumination intensity and shadow softness, the adjustment direction is to increase the illumination intensity and improve the shadow softness, and the adjustment amplitude coefficient is determined according to the light and shadow correlation degree of the object and the main role element.

[0055] Step S135: For each affected scene element, first determine the basic light and shadow parameter of the affected scene element according to the light and shadow attribute of the affected scene element and the reference light and shadow characteristics of the current atmosphere type. The basic light and shadow parameter includes basic illumination intensity, basic illumination range, basic color attribute, basic contrast, and basic shadow softness.

[0056] For each affected scene element, determine its base lighting parameters. First, obtain the lighting properties of the affected scene element, including reflection characteristics, absorption characteristics, and emission characteristics (if any). Then, combine the reference lighting characteristics of the current atmosphere type, such as the overall lighting intensity range, the dominant color range, etc. The determination of the base illumination intensity: for an affected scene element that does not emit light itself, calculate the base illumination intensity based on the overall lighting intensity range of the current atmosphere type and the reflection characteristics of the element. The higher the reflection ratio, the higher the base illumination intensity. For an element that emits light itself, adjust the base illumination intensity based on the self-emission intensity in its emission characteristics and the overall lighting intensity range of the atmosphere type, ensuring that it does not exceed the lighting range of the atmosphere type. The base illumination range is determined based on the size of the element and its position in the scene. The larger the size and the more central the position, the larger the illumination range. The base color property is determined based on the dominant color range of the atmosphere type and the absorption characteristics of the element. The lower the absorption ratio of the element to the wavelength of light within the dominant color range, the closer the base color property to the dominant color. The base contrast refers to the lighting contrast range of the atmosphere type, combined with the reflection and absorption characteristics of the element. The greater the difference between reflection and absorption, the higher the contrast. The base shadow softness directly adopts the shadow softness parameter of the current atmosphere type.

[0057] Step S136: Combine the position distribution information of the scene static structure elements, analyze the spatial position relationship between the affected scene element and other surrounding scene elements. If there is an occlusion relationship, preliminarily correct the base lighting parameters according to the occlusion degree, and reduce the base illumination intensity when there is occlusion.

[0058] Combine the position distribution information of the scene static structure elements, analyze the spatial position relationship between the affected scene element and other surrounding scene elements. By comparing the spatial coordinates and geometric dimensions of each element, determine whether there is an occlusion relationship, i.e., whether the surrounding other scene elements are located between the affected scene element and the light source. If there is an occlusion relationship, preliminarily correct the base lighting parameters according to the occlusion degree obtained before. For the base illumination intensity, the higher the occlusion degree, the more the corrected illumination intensity is reduced, and the reduction amplitude is proportional to the occlusion degree. For example, if the affected scene element is partially occluded by a scene element with a medium occlusion degree, multiply its base illumination intensity by a medium correction coefficient (less than 1) to obtain the preliminarily corrected illumination intensity. For the illumination range, if there is occlusion, trim the illumination range of the affected scene element according to the position and size of the occluded element, and remove the occluded area.

[0059] Step S137: Adjust the preliminary corrected basic light and shadow parameter according to the adjustment amplitude coefficient and adjustment direction corresponding to the affected scene element, to obtain the initial light and shadow parameter corresponding to the affected scene element, which includes initial irradiation intensity parameter, initial irradiation range parameter, initial color attribute parameter, initial contrast parameter, and initial shadow softness parameter.

[0060] Adjust the preliminary corrected basic light and shadow parameter according to the adjustment amplitude coefficient and adjustment direction corresponding to the affected scene element. For the initial irradiation intensity parameter, if the adjustment direction is increase, add the product of the adjustment amplitude coefficient and the basic irradiation intensity to the preliminary corrected irradiation intensity; if the adjustment direction is decrease, subtract the product. For the initial irradiation range parameter, calculate the change amount of the irradiation range according to the adjustment direction (expansion or contraction) and the adjustment amplitude coefficient, for example, multiply the adjustment amplitude coefficient by the basic irradiation range to obtain the change amount, and then add (expand) or subtract (contract) the preliminary corrected irradiation range. For the initial color attribute parameter, according to the adjustment direction (towards a certain color) and the adjustment amplitude coefficient, offset the preliminary corrected color attribute within the dominant color range, the greater the adjustment amplitude coefficient, the greater the offset. The adjustment of the initial contrast parameter is similar, according to the adjustment direction (increase or decrease) and the adjustment amplitude coefficient, increase or decrease the preliminary corrected contrast. The initial shadow softness parameter is adjusted according to the adjustment direction and the adjustment amplitude coefficient, based on the atmosphere type reference shadow softness parameter, to obtain the final initial light and shadow parameter.

[0061] Step S138: Integrate the identification information and corresponding initial light and shadow parameter of all affected scene elements to generate an initial light and shadow rendering scheme, which also contains parameter adjustment basis description, which specifies the light and shadow dynamic response rule item corresponding to each initial light and shadow parameter adjustment and scene element light and shadow association graph node reference.

[0062] Integrate the identification information and corresponding initial light and shadow parameter of all affected scene elements, and arrange them according to the type and hierarchical order of the scene elements. Create a parameter record for each affected scene element, including element identification, initial irradiation intensity parameter, initial irradiation range parameter, initial color attribute parameter, initial contrast parameter, and initial shadow softness parameter. At the same time, generate a parameter adjustment basis description, which specifies the light and shadow dynamic response rule item number corresponding to each initial light and shadow parameter adjustment, and the node identification referenced in the scene element light and shadow association graph, for example, the irradiation intensity adjustment of a certain element is based on the Xth rule in the rule set, and references the association relationship between node A and node B in the graph. Combine the above information to form a complete initial light and shadow rendering scheme.

[0063] Step S140: Based on the scene element light shadow correlation graph, the interaction influence between the light shadow effects corresponding to each scene element in the initial light shadow rendering scheme is analyzed, including direct light shadow interference and indirect light shadow interference, to obtain a light shadow interaction influence result, which includes an interference source identifier, a disturbed element identifier, and an interference transmission path.

[0064] Based on the scene element light shadow correlation graph, the interaction influence between the light shadow effects corresponding to each scene element in the initial light shadow rendering scheme is analyzed. The interaction influence includes two types of direct light shadow interference and indirect light shadow interference. The direct light shadow interference is the interference generated by the direct action of the light shadow effect of one scene element on another element, and the indirect light shadow interference is the interference generated after transmission through an intermediate element. By analyzing these interferences, the interference source, the disturbed element, and the interference transmission path are determined to form a light shadow interaction influence result.

[0065] Step S141: Extract the initial light shadow parameters corresponding to each affected scene element from the initial light shadow rendering scheme, and simulate the initial light shadow effect of each affected scene element in the current frame scene according to the initial light shadow parameters, including the distribution range, intensity decay law, and color change trend of the light shadow emitted or reflected by the affected scene element in space.

[0066] The initial light shadow parameters corresponding to each affected scene element are extracted from the initial light shadow rendering scheme, including initial illumination intensity, initial illumination range, initial color attribute, etc. According to these initial light shadow parameters, the initial light shadow effect of each affected scene element is simulated using light shadow simulation algorithms. For the affected scene elements that emit light themselves (such as lamps), the distribution range of the light shadow emitted by them in space is simulated, which is determined according to the initial illumination range parameter and presented as a specific shape region centered on the light source. The intensity decay law is calculated according to the initial illumination intensity and the distance from the light source. The farther the distance, the more the intensity decays, and the decay law conforms to a specific physical model. The color change trend is simulated according to the initial color attribute parameter and the interaction with air or other media during light propagation, which may have slight color shift. For the affected scene elements that do not emit light but reflect light (such as furniture and character costumes), the reflected light shadow effect is simulated, and the distribution range, intensity decay, and color change of the reflection are determined according to the reflection characteristic parameters and the parameters of the incident light shadow.

[0067] Step S142: Based on the scene element light shadow association graph, find the corresponding associated scene elements of each affected scene element. The associated scene elements refer to the scene elements that have a light shadow association relationship with the affected scene element. According to the light shadow association degree from high to low, a list of associated scene elements is obtained, and the light shadow propagation path information between the associated scene elements is extracted, including the path unobstructed state and the occlusion element identifier.

[0068] Based on the scene element light shadow association graph, find the corresponding associated scene elements of each affected scene element. The associated scene elements refer to the scene elements that have a light shadow association relationship with the affected scene element. In the graph, the associated scene elements are connected to the affected scene element through connection edges. In the finding process, the affected scene element is taken as the center node, and all nodes connected to the node through connection edges in the graph are traversed. These nodes are the associated scene elements. Then, according to the light shadow association degree attribute on the connection edge, the associated scene elements are sorted from high to low to form a list of associated scene elements. At the same time, the light shadow propagation path information between each associated scene element and the affected scene element is extracted, including the unobstructed state of the path (unobstructed or obstructed) and the occlusion element identifier. The above information is stored together with the list of associated scene elements for subsequent light shadow interference analysis.

[0069] Step S143: Analyze the direct light shadow interference of the initial light shadow effect of each affected scene element on its associated scene elements. The direct light shadow interference refers to the interference caused by the direct action of the light shadow of the affected scene element on the associated scene elements. The direct light shadow interference specifically includes the intensity change, color change, contrast change, and shadow shape change of the original light shadow effect of the associated scene elements caused by the initial light shadow effect. For each change, the specific performance and impact range of the change are recorded.

[0070] The direct light and shadow interference of the initial light and shadow effect of each affected scene element on its associated scene element is analyzed. For each affected scene element, the elements in its associated scene element list are checked in turn. When the initial light and shadow effect of the affected scene element directly acts on the associated scene element, it causes the original light and shadow effect of the associated scene element to change. The intensity change is manifested as an increase or decrease in the light intensity received by the associated scene element, for example, the affected scene element is a light emitting lamp, and its initial light and shadow effect irradiates the associated seat, causing the light intensity of the seat to increase. The color change is manifested as the color of the associated scene element changing due to the color attribute of the incident light and shadow, for example, a red light source irradiates a white seat, causing the surface of the seat to present a red tone. The contrast change is manifested as an increase or decrease in the difference between the bright part and the dark part of the associated scene element, for example, strong light irradiation makes the bright part of the associated element brighter and the dark part darker, resulting in an increase in contrast. The shadow morphology change is manifested as the shadow of the associated scene element changing in shape, size or edge definition due to the change in direction and intensity of the incident light and shadow. For each change, the specific performance of the change is recorded, such as the percentage of intensity increase, the specific color value of color change, the numerical value of contrast change, and the specific description of shadow morphology change, and the range of change influence, i.e. the affected area on the associated scene element.

[0071] Step S144: According to the hierarchical relationship and light and shadow propagation path in the scene element light and shadow association graph, indirect light and shadow interference is analyzed, which refers to the interference generated by the light and shadow of the affected scene element acting on the intermediate scene element first and then being transmitted to the target associated scene element through the intermediate scene element. The intermediate scene element is first determined, then the effect of the initial light and shadow effect on the intermediate scene element is simulated, and then the light and shadow influence of the target associated scene element is analyzed, and the transmission path of the indirect interference, the interference change of each transmission node and the light and shadow change of the final target associated scene element are recorded.

[0072] According to the hierarchical relationship and light and shadow propagation path in the light and shadow association graph of the scene elements, indirect light and shadow interference is analyzed. First, intermediate scene elements are determined, which are scene elements located between the affected scene elements and the target associated scene elements and having light and shadow association relationship with both. By querying the light and shadow association graph of the scene elements, the associated scene elements of the affected scene elements are found, and then the elements having association relationship with other associated scene elements are found from the associated scene elements, which are the intermediate scene elements. Then, the effect of the initial light and shadow on the intermediate scene elements is simulated, and the process is similar to the analysis of direct light and shadow interference, the irradiation intensity change, color mixing result and the like of the intermediate scene elements are calculated. Then, the light and shadow effect of the intermediate scene elements after being affected is taken as a new light and shadow source, the light and shadow influence of the intermediate scene elements on the target associated scene elements (i.e. the elements having association relationship with the intermediate scene elements and not the initial affected scene elements) is analyzed, and the change of the light and shadow parameters of the target associated scene elements is also calculated. The transmission path of the indirect interference is recorded, i.e. the element identification sequence of the affected scene elements→the intermediate scene elements→the target associated scene elements; the interference change of each transmission node (the intermediate scene elements) is recorded, such as the light and shadow parameter change of the intermediate scene elements; and the light and shadow change of the final target associated scene elements is recorded, such as the specific change of the irradiation intensity, color and the like.

[0073] Step S145: For each light and shadow interference, the interference degree is calculated, which is used to quantify the severity of the light and shadow interference. In the calculation process, the interference sensitivity is first determined according to the light and shadow attributes of the associated scene elements, different associated scene elements have different interference sensitivity to the light and shadow change, and the interference sensitivity of the core scene elements is higher than that of the background scene elements. Then, the interference degree value is obtained according to the product of the amplitude of the light and shadow change and the interference sensitivity, and the higher the interference degree value, the more serious the light and shadow interference.

[0074] For each light and shadow interference (including direct light and shadow interference and indirect light and shadow interference), the interference degree is calculated. First, the interference sensitivity is determined according to the light and shadow properties of the associated scene elements, which is the sensitivity of the associated scene elements to light and shadow changes, and the interference sensitivity of different types and levels of associated scene elements is different. The interference sensitivity of the core scene elements is set to the highest because they are the visual focus; the secondary scene elements are next; and the background scene elements are the lowest. At the same time, the material characteristics of the associated scene elements are considered, for example, the interference sensitivity of elements with high light-reflecting materials is higher than that of elements with low light-reflecting materials. The interference sensitivity is represented by a specific numerical range, and the numerical range of the interference sensitivity of the core scene elements is higher than that of the secondary and background scene elements. Then, the magnitude of the light and shadow change is calculated. For illumination intensity change, the magnitude is the ratio of the absolute value of the illumination intensity change to the reference illumination intensity; for color change, the magnitude is the difference value of the mixed color (such as the square root of the sum of the square of the RGB channel difference); for contrast change, the magnitude is the ratio of the absolute value of the contrast change to the reference contrast; for shadow change, the magnitude is the comprehensive evaluation index of the shadow form change (such as the area change rate, edge definition change, etc.). The total light and shadow change magnitude is obtained by weighted sum of each light and shadow change magnitude, and the weight is set according to the influence degree of each change on the visual effect. Finally, the total light and shadow change magnitude is multiplied by the interference sensitivity to obtain the interference degree value, and the higher the interference degree value, the more serious the influence of the light and shadow interference on the associated scene elements.

[0075] Step S146: Record the interference source identifier, the interfered element identifier, the interference type, the interference transmission path, the interference specific performance and the interference degree value corresponding to each light and shadow interference.

[0076] The detailed information of each light and shadow interference is recorded, including the interference source identifier, i.e. the identifier of the affected scene element that generates the light and shadow interference; the interfered element identifier, i.e. the identifier of the associated scene element that is interfered; the interference type, marked as direct light and shadow interference or indirect light and shadow interference; the interference transmission path, for direct interference, the direct path from the interference source to the interfered element, for indirect interference, the path sequence containing intermediate elements; the interference specific performance, i.e. the specific change description recorded before, such as illumination intensity change, color mixing result, etc.; the interference degree value, i.e. the quantitative interference degree value calculated. The above information is stored in a structured record, and each record corresponds to one light and shadow interference.

[0077] Step S147: Classify and arrange all light and shadow interference records, sort them from high to low according to the interference degree value, and group them according to the level identifier of the interfered element. The light and shadow interference records corresponding to the core scene elements are prioritized, and the light and shadow interaction influence result is generated, which also contains the scene element light and shadow association graph nodes referenced by the interference analysis and the initial light and shadow effect simulation basis.

[0078] All light and shadow interference records are sorted and arranged. First, the records are sorted in descending order of interference degree value, so that serious interference is placed first. Then, the records are grouped according to the hierarchical identification of the interfered elements, and the interference records of the core scene elements are grouped into one group, the interference records of the secondary scene elements are grouped into one group, and the interference records of the background scene elements are grouped into one group. In sorting, the light and shadow interference records corresponding to the core scene elements are given priority over other hierarchical records, that is, when the interference degree value of the core scene elements is similar to that of the secondary or background elements, the records of the core scene elements are placed first. Finally, a light and shadow interaction influence result is generated, which includes the sorted and grouped light and shadow interference records, as well as the scene element light and shadow association graph node identification (such as the involved element nodes and connection edges) cited in the interference analysis process and the initial light and shadow effect simulation basis (such as the used light and shadow simulation algorithm version, parameter setting, etc.).

[0079] Step S150: According to the light and shadow interaction influence result, the light and shadow parameters in the initial light and shadow rendering scheme are optimized by using a multi-round iterative adjustment method to generate a final light and shadow rendering scheme, and the final light and shadow rendering scheme is applied to the rendering processing of the current frame of the animation scene.

[0080] According to the light and shadow interaction influence result, the light and shadow parameters in the initial light and shadow rendering scheme are optimized by using a multi-round iterative adjustment method to reduce or eliminate light and shadow interference, to generate a final light and shadow rendering scheme, and to apply the scheme to the rendering processing of the current frame of the animation scene, to obtain a current frame image that meets the expected light and shadow effect.

[0081] Step S151: Analyze the light and shadow interaction influence result, extract all light and shadow interference records, sort them in descending order of interference degree value, and group them according to the hierarchical identification of the interfered elements. The light and shadow interference records corresponding to the core scene elements are given the first priority, the light and shadow interference records corresponding to the secondary scene elements are given the second priority, and the light and shadow interference records corresponding to the background scene elements are given the third priority. Determine the first round of adjustment interference objects as the first N light and shadow interference records with the highest interference degree value in the first priority, and set the value of N according to the complexity of the scene.

[0082] The light and shadow interaction result is analyzed, and the light and shadow interaction result is stored in a structured format, including all light and shadow interference records and related reference information. All light and shadow interference records are extracted, sorted in descending order of interference degree value, and a preliminary sorted list is obtained. Then, the sorted records are grouped according to the level identification of the interfered elements. The light and shadow interference records corresponding to the core scene elements are the first priority group, the secondary scene elements are the second priority group, and the background scene elements are the third priority group. Within each group, the records remain in order from high to low according to the interference degree value. The interference objects of the first round of adjustment are determined by selecting the top N light and shadow interference records with the highest interference degree value from the first priority group. The value of N is set according to the complexity of the scene. When the number of elements in the scene is large and the light and shadow relationship is complex, the value of N can be set larger to handle more serious interference. When the scene is simple, the value of N can be smaller.

[0083] Step S152: For each light and shadow interference record of the first round of adjustment, determine the interference source and the corresponding initial light and shadow parameters, analyze the specific parameter items in the initial light and shadow parameters that cause light and shadow interference, and determine the adjustment direction of the parameter items based on the interference degree value.

[0084] For each light and shadow interference record of the first round of adjustment, the interference source is first determined, i.e. the interference source identification in the record corresponds to the affected scene element. Then, the initial light and shadow parameters corresponding to the interference source are extracted from the initial light and shadow rendering scheme. Analyze the specific parameter items in these initial light and shadow parameters that cause light and shadow interference, for example, if the interference is caused by too high illumination intensity causing the interfered element to be too bright, the parameter item causing the interference is the initial illumination intensity; if the interference is caused by color deviation, the parameter item is the initial color attribute. The adjustment direction of the parameter item is determined based on the interference degree value. The higher the interference degree value, the more explicit the adjustment direction, for example, the adjustment direction for interference caused by too high illumination intensity is to reduce the initial illumination intensity; the adjustment direction for interference caused by red color deviation is to reduce the value of the red channel.

[0085] Step S153: Determine the adjustment amplitude of the parameter item according to the mapping relationship between the interference degree value and the parameter adjustment amplitude, which is established through pre-scene testing. The higher the interference degree value, the larger the adjustment amplitude. The adjustment amplitude does not exceed the range of the current atmosphere type reference light and shadow characteristics.

[0086] According to the mapping relationship between the interference degree value and the parameter adjustment amplitude, the adjustment amplitude of the parameter item is determined. The mapping relationship is established through the pre-scene test. When testing, the improvement effect of the parameter adjustment amplitude on the interference under different interference degree values is simulated, so as to determine the functional relationship between the two. Generally speaking, the higher the interference degree value, the larger the parameter adjustment amplitude, that is, the larger the adjustment amount. At the same time, the adjustment amplitude is limited by the reference light and shadow feature range of the current atmosphere type, for example, the adjustment amplitude of the initial irradiation intensity cannot make the adjusted irradiation intensity exceed the overall illumination intensity range of the current atmosphere type, so as to ensure that the adjusted light and shadow effect still meets the atmosphere requirements.

[0087] Step S154: Based on the determined adjustment direction and adjustment amplitude, the target parameter item in the initial light and shadow parameter of the interference source is adjusted to obtain the first round of adjusted light and shadow parameter, and the parameter values before and after adjustment, adjustment basis are recorded.

[0088] Based on the determined adjustment direction and adjustment amplitude, the target parameter item in the initial light and shadow parameter of the interference source is adjusted. For example, the target parameter item is the initial irradiation intensity, the adjustment direction is to reduce, and the adjustment amplitude is a specific value, then the initial irradiation intensity is reduced by the adjustment amplitude to obtain the adjusted irradiation intensity. For color attribute parameters, if the adjustment direction is to reduce the red channel value, and the adjustment amplitude is a specific value, then the red channel value is reduced by the adjustment amplitude. After adjustment, the parameter values before and after adjustment are recorded, such as the initial irradiation intensity before adjustment and the adjusted irradiation intensity; the adjustment basis is recorded, including the corresponding light and shadow interference record identifier, the interference degree value, the reference of the mapping relationship, etc.

[0089] Step S155: The first round of adjusted light and shadow parameter is substituted into the scene light and shadow effect simulation model, the light and shadow effect of the interference source is simulated again, the interference degree of the light and shadow effect on the original associated scene element is analyzed, if the adjusted interference degree value is lower than the preset interference threshold, the parameter adjustment of the interference source is completed; if the adjusted interference degree value is still higher than the preset interference threshold, the above adjustment step is repeated, and the repeating process continues until the interference degree value is lower than the preset interference threshold or the preset iteration number is reached. The preset iteration number is set according to the rendering efficiency requirement.

[0090] The first round of adjusted light and shadow parameters are substituted into the scene light and shadow effect simulation model, which is the same as the model used to simulate the initial light and shadow effect. The light and shadow effect of the interference source is simulated again, and the interference degree of the new light and shadow effect on the original associated scene elements (i.e. the disturbed elements in the light and shadow interference record) is analyzed. The calculation method is the same as before. A preset interference threshold is set according to the acceptable light and shadow interference degree. If the adjusted interference degree value is lower than the interference threshold, it is considered that the parameter adjustment of the interference source is complete. If it is still higher than the interference threshold, the adjustment process of steps S152 to S154 is repeated, that is, the parameter items are reanalyzed, the adjustment direction and amplitude are determined, and the adjustment is performed until the interference degree value is lower than the threshold or the preset iteration number is reached. The preset iteration number is set according to the rendering efficiency requirement. Too many times will increase the rendering time, and too few times may not be able to optimize sufficiently, so a balance between effect and efficiency needs to be struck.

[0091] Step S156: After completing the first round of adjustment, enter the second round of adjustment. The first M light and shadow interference records with the highest interference degree value in the second priority group (light and shadow interference records corresponding to secondary scene elements) are taken as the adjustment object. The value of M is set according to the remaining scene complexity. The same adjustment logic as the first round is used to analyze the interference source parameters, determine the adjustment direction and amplitude, perform the adjustment and analyze the effect.

[0092] After completing the first round of adjustment, enter the second round of adjustment. The first M light and shadow interference records with the highest interference degree value in the second priority group (light and shadow interference records corresponding to secondary scene elements) are taken as the adjustment object. The value of M is set according to the remaining scene complexity. The value of M can be less than N if the remaining interference is less and the scene complexity is reduced after the first round of adjustment. The same adjustment logic as the first round is used, that is, the interference source and parameters are determined, the adjustment direction and amplitude are analyzed, the adjustment is performed, the effect is simulated and the interference degree is checked, until the adjustment of the above M records is completed.

[0093] Step S157: The interference source parameter adjustment corresponding to all light and shadow interference records is completed in order according to the priority order. For light and shadow interference records that still cannot reduce the interference degree value below the preset interference threshold after multiple iterations, it is analyzed whether there is a scene element light and shadow association graph construction deviation. If there is a scene element light and shadow association graph construction deviation, the light and shadow association degree or propagation path information in the scene element light and shadow association graph is corrected, and the interference analysis and parameter adjustment are performed again.

[0094] Adjust the interference source parameters corresponding to all light-shadow interference records in priority order (first priority -> second priority -> third priority). For the light-shadow interference records of the third priority group, the same adjustment method is adopted. During the adjustment process, for the light-shadow interference records that still cannot reduce the interference degree value below the preset interference threshold after multiple rounds of iteration (reach the preset number of iterations), analyze the reasons. One of the possible reasons is that there is a deviation in the construction of the scene element light-shadow association graph, such as inaccurate light-shadow association degree calculation or incorrect propagation path state marking. If it is judged that there is a deviation in the graph construction, the corresponding information in the scene element light-shadow association graph is corrected, such as recalculating the light-shadow association degree, correcting the unobstructed state of the propagation path, or identifying the obstructing elements. After correction, the light-shadow interference analysis (repeat steps S140 to S147) and parameter adjustment (repeat steps S151 to S156) are performed again.

[0095] Step S158: Collect the final light parameters corresponding to all adjusted interference sources. For the affected scene elements not involved in light interference, keep their initial light parameters unchanged.

[0096] Collect the final light parameters corresponding to all adjusted interference sources. These parameters are the light parameters that have been adjusted for multiple rounds of iteration and have an interference degree value below the preset threshold. For the affected scene elements not involved in light interference in the initial light rendering scheme (i.e., the affected elements not appearing in any light interference record), their initial light parameters do not need to be adjusted and remain unchanged.

[0097] Step S159: Integrate all final light parameters of the affected scene elements or the unchanged initial light parameters, and add a parameter adjustment summary table containing the adjustment times, before and after values, adjustment basis, and final interference degree value of each parameter to generate a final light rendering scheme. The final light rendering scheme also includes key simulation result screenshot reference identifiers in the iteration adjustment process.

[0098] Integrate all final light parameters of the affected scene elements (adjusted) or the unchanged initial light parameters, arrange them according to the same structure as the initial light rendering scheme, and include element identifiers and various light parameters. At the same time, add a parameter adjustment summary table that records the adjustment times (iteration times), initial value before adjustment, final value after adjustment, adjustment basis (such as corresponding light interference record identifier, adjustment round), and final interference degree value for each adjusted parameter item (unadjusted parameter items do not need to be included). Combine the above information to generate a final light rendering scheme. In addition, add key simulation result screenshot reference identifiers in the iteration adjustment process to the scheme. These screenshots record important changes in light effects during the adjustment process, and through the reference identifier, they can be linked to specific screenshot files.

[0099] For example, step S1510: analyze the final light shadow rendering scheme, extract the final light shadow parameters of each affected scene element, the extracted final light shadow parameters include illumination intensity, color attribute, contrast, shadow parameter and associated scene element identifier, and extract the parameter adjustment summary table and iteration adjustment basis in the final light shadow rendering scheme.

[0100] Analyze the final light shadow rendering scheme, which is stored in a structured format. Extract the final light shadow parameters of each affected scene element, including illumination intensity, color attribute, contrast, shadow parameter (such as shadow softness, shadow range, etc.) and associated scene element identifier, to ensure that each parameter is correctly associated with the element. At the same time, extract the parameter adjustment summary table in the scheme, which contains detailed historical information of parameter adjustment; extract the iteration adjustment basis, including the light shadow interaction effect result identifier cited in the adjustment process, scene element light shadow association graph correction record, etc.

[0101] Step S1511: import the scene model data of the current frame of the animation scene into the rendering engine, which contains the geometric model, material information and initial position information of all scene elements.

[0102] Import the scene model data of the current frame of the animation scene into the rendering engine, which is stored in a specific three-dimensional model format and contains the geometric model of all scene elements in the scene. The geometric model is composed of vertex, edge and face geometric information, which describes the shape of the element. Material information includes element surface material properties such as diffuse color, specular reflection coefficient and roughness, which affect the reflection and absorption of light and shadow. Initial position information includes the initial coordinates of each element in the rendering engine coordinate system, which is consistent with the spatial coordinates analyzed earlier. The rendering engine loads these data and constructs a three-dimensional model representation of the scene in memory.

[0103] Step S1512: according to the scene element identifier, bind the final light shadow parameters with the corresponding scene elements in the rendering engine, and in the binding process, match the dimensions of the light shadow parameters with the parameter interface of the rendering engine, and convert the RGB value of the color attribute to the color space format supported by the rendering engine.

[0104] According to the scene element identification, the extracted final light shadow parameter is bound to the corresponding scene element loaded in the rendering engine. The binding process is implemented through the API provided by the rendering engine, and the identification of each scene element is associated with the element object in the rendering engine, and then the final light shadow parameter is assigned to the corresponding light shadow attribute of the element object. In the binding process, ensure that the dimension of the light shadow parameter matches the parameter interface of the rendering engine, for example, the illumination intensity parameter interface of the rendering engine is a specific range of floating point type values, then the final illumination intensity parameter is converted to a value within the range. The RGB value of the color attribute needs to be converted to the color space format supported by the rendering engine, such as from standard RGB to linear RGB or other color space used by the rendering engine, and the conversion process follows the standard algorithm of color space conversion.

[0105] Step S1513: For the core scene element, the final light shadow parameter is loaded preferentially, and the rendering priority of the core scene element is set to the highest; for the building components and natural landscape elements in the scene static structure element, according to the illumination range and light shadow propagation path in the final light shadow parameter, the light shadow projection direction and projection range are set in the rendering engine, and if there is a shielding scene element, the shielding relationship is marked in the rendering engine; for the scene dynamic role element, according to the action posture association information in the final light shadow parameter, the reflection effect of light shadow on the surface of the scene dynamic role element is adjusted, the light intensity at the bending part of the body of the scene dynamic role element is attenuated according to the reflection characteristic parameter, and the light contrast of the facial expression change area of the scene dynamic role element is enhanced according to the parameter adjustment value.

[0106] For the core scene element, the final light shadow parameter is loaded preferentially in the rendering engine to ensure that the light shadow effect of the core element is correctly set first. At the same time, the rendering priority of the core scene element is set to the highest, so that the rendering engine processes these elements first when rendering the scene, ensuring that the light shadow effect of the visual focus is accurately presented.

[0107] For the building components and natural landscape elements (if any) in the scene static structure element, according to the illumination range and light shadow propagation path in the final light shadow parameter, the light shadow projection direction and projection range are set in the rendering engine. The light shadow projection direction is calculated according to the position of the light source and the position of the target element, and the projection range is set according to the final illumination range parameter. If there is a shielding scene element, the shielding relationship is marked in the rendering engine, and the light shadow is correctly shielded in the propagation process by enabling the occlusion culling function of the rendering engine or manually setting the occlusion body.

[0108] For scene dynamic role elements, according to the action posture correlation information (such as limb angle, joint position) in the final light and shadow parameters, the reflection effect of light and shadow on the surface thereof is adjusted. For the bending part of the limbs (such as the elbow and the knee), according to the diffuse reflection ratio and the specular reflection ratio in the reflection characteristic parameters, the light and shadow intensity is attenuated, the greater the bending angle, the more the attenuation, and the real light and shadow reflection effect is simulated. For the facial expression change area (such as the corners of the mouth and the eyebrows), according to the parameter adjustment value, the light and shadow contrast is enhanced, the expression change is more obvious, and the expressiveness of the role is enhanced.

[0109] Step S1514: loading the global illumination parameters corresponding to the scene atmosphere type of the current frame, the global illumination parameters including the ambient light intensity, the ambient light color and the main light source parameters, fusing the final light and shadow parameters and the global illumination parameters, and in the fusion process, the final light and shadow parameters are given priority and the global illumination parameters are given secondary priority.

[0110] The global illumination parameters corresponding to the scene atmosphere type of the current frame are loaded, these parameters are determined when the atmosphere type is defined, including the ambient light intensity, the ambient light color and the main light source parameters (such as the main light source direction, intensity and color). The final light and shadow parameters and the global illumination parameters are fused, in the fusion process, the final light and shadow parameters are given priority and the global illumination parameters are given secondary priority, that is, the final light and shadow parameters are given priority and the global illumination parameters are used to supplement the areas not covered by the final light and shadow parameters or adjust the overall light and shadow keynote in the scene. For example, the ambient light intensity is superimposed on the illumination intensity of each element, but the weight is small; the main light source parameters affect the overall shadow direction and intensity of the scene, and are used in combination with the final shadow parameters of the elements.

[0111] Step S1515: performing a light and shadow calculation process of a rendering engine, the light and shadow calculation process including ray tracing calculation, shadow generation calculation, color mixing calculation and light and shadow attenuation calculation, and in the calculation process, the iterative adjustment basis in the final light and shadow rendering scheme is referenced, thereby generating a rendering result image of the current frame.

[0112] The light and shadow calculation process of the rendering engine is performed, and the light and shadow calculation process includes multiple calculation steps. The ray tracing calculation simulates the process that the light ray starts from the light source, intersects with the surface of the scene element, reflects and refracts, and calculates the color value of each pixel point; the shadow generation calculation generates the shadow according to the light source position, the element geometry and the occlusion relationship; the color mixing calculation mixes the light source color and the element material color to obtain the final pixel color; and the light and shadow attenuation calculation calculates the attenuation of the light intensity according to the distance and the medium characteristics. In the calculation process, the iterative adjustment basis in the final light and shadow rendering scheme is referenced, such as the adjustment value in the parameter adjustment summary table, so as to ensure that the optimized light and shadow parameters are used in the calculation. After the calculation is completed, the rendering engine generates a rendering result image of the current frame, and the rendering result image includes the optimized light and shadow effect of all scene elements.

[0113] Step S1516: Record the key data in the rendering process, store the key data in association with the final light and shadow rendering scheme, the inter-frame light and shadow coherence analysis report, form the complete rendering archive of the current frame, the key data includes rendering time consumption, rendering engine parameter setting and storage path of the rendering result image.

[0114] Record the key data in the rendering process, including rendering time consumption (the time from starting rendering to generating the image), rendering engine parameter setting (such as light tracing precision, sampling rate, etc.), and the storage path of the rendering result image (the location in the file system). Store the above key data in association with the final light and shadow rendering scheme and the subsequently generated inter-frame light and shadow coherence analysis report. The association is achieved through the common current frame identifier. The above data collectively form the complete rendering archive of the current frame, facilitating subsequent review, modification or backtracking of the rendering process.

[0115] Step S160: Extract the key light and shadow parameters in the final light and shadow rendering scheme of the current frame, and perform coherence analysis on the corresponding key light and shadow parameters in the rendering scheme of the previous frame to generate inter-frame light and shadow transition parameters, which are used for smooth connection of light and shadow in the next frame rendering.

[0116] Extract the key light and shadow parameters in the final light and shadow rendering scheme of the current frame, and perform coherence analysis on the corresponding key light and shadow parameters in the rendering scheme of the previous frame to check whether the parameter change is smooth. If the change is too large, it may cause inter-frame light and shadow jumping, affecting the visual experience. According to the analysis result, generate inter-frame light and shadow transition parameters, which are used to guide the adjustment of light and shadow parameters in the next frame rendering, so that the light and shadow effect of the next frame smoothly connects with the current frame, avoiding abrupt changes.

[0117] Step S161: Define the types of key light and shadow parameters, including the illumination intensity of core scene elements, the color attribute of core scene elements, the overall contrast of the scene, the direction parameter of the main light source of the scene, and the softness of the core shadow.

[0118] Define the types of key light and shadow parameters, which are the parameters that have the greatest impact on visual effects and are prone to significant changes between frames. The illumination intensity of core scene elements directly affects the brightness of the visual focus; the color attribute of core scene elements affects the color performance of the visual focus; the overall contrast of the scene affects the sense of hierarchy of the picture; the direction parameter of the main light source of the scene affects the direction of the shadow and the overall light and shadow layout; the softness of the core shadow affects the visual texture of the shadow. Defining the above parameters as key light and shadow parameters facilitates the analysis of their inter-frame coherence.

[0119] Step S162: Extract the current values of each key light and shadow parameter from the final light and shadow rendering scheme of the current frame, and record the specific numerical value of each key light and shadow parameter, the corresponding scene element identifier and the parameter effective timestamp.

[0120] Extract the current value of each key light parameter from the final light rendering scheme of the current frame, such as the current illumination intensity value of the core scene element, the RGB value of the current color attribute, etc. Record the specific value of each key light parameter, ensuring accuracy to a certain number of decimal places; record the corresponding scene element identifier, such as the illumination intensity of which core scene element; record the parameter effective timestamp, i.e. the rendering time or frame number of the current frame, for time association with the previous frame.

[0121] Step S163: Extract the historical value of the same type of key light parameter from the previous frame rendering scheme, record the historical value of each key light parameter, the corresponding scene element identifier and the historical effective timestamp.

[0122] Extract the historical value of the same type of key light parameter from the previous frame rendering scheme, the extraction process is similar to the current frame, get the historical illumination intensity, historical color attribute, etc. Record the historical value of each key light parameter, the corresponding scene element identifier (which needs to be consistent with the element identifier of the current frame to ensure that it is the parameter of the same element) and the historical effective timestamp (the time or frame number of the previous frame).

[0123] Step S164: Calculate the parameter difference value of each key light parameter current value and historical value, the parameter difference value is calculated by the difference between the current value and the historical value, for color attribute parameters, calculate the parameter difference value according to the RGB three channels respectively.

[0124] Calculate the parameter difference value of each key light parameter current value and historical value, for numerical parameters (such as illumination intensity, contrast, shadow softness), the parameter difference value is the current value minus the historical value. For color attribute parameters, calculate the parameter difference value according to the RGB three channels respectively, that is, the current red channel value minus the historical red channel value, the current green channel value minus the historical green channel value, and the current blue channel value minus the historical blue channel value, to get the difference value of the three channels. For the direction parameter of the main light source, if represented as an angle, the parameter difference value is the current angle minus the historical angle; if represented as a vector, calculate the difference value of each component by vector subtraction.

[0125] Step S165: Compare the parameter difference value of each key light parameter with the corresponding maximum allowed difference threshold value, if the absolute value of the parameter difference value is less than or equal to the maximum allowed difference threshold value, no transition parameter is generated; if the absolute value of the parameter difference value is greater than the maximum allowed difference threshold value, a transition parameter is generated.

[0126] A maximum allowed difference threshold corresponding to each key light and shadow parameter is set according to the sensitivity of the human eye to light and shadow changes. Changes exceeding the maximum allowed difference threshold will be obviously perceived as flickering. The parameter difference of each key light and shadow parameter is compared with the corresponding maximum allowed difference threshold. If the absolute value of the parameter difference is less than or equal to the maximum allowed difference threshold, the change is within an acceptable range, and no transition parameter needs to be generated. If the absolute value of the parameter difference is greater than the maximum allowed difference threshold, a transition parameter needs to be generated to smooth the change.

[0127] Step S166: For the key light and shadow parameter that needs to generate a transition parameter, the parameter transition rate is calculated according to the frame interval number between the current frame and the previous frame. The parameter transition rate is calculated by the ratio of the parameter difference to the frame interval number. When the frame interval number is greater than 1, the parameter transition rate is calculated by the ratio of the parameter difference to the frame skipping number.

[0128] For the key light and shadow parameter that needs to generate a transition parameter, the parameter transition rate is calculated. The frame interval number is the frame number difference between the current frame and the previous frame, which is normally 1 (continuous frame). The parameter transition rate is the ratio of the parameter difference to the frame interval number, that is, the parameter adjustment amount per frame, which makes the parameter smoothly transition from the historical value to the current value within the frame interval number. When the frame interval number is greater than 1 (such as frame skipping), the frame skipping number is the frame interval number, and the parameter transition rate is also the ratio of the parameter difference to the frame skipping number, which ensures smooth transition in the case of frame skipping.

[0129] Step S167: Based on the parameter transition rate, the inter-frame light and shadow transition parameter is generated, which includes the transition parameter type, the transition starting value, the transition target value, the transition rate, the transition frame number, and the transition effective scene element identifier. For color attribute parameters, the transition rate and the transition parameter are generated for each channel of RGB respectively. For the scene main light source direction parameter, the inter-frame light and shadow transition parameter further includes an angle increment of direction change, which is calculated by the ratio of the difference between the current direction angle and the historical direction angle to the transition frame number.

[0130] Based on the parameter transition rate, the inter-frame light and shadow transition parameter is generated. The transition parameter type indicates which key light and shadow parameter is transitioned. The transition starting value is the historical value of the previous frame. The transition target value is the current value of the current frame. The transition rate is the calculated adjustment amount per frame. The transition frame number is the frame interval number. The transition effective scene element identifier is the scene element identifier corresponding to the key light and shadow parameter.

[0131] For color attribute parameters, since the parameter difference is calculated for each channel of RGB, the transition rate and the transition parameter are generated for each channel respectively to ensure that the color components of each channel can smoothly transition.

[0132] For the scene main light source direction parameter, if the direction is represented by an angle, the inter-frame light transition parameter further comprises an angle increment of the direction change, which is calculated by the difference between the current direction angle and the historical direction angle divided by the number of transition frames, i.e. the angle of the direction change per frame, so as to make the light source direction rotate smoothly.

[0133] Step S168: integrate the continuity analysis results of all key light parameters, parameter differences, maximum allowed difference thresholds, and inter-frame light transition parameters corresponding to the transition parameters to be generated, to generate an inter-frame light continuity analysis report. The inter-frame light transition parameters are the core content of the inter-frame light continuity analysis report, and are used in the next frame rendering. First, the initial values of the key light parameters are adjusted according to the inter-frame light transition parameters, and then the subsequent initial rendering scheme generation step is performed.

[0134] All key light parameters, parameter differences, maximum allowed difference thresholds, and inter-frame light transition parameters corresponding to the transition parameters to be generated are integrated to generate an inter-frame light continuity analysis report, which is stored in the form of a document. The inter-frame light transition parameters are the core content of the report. In the next frame rendering, first, the initial values of the key light parameters are adjusted according to the inter-frame light transition parameters in the report, for example, the transition starting value is set to the current value of the previous frame, and gradually adjusted to the transition target value according to the transition rate and the number of transition frames, and then the subsequent initial light rendering scheme generation step is performed to ensure that the light effect of the next frame is smoothly connected with the current frame.

[0135] For example, the method further comprises: step S170: extracting the initial light parameters of each scene element and the reference light features of the current atmosphere type from the initial light rendering scheme; selecting representative test scene elements in the animation scene, the test scene elements including at least one of core scene elements, secondary scene elements, and background scene elements; based on the initial light parameters of the test scene elements, performing local light effect simulation in the rendering engine to generate a local rendering image of the test scene elements, the local rendering image only containing the test scene elements and the scene elements directly associated therewith.

[0136] The initial light and shadow parameters of each scene element and the reference light and shadow characteristics of the current atmosphere type are extracted from the initial light and shadow rendering scheme, and these data are the basis for simulating local light and shadow effects. Select representative test scene elements in the animation scene. In order to comprehensively evaluate the initial light and shadow rendering scheme, the test scene elements should include at least one core scene element, a secondary scene element and a background scene element, to ensure that elements of different levels can be tested. Based on the initial light and shadow parameters of the selected test scene elements, simulate the local light and shadow effect in the rendering engine. Only load the test scene elements and their directly associated scene elements (determined according to the scene element light and shadow association graph) during simulation to reduce the amount of calculation, generate a local rendering image containing only these elements, and use it for preliminary evaluation of the light and shadow effect.

[0137] Step S171: Analyze the light and shadow effect of the test scene element in the local rendering image, and determine whether the light and shadow effect of the test scene element meets the reference light and shadow characteristics of the current atmosphere type. The specific determination includes whether the illumination intensity of the test scene element is within the reference range, whether the color attribute matches the atmosphere dominant color, and whether the shadow effect meets the atmosphere corresponding shadow softness requirement. If the local rendering image meets the reference characteristics, select more test scene elements to repeat the local simulation and analysis steps; if the local rendering image does not meet the reference characteristics, analyze the reasons, and adjust the corresponding initial light and shadow parameters if the initial light and shadow parameter setting is deviated; if the atmosphere type identification is wrong, reconfirm the atmosphere type of the current frame.

[0138] Analyze the light and shadow effect of the test scene element in the local rendering image, and compare it with the reference light and shadow characteristics of the current atmosphere type. Specifically, determine whether the illumination intensity of the test scene element is within the reference light intensity range, whether the RGB value of the color attribute is within the dominant color range, and whether the softness of the shadow meets the reference shadow softness parameter. If the local rendering image meets the reference characteristics, it means that the initial light and shadow parameters are set reasonably on the test element, and more test scene elements of other levels are selected to repeat the local simulation and analysis steps to further verify the scheme. If it does not meet the reference characteristics, analyze the reasons, and if it is found that the initial light and shadow parameter setting is deviated (such as too high or too low illumination intensity), adjust the initial light and shadow parameters of the corresponding test scene element; if it is found that the atmosphere type identification is wrong (such as the current frame should be a warm atmosphere but is incorrectly identified as a tense atmosphere), reconfirm the atmosphere type of the current frame, and generate the initial light and shadow rendering scheme again according to the correct atmosphere type.

[0139] Step S172: After completing the local effect analysis, the overall light and shadow effect of the scene is pre-simulated, the initial light and shadow parameters of all scene elements are imported into the rendering engine, and the overall pre-rendered image of the current frame is generated; the light and shadow distribution uniformity of the overall pre-rendered image is analyzed, the brightness average of different regions in the image is calculated through image analysis tools, and if the brightness average difference is greater than the set difference threshold, the initial light and shadow parameters of the background scene element are adjusted; the light and shadow transition naturalness between scene elements in the overall pre-rendered image is analyzed, whether there is an obvious fault in the light and shadow boundary between the core scene element and the secondary scene element, and the secondary scene element and the background scene element are observed, and if there is a fault, the initial light and shadow parameters of the adjacent scene elements are adjusted to increase the light and shadow parameter correlation of the transition area.

[0140] After completing the local effect analysis and adjusting, the overall light and shadow effect of the scene is pre-simulated. The initial light and shadow parameters of all scene elements are imported into the rendering engine, the complete scene model data is loaded, and the overall pre-rendered image of the current frame is generated, which contains the initial light and shadow effect of all elements in the scene. The light and shadow distribution uniformity of the overall pre-rendered image is analyzed, and the brightness average of different regions (such as the upper left corner, the center, the lower right corner, etc.) in the image is calculated using image analysis tools (such as image analysis plug-ins provided by the rendering engine). A difference threshold is set, and if the brightness average difference of different regions is greater than the threshold, it indicates that the light and shadow distribution is uneven, and the initial light and shadow parameters of the background scene element are adjusted, such as increasing the illumination intensity of the dark area background element or reducing the illumination intensity of the bright area background element, to balance the overall light and shadow distribution. The light and shadow transition naturalness between scene elements is analyzed, and the light and shadow boundary between the core scene element and the secondary scene element, and the secondary scene element and the background scene element is visually observed. If there is an obvious brightness or color mutation (fault), the initial light and shadow parameters of the adjacent scene elements are adjusted, for example, the illumination intensity of the edge of the core element is slowly attenuated and smoothly connected with the illumination intensity of the secondary element, and the light and shadow parameter correlation of the transition area is increased, such as gradually transitioning the color attribute of the transition area from the color of the core element to the color of the secondary element.

[0141] Step S173: The overall pre-rendered image and the final rendered image of the previous frame are analyzed for inter-frame pre-conciseness, the key light and shadow parameter difference of the same scene elements in the two frames is calculated, and if the difference exceeds the maximum allowed difference threshold, the initial light and shadow parameters are adjusted in advance; according to the results of the local effect analysis, the overall distribution analysis, the transition naturalness analysis, and the inter-frame pre-conciseness analysis, the initial light and shadow parameters in the initial light and shadow rendering scheme are corrected to generate a corrected initial light and shadow rendering scheme; the corrected initial light and shadow rendering scheme and the original initial light and shadow rendering scheme are compared for parameters, the corrected parameter items, the correction basis, and the effect difference description before and after correction are recorded to form an initial scheme correction report.

[0142] The whole pre-rendered image is analyzed for inter-frame pre-coherence with the final rendered image of the previous frame, key light parameters (such as the irradiation intensity, color properties, etc. of the core scene elements) of the same scene elements in the two frames are extracted, and the parameter difference is calculated. If the difference exceeds the previously set maximum allowed difference threshold, it means that there may be a risk of inter-frame light and shadow jumping, and the initial light and shadow parameters of the current frame are adjusted in advance, for example, the key light parameters are adjusted in a certain amount towards the historical value, so that the difference is reduced to within the threshold. According to the results of local effect analysis, overall distribution analysis, transition naturalness analysis and inter-frame pre-coherence analysis, the rationality of each parameter in the initial light and shadow rendering scheme is comprehensively evaluated, the initial light and shadow parameters with problems are corrected, and the corrected initial light and shadow rendering scheme is generated. The corrected scheme and the original initial light and shadow rendering scheme are compared in terms of parameters, each corrected parameter item (such as which element and which light parameter), the correction basis (such as which analysis result), and the effect difference description before and after the correction (such as the description of the brightness change after adjusting the irradiation intensity) are recorded, and the initial scheme correction report is formed. The initial scheme correction report is used as a supplementary document of the initial light and shadow rendering scheme to trace the correction process.

[0143] It should be noted that, in order to simplify the expression of the disclosure of the present application, and to help the understanding of one or more embodiments of the present application, in the foregoing description of the embodiments of the present application, sometimes various features are incorporated into one embodiment, figure or description thereof.

Claims

1. A method for rendering light and shadow dynamics of an animation scene, characterized in that, The method comprises: establishing the light and shadow correlation relationship between each scene element in the animation scene to obtain a scene element light and shadow correlation graph, the scene element including a scene static structure element and a scene dynamic role element, the light and shadow correlation relationship being used to describe the correlation mode of the light and shadow mutual influence between different scene elements, and the scene element light and shadow correlation graph containing the hierarchical division information of the scene element and the light and shadow correlation weight between different hierarchies; generating a light and shadow dynamic response rule based on the scene element light and shadow correlation graph and in combination with the atmosphere type that may appear in the animation scene, the light and shadow dynamic response rule being used to define the light and shadow adjustment mode corresponding to the scene element state change and the atmosphere type switching; generating an initial light and shadow rendering scheme in combination with the scene element state data of the current frame of the animation scene and the current atmosphere type identifier according to the light and shadow dynamic response rule, the scene element state data including the position distribution information of the scene static structure element and the action posture information of the scene dynamic role element, and the initial light and shadow rendering scheme containing the basic light and shadow parameter and the atmosphere adaptation parameter of each scene element; analyzing the interactive influence between the light and shadow effects corresponding to each scene element in the initial light and shadow rendering scheme based on the scene element light and shadow correlation graph, including direct light and shadow interference and indirect light and shadow interference, to obtain a light and shadow interactive influence result, the light and shadow interactive influence result containing an interference source identifier, an interfered element identifier and an interference transmission path; optimizing the light and shadow parameter in the initial light and shadow rendering scheme by using a multi-round iteration adjustment mode according to the light and shadow interactive influence result to generate a final light and shadow rendering scheme, and applying the final light and shadow rendering scheme to the rendering processing of the current frame of the animation scene; extracting the key light and shadow parameter in the final light and shadow rendering scheme of the current frame, performing continuity analysis on the corresponding key light and shadow parameter in the rendering scheme of the previous frame to generate an interframe light and shadow transition parameter, and the interframe light and shadow transition parameter being used for light and shadow smooth connection in the next frame rendering.

2. The method of claim 1, wherein, The method comprises: classifying the scene elements in the animation scene to distinguish the scene static structure element and the scene dynamic role element to obtain a scene element classification result, the scene static structure element including a building component, a natural landscape element and a prop element, and the scene dynamic role element including a main role element, a secondary role element and a temporarily appearing role element; performing hierarchical division on the scene elements in the scene element classification result into a core scene element, a secondary scene element and a background scene element, the core scene element being an element corresponding to the visual focus in the picture, the secondary scene element being an element for assisting the expression of the core scene element, the background scene element being an element for constructing the spatial sense of the scene, and the light and shadow correlation weight corresponding to the scene elements in different hierarchies being determined, the light and shadow correlation weight of the core scene element being greater than the light and shadow correlation weight of the secondary scene element, and the light and shadow correlation weight of the secondary scene element being greater than the light and shadow correlation weight of the background scene element. extracting light and shadow properties of each scene element, the light and shadow properties including reflection characteristics of the scene element to light and shadow, absorption characteristics of the scene element to light and shadow, and light-emitting characteristics of the scene element itself, the reflection characteristics including a diffuse reflection ratio and a specular reflection ratio, the absorption characteristics including absorption ratios of different wavelengths of light, and the light-emitting characteristics including a self-luminous intensity and a light-emitting color range; analyzing spatial position relationships between each scene element and other scene elements, determining light and shadow propagation paths between different scene elements according to the spatial position relationships, marking the light and shadow propagation paths as blocked paths if there are occlusion scene elements, and recording identities and occlusion degrees of the occlusion scene elements, wherein the spatial position relationships include distance intervals, relative angles, and occlusion relationships, and the light and shadow propagation paths are used to describe path directions of light and shadow from one scene element to another scene element; calculating light and shadow correlation degrees between different scene elements according to the light and shadow properties of each scene element, the light and shadow propagation paths between different scene elements, and hierarchical correlation weights of the scene elements, the light and shadow correlation degrees being used to quantify degrees of mutual influences of light and shadow between different scene elements, the calculation process including determining a basic correlation value according to the light and shadow properties, correcting the basic correlation value according to unobstructed degrees of the light and shadow propagation paths, and finally combining the hierarchical correlation weights to obtain a final light and shadow correlation degree; constructing a scene element light and shadow correlation graph based on the light and shadow correlation degrees between different scene elements, the scene element light and shadow correlation graph taking scene elements as nodes, node attributes including scene element types, hierarchical identities, and light and shadow properties, taking light and shadow correlation degrees as attributes of connecting edges between the nodes, and marking unobstructed states of the light and shadow propagation paths and occlusion element identities on the connecting edges, and adding hierarchical indexes to the scene element light and shadow correlation graph.

3. The method of claim 1, wherein, generating light and shadow dynamic response rules based on the scene element light and shadow correlation graph and combining possible atmosphere types of the animation scene, including: defining possible atmosphere types of the animation scene, each atmosphere type corresponding to a group of reference light and shadow characteristics, the reference light and shadow characteristics including an overall illumination intensity range, a main color range, a light and shadow contrast range, and a shadow softness parameter; extracting node attribute information of each scene element in the scene element light and shadow correlation graph and light and shadow correlation degree information of connecting edges between the nodes, the node attribute information including scene element types, hierarchical identities, and light and shadow properties, and the connecting edge information including light and shadow correlation degrees and propagation path states; analyzing state change types of the scene dynamic role element, the state change types including position movement changes of the scene dynamic role element, action posture changes of the scene dynamic role element, and appearance form changes of the scene dynamic role element, the position movement changes including short-distance movement and long-distance movement, the action posture changes including body movement changes and facial expression changes, and the appearance form changes including clothing color changes and changes in carried props; For each scene dynamic role element state change type, the node attribute information and light and shadow correlation degree information in the light and shadow correlation graph of the scene element are combined to determine the affected scene element range corresponding to the state change type, and the affected scene elements are filtered from high to low according to the light and shadow correlation degree information, and the filtering process continues until the light and shadow correlation degree is lower than a preset correlation threshold. The affected scene element range includes scene elements directly affected by the state change and scene elements indirectly affected by the state change. The directly affected scene elements are the scene elements with the highest light and shadow correlation degree with the scene dynamic role element, and the indirectly affected scene elements are the scene elements that have light and shadow correlation with the directly affected scene elements. For each affected scene element in the affected scene element range, the corresponding light and shadow adjustment dimension of the affected scene element is determined by combining the reference light and shadow characteristics of different atmosphere types. The light and shadow adjustment dimension includes light and shadow irradiation intensity adjustment, light and shadow irradiation range adjustment, light and shadow color attribute adjustment, light and shadow contrast adjustment, and shadow softness adjustment. For each atmosphere type, a corresponding relationship between scene dynamic role element state change types and affected scene element light and shadow adjustment modes is established. The light and shadow adjustment mode includes adjustment dimension, adjustment direction, and adjustment basis. The adjustment basis is an adjustment amplitude coefficient determined based on the scene element light and shadow correlation degree. The higher the light and shadow correlation degree, the larger the adjustment amplitude coefficient. The corresponding relationships between state change types and light and shadow adjustment modes of all atmosphere types are integrated to generate a light and shadow dynamic response rule. The light and shadow dynamic response rule indexes atmosphere types. Each index includes a state change type list. Each state change type corresponds to an affected scene element list and the light and shadow adjustment mode of each affected scene element. The light and shadow adjustment mode is labeled with the scene element light and shadow correlation graph reference node.

4. The method of claim 1, wherein, The initial light and shadow rendering scheme is generated according to the light and shadow dynamic response rule, combined with the scene element state data of the current frame of the animation scene and the current atmosphere type identifier, including: The scene element state data of the current frame of the animation scene is parsed to extract the position distribution information of the scene static structure elements and the action posture information of the scene dynamic role elements. The position distribution information includes the spatial coordinates and relative layout relationship of each scene static structure element. The action posture information includes the limb angle, joint position, and motion trend of the scene dynamic role elements. According to the scene element state data of the current frame, the scene element state data of the previous frame is compared to determine whether the scene dynamic role elements have state changes. If the scene dynamic role elements have state changes, the state change type corresponding to the state change is determined according to the specific performance of the state change. If the scene dynamic role elements do not have state changes, the state change type of the previous frame is used and identified as no change. Obtaining a current atmosphere type identifier of a current frame of an animation scene, and according to the current atmosphere type identifier, a subset of light and shadow adjustment rules under a corresponding atmosphere type is retrieved from the light and shadow dynamic response rules, the rule subset including a range of affected scene elements and a light and shadow adjustment mode corresponding to all state change types under the atmosphere type; According to the determined state change type, the corresponding range of affected scene elements and the light and shadow adjustment dimension, adjustment direction and adjustment amplitude coefficient of each affected scene element are searched from the rule subset; For each affected scene element, the basic light and shadow parameters of the affected scene element are determined according to the light and shadow properties of the affected scene element and the reference light and shadow characteristics of the current atmosphere type, the basic light and shadow parameters including basic illumination intensity, basic illumination range, basic color property, basic contrast and basic shadow softness; Combined with the position distribution information of the scene static structure elements, the spatial position relationship between the affected scene element and other surrounding scene elements is analyzed, and if there is a shielding relationship, the basic light and shadow parameters are preliminarily corrected according to the shielding degree, and the basic illumination intensity is reduced when there is shielding; According to the adjustment amplitude coefficient and the adjustment direction corresponding to the affected scene element, the preliminarily corrected basic light and shadow parameters are adjusted to obtain the initial light and shadow parameters corresponding to the affected scene element, the initial light and shadow parameters including initial illumination intensity parameter, initial illumination range parameter, initial color property parameter, initial contrast parameter and initial shadow softness parameter. The identification information and corresponding initial light and shadow parameters of all affected scene elements are integrated to generate an initial light and shadow rendering scheme, the initial light and shadow rendering scheme also including parameter adjustment basis instructions, and the parameter adjustment basis instructions indicating the light and shadow dynamic response rule items corresponding to the adjustment of each initial light and shadow parameter and the scene element light and shadow association graph node reference.

5. The method of claim 1, wherein, According to the scene element light and shadow association graph, the interactive influence between the light and shadow effects corresponding to each scene element in the initial light and shadow rendering scheme is analyzed, including direct light and shadow interference and indirect light and shadow interference, to obtain a light and shadow interaction influence result, including: The initial light and shadow parameters corresponding to each affected scene element are extracted from the initial light and shadow rendering scheme, and the initial light and shadow effect of each affected scene element in the current frame scene is simulated and generated according to the initial light and shadow parameters, the initial light and shadow effect including the distribution range, intensity decay law and color change trend of the light and shadow emitted or reflected by the affected scene element in space; According to the scene element light and shadow association graph, the corresponding associated scene elements of each affected scene element are searched, the associated scene elements being scene elements having a light and shadow association relationship with the affected scene element, and the associated scene elements are sorted from high to low according to the light and shadow association degree to obtain an associated scene element list, and the light and shadow propagation path information between the associated scene elements is extracted, the light and shadow propagation path information including path unobstructed state and shielding element identifier. analyze the direct light and shadow interference of the initial light and shadow effect of each affected scene element on its associated scene element, the direct light and shadow interference being the interference caused by the light and shadow of the affected scene element acting directly on the associated scene element, the direct light and shadow interference specifically including intensity change, color change, contrast change and shadow form change of the original light and shadow effect of the associated scene element caused by the initial light and shadow effect, for each change, record the specific performance and influence range of the change; analyze the indirect light and shadow interference according to the hierarchical relationship and light and shadow propagation path in the scene element light and shadow association graph, the indirect light and shadow interference being the interference caused by the light and shadow of the affected scene element acting on the intermediate scene element first and then being transmitted to the target associated scene element, first determine the intermediate scene element, then simulate the effect of the initial light and shadow effect on the intermediate scene element, then analyze the light and shadow influence of the effect on the target associated scene element, record the transmission path of the indirect interference, the interference change of each transmission node and the light and shadow change of the final target associated scene element; for each light and shadow interference, calculate the interference degree, the interference degree being used to quantify the severity of the light and shadow interference, in the calculation process, first determine the interference sensitivity according to the light and shadow attribute of the associated scene element, different associated scene elements have different interference sensitivity to light and shadow change, the interference sensitivity of the core scene element is higher than that of the background scene element, then obtain the interference degree value according to the product of the amplitude of the light and shadow change and the interference sensitivity, the higher the interference degree value, the more serious the light and shadow interference; record the interference source identifier, the interfered element identifier, the interference type, the interference transmission path, the interference specific performance and the interference degree value corresponding to each light and shadow interference; sort and arrange all light and shadow interference records, sort them from high to low according to the interference degree value, and group them according to the hierarchical identifier of the interfered element, the light and shadow interference records corresponding to the core scene element are prioritized, generate the light and shadow interaction influence result, the light and shadow interaction influence result also contains the scene element light and shadow association graph nodes and the initial light and shadow effect simulation basis cited by the interference analysis.

6. The method of claim 1, wherein, According to the light and shadow interaction influence result, the light and shadow parameters in the initial light and shadow rendering scheme are optimized by using a multi-round iteration adjustment method to generate a final light and shadow rendering scheme, including: analyze the light and shadow interaction influence result, extract all light and shadow interference records, sort them from high to low according to the interference degree value, and group them according to the hierarchical identifier of the interfered element, the light and shadow interference records corresponding to the core scene element are the first priority, the light and shadow interference records corresponding to the secondary scene element are the second priority, and the light and shadow interference records corresponding to the background scene element are the third priority, determine the interference objects of the first round adjustment as the top N light and shadow interference records with the highest interference degree value in the first priority, set the value of N according to the scene complexity; for each light and shadow interference record of the first round adjustment, determine the interference source and the corresponding initial light and shadow parameter, analyze the specific parameter item in the initial light and shadow parameter that causes the light and shadow interference, and determine the adjustment direction of the parameter item combined with the interference degree value; According to the mapping relationship between the interference degree value and the parameter adjustment amplitude, the adjustment amplitude of the parameter item is determined, the mapping relationship is established through the early scene test, the higher the interference degree value is, the larger the adjustment amplitude is, and the adjustment amplitude does not exceed the range of the current atmosphere type reference light and shadow characteristics; Based on the determined adjustment direction and adjustment amplitude, the target parameter item in the initial light and shadow parameter of the interference source is adjusted to obtain the first round of adjusted light and shadow parameter, and the parameter values before and after the adjustment, the adjustment basis are recorded; The first round of adjusted light and shadow parameter is substituted into the scene light and shadow effect simulation model, the light and shadow effect of the interference source is simulated again, the interference degree of the light and shadow effect on the original associated scene element is analyzed, if the adjusted interference degree value is lower than the preset interference threshold, the parameter adjustment of the interference source is completed, if the adjusted interference degree value is still higher than the preset interference threshold, the above adjustment steps are repeated, and the repeating process continues until the interference degree value is lower than the preset interference threshold or the preset iteration number is reached, and the preset iteration number is set according to the rendering efficiency requirement; After the first round of adjustment is completed, the second round of adjustment is entered, the first M light and shadow interference records with the highest interference degree value in the second priority are taken as the adjustment objects, the value of M is set according to the remaining scene complexity, the same adjustment logic as the first round is adopted, the interference source parameter is analyzed, the adjustment direction and amplitude are determined, the adjustment is executed and the effect is analyzed; The interference source parameter adjustment corresponding to all light and shadow interference records is completed in turn according to the priority order, for the light and shadow interference record that still cannot reduce the interference degree value to below the preset interference threshold after multiple iterations, whether there is a scene element light and shadow association graph construction deviation is analyzed, if there is a scene element light and shadow association graph construction deviation, the light and shadow association degree or the propagation path information in the scene element light and shadow association graph is corrected, and the interference analysis and parameter adjustment are re-performed; The final light and shadow parameters corresponding to all adjusted interference sources are collected, and the initial light and shadow parameters of the affected scene elements not involved in the light and shadow interference are kept unchanged; The final light and shadow parameters or the unchanged initial light and shadow parameters of all affected scene elements are integrated, and a parameter adjustment summary table is added, the parameter adjustment summary table includes the adjustment times, the values before and after the adjustment, the adjustment basis and the final interference degree value of each parameter, a final light and shadow rendering scheme is generated, and the final light and shadow rendering scheme also includes key simulation result screenshot reference identifiers in the iteration adjustment process.

7. The method of claim 1, wherein, The key light and shadow parameters in the final light and shadow rendering scheme of the current frame are extracted, and the corresponding key light and shadow parameters in the rendering scheme of the previous frame are analyzed for continuity to generate inter-frame light and shadow transition parameters, including: Defining the type of key light and shadow parameters, the key light and shadow parameters include the illumination intensity of core scene elements, the color attribute of core scene elements, the overall contrast of the scene, the direction parameter of the main light source of the scene and the softness of core shadows; The current values of the key light and shadow parameters are extracted from the final light and shadow rendering scheme of the current frame, and the specific numerical value of each key light and shadow parameter, the corresponding scene element identifier and the parameter effective timestamp are recorded; extracting a history value of the same type of key light and shadow parameter from a previous frame rendering scheme, recording a history value of each key light and shadow parameter, a corresponding scene element identifier and a history effective timestamp; calculating a parameter difference value of each key light and shadow parameter current value and history value, the parameter difference value being calculated by the difference between the current value and the history value, for color attribute parameters, calculating the parameter difference value according to the RGB three channels respectively; comparing the parameter difference value of each key light and shadow parameter with the corresponding maximum allowed difference threshold value, if the absolute value of the parameter difference value is less than or equal to the maximum allowed difference threshold value, no transition parameter is generated; if the absolute value of the parameter difference value is greater than the maximum allowed difference threshold value, a transition parameter is generated; for the key light and shadow parameter that needs to generate the transition parameter, calculating the parameter transition rate according to the frame interval number between the current frame and the previous frame, the parameter transition rate being calculated by the ratio of the parameter difference value and the frame interval number, when the frame interval number is greater than 1, the parameter transition rate is calculated by the ratio of the parameter difference value and the frame interval number; generating an inter-frame light and shadow transition parameter based on the parameter transition rate, the inter-frame light and shadow transition parameter including transition parameter type, transition starting value, transition target value, transition rate, transition frame number and transition effective scene element identifier; for color attribute parameters, generating transition rate and transition parameter for each channel of RGB respectively; for scene main light source direction parameters, the inter-frame light and shadow transition parameter further contains an angle increment of direction change, the angle increment being calculated by the ratio of the difference between the current direction angle and the history direction angle and the transition frame number; integrating the continuity analysis results of all key light and shadow parameters, the parameter difference value, the maximum allowed difference threshold value and the inter-frame light and shadow transition parameter corresponding to the transition parameter that needs to be generated, to generate an inter-frame light and shadow continuity analysis report, the inter-frame light and shadow transition parameter being the core content of the inter-frame light and shadow continuity analysis report, used for adjusting the initial value of the key light and shadow parameter according to the inter-frame light and shadow transition parameter in the next frame rendering, and then executing the subsequent initial rendering scheme generation step.

8. The method of claim 1, wherein, the rendering process of applying the final light and shadow rendering scheme to the current frame of the animation scene, comprising: parsing the final light and shadow rendering scheme, extracting the final light and shadow parameter of each affected scene element, the extracted final light and shadow parameter including irradiation intensity, color attribute, contrast, shadow parameter and associated scene element identifier, while extracting the parameter adjustment summary table and iterative adjustment basis in the final light and shadow rendering scheme; importing the scene model data of the current frame of the animation scene into the rendering engine, the scene model data including the geometric model, material information and initial position information of all scene elements; binding the final light and shadow parameter with the corresponding scene element in the rendering engine according to the scene element identifier, matching the dimension of the light and shadow parameter with the parameter interface of the rendering engine in the binding process, and converting the RGB value of the color attribute into the color space format supported by the rendering engine; for the core scene element, preferentially loading its final light and shadow parameter, and setting the rendering priority of the core scene element to the highest; For the building components and natural landscape elements in the static structure elements of the scene, according to the illumination range and light and shadow propagation path in the final light and shadow parameters, the light and shadow projection direction and projection range are set in the rendering engine, and if there are shielding scene elements, the shielding relationship is marked in the rendering engine; For the dynamic role elements of the scene, according to the action posture correlation information in the final light and shadow parameters, the reflection effect of light and shadow on the surface of the dynamic role elements of the scene is adjusted, the light and shadow intensity at the bending part of the body of the dynamic role elements of the scene is attenuated according to the reflection characteristic parameters, and the light and shadow contrast of the facial expression change area of the dynamic role elements of the scene is enhanced according to the parameter adjustment value; Load the global illumination parameters corresponding to the scene atmosphere type of the current frame, the global illumination parameters include the ambient light intensity, the ambient light color and the main light source parameters, and the final light and shadow parameters are fused with the global illumination parameters, and in the fusion process, the final light and shadow parameters are mainly used, and the global illumination parameters are used as auxiliary; The light and shadow calculation process of the rendering engine is executed, the light and shadow calculation process includes ray tracing calculation, shadow generation calculation, color mixing calculation and light and shadow attenuation calculation, and the iterative adjustment basis in the final light and shadow rendering scheme is referred to in the calculation process, so as to generate the rendering result image of the current frame; Key data in the rendering process is recorded, the key data is associated with the final light and shadow rendering scheme and the frame-to-frame light and shadow coherence analysis report, and a complete rendering archive of the current frame is formed, the key data includes the rendering time consumption, the rendering engine parameter setting and the storage path of the rendering result image.

9. An animation scene light and shadow dynamic rendering system, characterized in that, Comprise: A processor; A machine readable storage medium for storing machine executable instructions of the processor; Wherein, the processor is configured to execute the machine executable instructions to execute the animation scene light and shadow dynamic rendering method in any one of claims 1 to 8.

10. A computer program product, characterised in that, The computer program product comprises machine executable instructions stored in a computer readable storage medium, and the processor of the computer equipment reads the machine executable instructions from the computer readable storage medium, and the processor executes the machine executable instructions, so that the computer equipment executes the animation scene light and shadow dynamic rendering method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Intelligent rendering method and system for realizing animation picture

    CN119444944A

  • Real-time light and shadow tracking and rendering system for virtual reality environment

    CN120707715A