Method and device for generating environment atmosphere in virtual scene, and electronic equipment
By using language text and models to generate environmental atmosphere indicators in virtual scenes, the high cost and inefficiency problems of manually setting atmosphere indicators by developers in the prior art are solved, and more efficient development and a more friendly user experience are achieved.
Patent Information
- Application Number
- CN202411397070.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the environmental atmosphere in the virtual scene depends on the developer manually setting the atmosphere indicators of each atmosphere component, resulting in high development costs, low development efficiency, and unfriendly to users.
By obtaining the state information of the atmosphere component in the language text and virtual scene, the first model is used to generate the atmosphere information, and input it into the second model to generate the atmosphere index value corresponding to the atmosphere component, the rendering engine is adjusted to achieve the environmental atmosphere that conforms to the language text. .
It reduces the workload and working hours of developers, reduces the development costs of virtual applications, improves development efficiency, and lowers the threshold for use, making the user experience more friendly.
Smart Images

Figure CN119415092A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and computer-readable storage medium for generating an environmental atmosphere in a virtual scene. Background Art
[0002] Environmental atmosphere is a key element in virtual scenes. It not only affects the visual effects of virtual scenes, but also improves the expressiveness of virtual scenes, enhances the overall experience quality of virtual applications, and brings an immersive experience to users.
[0003] At present, the environment atmosphere in virtual scenes depends on developers manually setting the atmosphere indicators of each atmosphere component. On the one hand, due to the large number of atmosphere components that affect the environment atmosphere and the large number of atmosphere indicators corresponding to the atmosphere components, it is time-consuming and laborious to manually generate the environment atmosphere, which undoubtedly increases the development cost of virtual applications and reduces the development efficiency of virtual applications. On the other hand, due to the strong professional dependence of manual settings, it is not user-friendly and has poor applicability.
[0004] Therefore, the prior art has technical problems such as high development cost and low development efficiency of virtual applications, and being unfriendly to users, because it relies on developers to manually set the atmosphere indicators of each atmosphere component to achieve the environmental atmosphere in the virtual scene. Summary of the invention
[0005] The present application provides a method, device, electronic device and computer-readable storage medium for generating an environmental atmosphere in a virtual scene, so as to solve the technical problems existing in the prior art that the environmental atmosphere in the virtual scene is realized by relying on developers to manually set the atmosphere indicators of each atmosphere component, resulting in high development cost and low development efficiency of virtual applications, and being unfriendly to users.
[0006] In a first aspect, an embodiment of the present application provides a method for generating an environmental atmosphere in a virtual scene, the method comprising: obtaining a language text and status information of an atmosphere component preset in the virtual scene; inputting the language text into a first model, and generating atmosphere information of the environmental atmosphere described by the language text through the first model, the atmosphere information comprising preset atmosphere parameters for describing the environmental atmosphere and parameter values corresponding to the atmosphere parameters; inputting the status information and the atmosphere information into a second model, and generating index values of atmosphere indicators corresponding to the atmosphere components through the second model; adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0007] In a second aspect, an embodiment of the present application provides a system for generating an environmental atmosphere in a virtual scene, the system comprising a client and a server; the client is used to provide an input interface for a language text; the server comprises a first acquisition module, a second acquisition module, a first processing module, a second processing module, and an index adjustment module; the first acquisition module is used to obtain the language text input by the user from the client; the second acquisition module is used to obtain the state information of the atmosphere component preset in the virtual scene from the rendering engine; the first processing module is used to input the language text into a first model, and generate the atmosphere information of the environmental atmosphere described by the language text through the first model, the atmosphere information comprising the preset atmosphere parameters for describing the environmental atmosphere and the parameter values corresponding to the atmosphere parameters; the second processing module is used to input the state information and the atmosphere information into a second model, and generate the index value of the atmosphere index corresponding to the atmosphere component through the second model; the index adjustment module is used to adjust the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0008] In a third aspect, an embodiment of the present application provides a device for generating an environmental atmosphere in a virtual scene, the device comprising: an acquisition unit, a first generation unit, a second generation unit, and an adjustment unit; the acquisition unit is used to acquire a language text and status information of an atmosphere component preset in the virtual scene; the first generation unit is used to input the language text into a first model, and generate atmosphere information of the environmental atmosphere described by the language text through the first model, the atmosphere information comprising preset atmosphere parameters for describing the environmental atmosphere and parameter values corresponding to the atmosphere parameters; the second generation unit is used to input the status information and the atmosphere information into a second model, and generate index values of atmosphere indicators corresponding to the atmosphere components through the second model; the adjustment unit is used to adjust the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0009] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to implement the above method.
[0010] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, which, when executed by a processor, executes the above method.
[0011] Compared with the prior art, the method for generating an environmental atmosphere in a virtual scene provided by the present application includes: obtaining a language text and state information of an atmosphere component preset in a virtual scene; inputting the language text into a first model, and generating the atmosphere information of the environmental atmosphere described by the language text through the first model; inputting the state information and the atmosphere information into a second model, and generating the index value of the atmosphere index corresponding to the atmosphere component through the second model; adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the atmosphere index of the adjusted atmosphere component. First, the method can generate the index value of the atmosphere index corresponding to each atmosphere component preset in the virtual scene based on the language text, and does not require the developer to manually set these atmosphere indicators, which significantly reduces the workload and working hours of the developer, and then reduces the development cost of the virtual application that deploys the environmental atmosphere, and improves the development efficiency of the virtual application. Second, the method can enable the rendering engine to render an environmental atmosphere that conforms to the language text based on the language text, and does not require the developer to have too high professional knowledge, which reduces the threshold of use and is more user-friendly, especially for novice users. In summary, the method for generating an environmental atmosphere in a virtual scene provided by the present application solves the technical problems existing in the prior art that the environmental atmosphere in the virtual scene is achieved by relying on developers to manually set the atmosphere indicators of each atmosphere component, resulting in high development costs and low development efficiency of virtual applications, as well as being unfriendly to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is an application system diagram of a method for generating an environmental atmosphere in a virtual scene provided in an embodiment of the present application;
[0013] Figure 2 is a flow chart of a method for generating an environmental atmosphere in a virtual scene provided in the first embodiment of the present application;
[0014] Figure 3 It is a flowchart of a method for generating an environmental atmosphere in a virtual scene provided in the first embodiment of the present application;
[0015] Figure 4 is a schematic diagram of a system for generating an environmental atmosphere in a virtual scene provided in a second embodiment of the present application;
[0016] Figure 5 is a schematic diagram of the structure of a device for generating an environmental atmosphere in a virtual scene provided in the third embodiment of the present application;
[0017] Figure 6 It is a schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present application. DETAILED DESCRIPTION
[0018] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0019] With the rapid advancement of computer technology and graphics processing technology, the virtual application industry has entered an unprecedented stage of development. The developers of virtual applications are no longer only concerned with the richness of application functions, but also pay more and more attention to the experience that virtual applications bring to users. In the virtual scenes presented to users by virtual applications, the environmental atmosphere is a key element. It not only affects the visual effects of the virtual scenes, but also improves the expressiveness of the virtual scenes, enhances the overall experience quality of virtual applications, and brings users an immersive experience.
[0020] Currently, the environmental atmosphere in the virtual scene depends on developers manually setting the atmosphere indicators of each atmosphere component.
[0021] On the one hand, there are many atmosphere components that affect the environment atmosphere, such as light source (light source includes main light source, auxiliary light source, dynamic light source, etc.), atmosphere (atmosphere includes sky box, atmospheric scattering, cloud layer, haze, etc.), volumetric fog (volume fog includes global fog, local fog, dynamic fog, etc.), post-processing (post-processing includes tone mapping, depth of field, color difference, etc.), etc., and the atmosphere indicators corresponding to the atmosphere components are also relatively large. For example, in terms of light source, the atmosphere indicators corresponding to the light source may include angle, intensity, color temperature, etc., and in terms of volumetric fog, the atmosphere indicators corresponding to the volumetric fog may include density, height, color, etc. Therefore, it is time-consuming and laborious to generate the environment atmosphere based on manually setting the atmosphere indicators of each atmosphere component, which undoubtedly increases the development cost of virtual applications and reduces the development efficiency of virtual applications.
[0022] On the other hand, since manually setting the atmosphere indicators of each atmosphere component is too professional, it often requires experienced practitioners to be competent, which is not friendly to novice users. Even experienced practitioners may need to refer to the usage documentation to correctly set the atmosphere component indicators. Therefore, the method based on manual generation of environmental atmosphere has poor applicability.
[0023] In view of this, the present application provides a method for generating an environmental atmosphere in a virtual scene. The method is based on a first model and a second model. Through the language text preset by the user and the status information of each atmosphere component preset in the virtual scene, the index value of each atmosphere index corresponding to each atmosphere component is generated, so that the atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of each atmosphere index corresponding to each atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text preset by the user in the virtual scene based on the adjusted atmosphere index of each atmosphere component. First, the method can generate the index value of the atmosphere index corresponding to each atmosphere component preset in the virtual scene based on the language text, and does not require the developer to manually set these atmosphere indicators, which significantly reduces the workload and working hours of the developer, and then reduces the development cost of the virtual application that deploys the environmental atmosphere, and improves the development efficiency of the virtual application. Second, the method can enable the rendering engine to render an environmental atmosphere that conforms to the language text based on the language text, and does not require the developer to have too high professional knowledge, which reduces the threshold of use and is more user-friendly, especially for novice users.
[0024] The following is a further detailed description of the method, device, electronic device and computer-readable storage medium for generating an environmental atmosphere in a virtual scene described in the present application in conjunction with specific embodiments and drawings.
[0025] Figure 1 is an application system diagram of a method for generating an environmental atmosphere in a virtual scene provided by an embodiment of the present application. Figure 1 As shown, the system includes a user terminal 101 and a server terminal 102. The user terminal 101 can be any device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant (PDA), etc. The server terminal 102 can be a processing module located inside the user terminal 101, or a processing device electrically connected to the user terminal 101, or a server communicatively connected to multiple user terminals 101. The server terminal 102 is deployed with a method for generating an environmental atmosphere in a virtual scene provided by the present application. In response to a user sending an instruction to generate an environmental atmosphere to the server terminal 102 through the user terminal 101, the server terminal 102 generates an environmental atmosphere in a virtual scene that meets the user's expectations according to the method.
[0026] The first embodiment of the present application provides a method for generating an environmental atmosphere in a virtual scene.
[0027] The environment atmosphere can be understood as the overall feeling or atmosphere created in the virtual scene by various atmosphere elements and technical means. The environment atmosphere plays a vital role in enhancing the user's immersion and improving the experience of virtual applications. Generally, the environment atmosphere can be created by a variety of atmosphere elements such as visual elements, sound effects, interactive design, storylines, cultural elements, etc.
[0028] Figure 2 Flowchart of the method for generating the environment atmosphere in the virtual scene provided by this embodiment. Figure 2 The method for generating the environment atmosphere in the virtual scene provided by this embodiment is described in detail. The embodiments described below are used to explain the technical solution of this application and are not intended to be used as limitations for actual use.
[0029] like Figure 2 As shown, the method for generating an environmental atmosphere in a virtual scene provided by this embodiment includes the following steps S210 to S240.
[0030] Step S210, obtaining language text and status information of atmosphere components preset in the virtual scene.
[0031] The language text can be understood as natural language input by the user in the form of text, voice, etc., which contains the environmental atmosphere expected by the user, that is, the scene atmosphere that the user expects the virtual scene to present.
[0032] In an optional implementation, the method for generating an environmental atmosphere in a virtual scene provided by this embodiment is applied in the development stage of a virtual application, and the user can be understood as a developer of a virtual application. The developer inputs a language text and generates an environmental atmosphere that conforms to the planned plan based on the method provided by this embodiment. Then, the index values of each component index corresponding to each atmosphere component constituting the environmental atmosphere are encapsulated into the virtual application, so that after the virtual application is put into use, the environmental atmosphere can be rendered in the virtual scene based on the index values of each component index corresponding to each atmosphere component.
[0033] In another optional implementation, the method for generating an environment atmosphere in a virtual scene provided by this embodiment is applied in the use stage of a virtual application, and the user is understood as a user of the virtual application. The user inputs a language text, and based on the method provided by this embodiment, the environment atmosphere in the virtual scene is replaced with an environment atmosphere that meets the user's preferences.
[0034] The atmosphere component can be understood as an example of the environment atmosphere in the virtual scene, such as a light source component, an atmosphere component, a volume fog component, a post-processing component, a particle component, a reflection component, etc. There are usually multiple preset atmosphere components in the virtual scene, which can be determined according to the specific settings of the virtual application and are not limited here.
[0035] The state information can be understood as information that can characterize at least some of the features of the atmosphere component. In an optional implementation, the state information of the atmosphere component at least includes the type of the atmosphere component and the position of the atmosphere component in the virtual scene. Specifically, the type of the atmosphere component is characterized by the name of the atmosphere component, and the position of the atmosphere component is characterized by the coordinates of the atmosphere component in the virtual scene coordinate system.
[0036] Exemplarily, the status information of all light source components preset in the virtual scene is obtained, the type of the first light source component is the main light source DirectionalLight, the position of the first light source component is (0,0,0), and the status information of the first light source component can be expressed as DirectionalLight:(0,0,0); the type of the second light source component is the spotlight SpotLight, the position of the second light source component is (328,658,206), and the status information of the second light source component can be expressed as SpotLight:(328,658,206); the type of the third light source component is the rectangular light source RectLight, the position of the third light source component is (0,0,-70), and the status information of the third light source component can be expressed as RectLight:(0,0,-70); the type of the fourth light source component is the sky light source SkyLight, the position of the fourth light source component is (3953281908,17400463091,0), and the status information of the fourth light source component can be expressed as SkyLight:(3953281908,17400463091,0); and so on. The status information of all light source components obtained can be expressed as: [DirectionalLight:(0,0,0), SpotLight:(328,658,206), RectLight:(0,0,-70), SkyLight:(3953281908,17400463091,0), …].
[0037] Step S220: input the language text into the first model, and generate atmosphere information of the environment atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environment atmosphere and parameter values corresponding to the atmosphere parameters.
[0038] The language text contains the environment atmosphere expected by the user. The function of the first model is to parse the language text and extract the atmosphere information corresponding to the environment atmosphere described by the language text from the language text. In this embodiment, the atmosphere information corresponding to the environment atmosphere includes atmosphere parameters and parameter values that can characterize the environment atmosphere. These atmosphere parameters can be preset by the user or automatically generated by the first model based on the analysis of the language text.
[0039] The first model can be a pre-trained large language model, which refers to an artificial intelligence system with a large number of parameters obtained through machine learning training, which is specifically used to process natural language tasks. The model contains hundreds of millions to trillions of parameters, which enables it to perform well in processing complex language structures, can generate or understand language according to context, and provide a more human-friendly understanding and generation capability. It can perform new tasks without additional training (zero-sample learning), or only require a small number of examples to quickly learn new tasks (few-sample learning). In this embodiment, the large language model can be a mature large language model, or it can be obtained by training a general large language model with a few samples. Optionally, the first model described in this embodiment can be a Llama 3 model, which is a powerful, flexible and diverse open source large language model that not only performs well in text processing, but also supports multimodal applications and high customization. Its open source nature and extensive cloud platform support enable developers to make full use of the model to develop multi-field application projects.
[0040] In an optional implementation, the language text and the atmosphere parameters that the user expects to obtain (i.e., the atmosphere parameters preset by the user) can be encapsulated as prompt words, and the prompt words can be input into the first model. Under the guidance of the prompt words, the first model can extract the parameter value corresponding to the atmosphere parameter preset by the user from the language text. The parameter value can be a specific numerical value or a descriptive text.
[0041] Based on this, the language text is input into the first model, and the atmosphere information of the environment atmosphere described by the language text is generated by the first model, which may specifically include the following steps S221 to S222:
[0042] Step S221, encapsulating the language text and atmosphere parameters into prompt words.
[0043] Step S222: input the prompt word into the first model so that the first model parses the language text and generates at least a parameter value for the atmosphere parameter.
[0044] Exemplarily, the language text input by the user is: Two orioles sing in the green willows, a line of egrets fly into the blue sky, and the preset atmosphere parameters include: main light source type, main light source angle, main light source intensity, volume fog density, volume fog height, volume fog color, cloud coverage, cloud type, etc. After obtaining the above language text, the language text and the preset atmosphere parameters are encapsulated as prompt words, which can be expressed as: Please return the parameter values of the following atmosphere parameters [main light source type, main light source angle, main light source intensity, volume fog density, volume fog height, volume fog color, cloud coverage, cloud type] according to [Two orioles sing in the green willows, a line of egrets fly into the blue sky], as well as the parameter values of other atmosphere parameters that you think are necessary to reflect the environmental atmosphere described by [Two orioles sing in the green willows, a line of egrets fly into the blue sky]. The prompt word is input into the first model, and the first model will analyze the environmental atmosphere described by "two orioles singing in the green willows, a line of egrets flying in the blue sky", and output the parameter values corresponding to the main light source type, the parameter values corresponding to the main light source angle, the parameter values corresponding to the main light source intensity, the parameter values corresponding to the volume fog density, the parameter values corresponding to the volume fog height, the parameter values corresponding to the volume fog color, the parameter values corresponding to the cloud coverage, the parameter values corresponding to the cloud type, and the parameter values corresponding to other atmosphere parameters, such as the parameter values corresponding to the time, the parameter values corresponding to the visibility, the parameter values corresponding to the willow color, the parameter values corresponding to the grass color, etc. Table 1 exemplarily lists the atmosphere information generated by the first model according to "two orioles singing in the green willows, a line of egrets flying in the blue sky":
[0045] Table 1 Atmosphere information generated by the first model
[0046] Atmosphere parameters Parameter value (value / description) time Spring morning, around 8-9 am Main Light sun Light source angle Southeast direction, altitude 30-40 degrees Light intensity 6000-7000 lumens Color Temperature 5500K visibility 15-20 km humidity 60-70% temperature 15-20℃ Volumetric Fog Density 0.2-0.3 (full density is 1) Volumetric Fog Height 2-3 meters above ground level Volumetric Fog Color Light blue and white (RGB: 220, 225, 255) Zenith Color Dark blue (RGB: 100, 149, 237) Horizon Color Light blue and white (RGB: 173,216,230) Cloud Cover 10-20% Cloud Type Cirrocumulus clouds, thin and transparent Willow Color New green (RGB: 144,238,144) Grass color Light green (RGB: 124,252,0) Oriole Color Bright yellow (RGB: 255,255,0) egret color Pure white (RGB: 255,255,255) Water surface reflectivity 30-40% Water ripples slight Shadow Transparency 70-80% Shadow Features Soft, slightly blurred edges
[0047] Step S230: input the state information and the atmosphere information into the second model, and generate the index value of the atmosphere index corresponding to the atmosphere component through the second model.
[0048] After extracting the atmosphere information from the language text, the atmosphere information and the state information of the atmosphere component can be input into the second model as input data. The function of the second model is to determine the index value of the atmosphere index corresponding to the preset atmosphere component in the virtual scene according to the atmosphere information. Specifically, the atmosphere parameters in the atmosphere information are associated with the atmosphere indicators corresponding to the atmosphere components, and the parameter values corresponding to the atmosphere parameters are converted into the index values corresponding to the atmosphere indicators. Optionally, multiple atmosphere information determine an atmosphere indicator and an index value, and one atmosphere information affects multiple atmosphere indicators and index values.
[0049] The second model may be a pre-trained large language model. In this embodiment, the second model may be obtained by training a general large language model with a few samples. Optionally, the second model described in this embodiment may be an LLaVA-3 model, which is a powerful, flexible and diverse multimodal large language model with visual understanding capabilities, capable of comprehensively utilizing multiple types of data, and providing richer and more accurate information processing and interactive experience.
[0050] In an optional implementation, the state information and the atmosphere information are input into the second model, and the index value of the atmosphere index corresponding to the atmosphere component is generated by the second model, which may specifically include the following steps S231 to S232:
[0051] Step S231, encapsulating the state information and atmosphere information into prompt words.
[0052] Step S232: input the prompt word into the second model, so that the second model parses the atmosphere information and outputs the index value of the atmosphere index corresponding to the atmosphere component indicated by the status information.
[0053] Exemplarily, the atmosphere information output by the first model and the status information of the preset atmosphere components are encapsulated as prompt words, which can be expressed as: This is a virtual scene, and the status information of the light source components is shared [DirectionalLight: (0, 0, 0), SpotLight: (328, 658, 206), RectLight: (0, 0, -70), SkyLight: (3953281908, 17400463091, 0), ... ], Atmosphere information of the virtual scene [main light source type: sun, main light source angle: southeast direction, height 30-40 degrees, main light source intensity: 6000-7000 lumens, volume fog density: 0.2-0.3 (full density is 1), volume fog height: 2-3 meters above the ground, volume fog color: light blue and white (RGB: 220,225,255), cloud coverage: 10-20%, cloud type: cumulus clouds, thin and transparent, ...], now you need to adjust the indicator values of the atmosphere indicators corresponding to each light source component. The prompt word is input into the second model, and the second model will parse the "atmosphere information of the virtual scene [Main light source type: sun, main light source angle: southeast direction, height 30-40 degrees, main light source intensity: 6000-7000 lumens, volume fog density: 0.2-0.3 (full density is 1), volume fog height: 2-3 meters above the ground, volume fog color: light blue and white (RGB: 220,225,255), cloud coverage: 10-20%, cloud type: cumulus cloud, thin and transparent, ...]" and output the status information [Directional Light:(0,0,0)], the index value of the atmosphere index corresponding to the first light source component indicated by the status information [SpotLight:(328,658,206)], the index value of the atmosphere index corresponding to the second light source component indicated by the status information [RectLight:(0,0,-70)], the index value of the atmosphere index corresponding to the third light source component indicated by the status information [SkyLight:(3953281908,17400463091,0)], and the index value of the atmosphere index corresponding to the fourth light source component indicated by the status information [SkyLight:(3953281908,17400463091,0)]. Table 2 exemplarily lists the atmosphere index and index value generated by the second model according to the status information and atmosphere information:
[0054] Table 2 Atmosphere indicators and indicator values generated by the second model
[0055] Atmosphere indicators Index value intensity 2500 light_color (180,190,200) source_angle 8 source_soft_angle 16 use_temperature True temperature 7000 cast_shadows True indirect_lighting_intensity 1.3 volumetric_scattering_intensity 2.5 …… ……
[0056] In an optional implementation, the status information and atmosphere information are input into the second model, and the index value of the atmosphere index corresponding to the atmosphere component is generated by the second model. It can also include: inputting the status information, atmosphere information, and language text into the second model, so that the second model outputs the index value that conforms to the language text for the atmosphere index corresponding to the atmosphere component based on the status information and atmosphere information.
[0057] By using language text as another input data of the second model, together with state information and atmosphere information, the second model can parse the language text while parsing the atmosphere information, and constrain the indicator value with the analysis result of the language text, thereby improving the accuracy of the output data.
[0058] Similarly, the status information, atmosphere information, and language text can be encapsulated as prompt words, and the prompt words can be input into the second model so that the second model can parse the atmosphere information and language text, and output the indicator value of the atmosphere indicator corresponding to the atmosphere component that conforms to the environmental atmosphere described by the language text.
[0059] For example, the prompt word can be expressed as: This is a virtual scene, with the status information of the light source components [DirectionalLight: (0,0,0), SpotLight: (328,658,206), RectLight: (0,0,-70), SkyLight: (3953281908,17400463091,0), ...], and the atmosphere information of the virtual scene [Main light source type: sun, main light source angle: southeast direction, altitude 30-40 degrees, main light intensity: 6000-7000 lumens, volume fog density: 0.2-0.3 (full density is 1), volume fog height: 2-3 meters above the ground, volume fog color: light blue and white (RGB: 220,225,255), cloud coverage: 10-20%, cloud type: cumulus, thin and transparent, ...], now you need to adjust the indicator value of the atmosphere indicator corresponding to the light source component. The indicator value needs to conform to the environmental atmosphere described by [Two orioles sing in the green willows, a line of egrets fly in the blue sky].
[0060] Step S240, adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0061] After the index value of the atmosphere index corresponding to the preset atmosphere component in the virtual scene is generated based on the second model, the index value can be assigned to the atmosphere index of the corresponding atmosphere component in the rendering engine, or the current index value of the atmosphere index of the corresponding atmosphere component in the rendering engine can be replaced. The rendering engine can render the corresponding environmental atmosphere in the virtual scene based on the atmosphere index and index value of the atmosphere component. Since the atmosphere index and index value of the atmosphere component are essentially generated based on the language text input by the user, the environmental atmosphere rendered based on the atmosphere index and index value of the atmosphere component is consistent with the language text, that is, consistent with the environmental atmosphere expected by the user contained in the language text.
[0062] In an optional implementation, the index value output by the second model is not restricted, and therefore, may exceed the index value range built into the rendering engine, resulting in rendering errors in the rendering engine. Based on this, before the step of adjusting the atmosphere index corresponding to the atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, the method provided by this implementation may also include the following steps: determining whether the index value of the atmosphere index corresponding to the atmosphere component is within the preset threshold range of the atmosphere index corresponding to the atmosphere component in the rendering engine.
[0063] Optionally, based on a preset mapping function, it is detected whether the index value of the atmosphere index output by the second model needs to be mapped. When it is detected that the index value exceeds the index value range of the atmosphere index in the rendering engine, it is determined that the index value needs to be mapped. When it is detected that the index value does not exceed the index value range of the atmosphere index in the rendering engine, it is determined that the index value does not need to be mapped. In this embodiment, the index value range built into the rendering engine for the atmosphere index is defined as a preset threshold range.
[0064] Specifically, adjusting the atmosphere indicator of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere indicator corresponding to the atmosphere component may include: in response to the index value of the atmosphere indicator corresponding to the first atmosphere component being within a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, adjusting the atmosphere indicator of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere indicator corresponding to the first atmosphere component, the first atmosphere component being any one of multiple atmosphere components.
[0065] In an optional implementation, after determining that the indicator value needs to be mapped, the method provided in this embodiment may further include the following steps: in response to the indicator value of the atmosphere indicator corresponding to the second atmosphere component exceeding the preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, mapping the indicator value of the atmosphere indicator corresponding to the second atmosphere component according to preset mapping parameters, the second atmosphere component being any one of multiple atmosphere components.
[0066] Exemplarily, the index value output by the second model for the illumination intensity (atmosphere index) corresponding to the main light source component is 100, and the preset threshold range of the illumination intensity corresponding to the main light source component in the rendering engine is 0-10. Since the index value 100 of the illumination intensity output by the second model exceeds the preset threshold range of the illumination intensity in the rendering engine, it is necessary to map the index value 100 of the illumination intensity output by the second model. According to the preset mapping parameter 0.1, the index value 100 is mapped to the index value 10.
[0067] Based on this, adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component may include: adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the mapped second atmosphere component.
[0068] The above is a description of the various optional implementations of the method for generating an environmental atmosphere in a virtual scene provided by the present embodiment. The method is based on the first model and the second model, and generates index values of each atmosphere index corresponding to each atmosphere component through the language text preset by the user and the status information of each atmosphere component preset in the virtual scene, thereby adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of each atmosphere index corresponding to each atmosphere component, so that the rendering engine renders an environmental atmosphere in the virtual scene that conforms to the language text preset by the user based on the index value of the atmosphere index of each atmosphere component after adjustment. It should be noted that the first model and the second model can be deployed in one service device, or they can be deployed in different service devices respectively, and can be freely configured according to the load of the service device itself and the amount of data processing in the process of generating the environmental atmosphere, and there is no restriction here.
[0069] In an optional implementation provided by this embodiment, the second model needs to be trained before use, so that the second model can generate atmosphere indicators and indicator values corresponding to the atmosphere components based on the analysis of the atmosphere information. That is, the second model needs to learn how to convert the atmosphere parameters and parameter values output by the first model into atmosphere indicators and indicator values understood by the rendering engine.
[0070] Based on this, in an optional implementation, the method provided in this embodiment may further include the following steps S201 to S203:
[0071] Step S201, obtaining a training sample set, the training sample set includes multiple training samples, the training samples include training data and training labels, the training data includes atmosphere parameters and parameter values preset for the atmosphere parameters, the training labels include atmosphere indicators corresponding to the atmosphere parameters in the rendering engine and indicator values corresponding to the atmosphere indicators marked according to the parameter values.
[0072] Step S202, input the training sample into the second model to be trained, and obtain the prediction label generated by the second model to be trained according to the training data in the training sample, wherein the prediction label includes the atmosphere index corresponding to the atmosphere parameter predicted by the second model to be trained in the rendering engine, and the index value corresponding to the predicted parameter value.
[0073] Step S203: training the second model to be trained according to the training labels corresponding to the training samples and the prediction labels generated by the second model to be trained based on the training samples to generate a trained second model.
[0074] The training sample set can be pre-built by the developer. Each training sample in the training sample set includes two parts, one part is training data and the other part is training label. During the training process, the training data is used as the input data of the second model to be trained, and the predicted label output by the second model to be trained based on the training data is obtained. Furthermore, the predicted label is used as the predicted value, and the training label in the training sample is used as the true value, so as to train the second model to be trained for the purpose of making the predicted value close to the true value.
[0075] Exemplarily, the training sample can be represented as {[light intensity: 6000-7000 lumens], [indirect_lighting_intensity: 1.3]}, where [light intensity: 6000-7000 lumens] is the training data and [indirect_lighting_intensity: 1.3] is the training label. During the training process, the training data [light intensity: 6000-7000 lumens] is input into the second model to be trained, and the second model to be trained will predict the atmosphere index [A] corresponding to the atmosphere parameter [light intensity] in the rendering engine and the index value [B] of the atmosphere index [A] corresponding to the parameter value [6000-7000 lumens] based on the training data [light intensity: 6000-7000 lumens]. The second model to be trained is trained by making the atmosphere index [A] close to the atmosphere index [indirect_lighting_intensity] in the training label and making the index value [B] close to the index value [1.3] in the training label.
[0076] In an optional implementation, the second model to be trained includes a base model and an optimizer.
[0077] The basic model can be understood as a pre-trained large language model, and the optimizer can be understood as a low-rank matrix added on the basis of the large language model. Normally, training a model means updating the parameters included in the model. For a large language model, the model parameters are too large. Updating the model parameters of a large language model will result in a large amount of computational overhead and memory occupancy. Therefore, the LoRA (Low-Rank Adaptation) method can be used to add a low-rank matrix on the basis of the large language model. By updating the parameter weights in the low-rank matrix, the training effect of the large language model can be achieved. The number of parameters in the low-rank matrix is much less than the model parameters in the large language model. This method can make model training more efficient.
[0078] Based on this, the second model to be trained is trained according to the training labels corresponding to the training samples and the predicted labels generated by the second model to be trained based on the training samples. Specifically, it may include: adjusting the parameter weights of the optimizer according to the training labels corresponding to the training samples and the predicted labels generated by the second model to be trained based on the training samples.
[0079] Optionally, use Deepspeed ZeRO-2 to fine-tune the model LoRA. Deepspeed is a deep learning optimization library designed to improve the speed and efficiency of model training. Deepspeed provides a series of optimization techniques, including ZeRO (Zero Redundancy Optimizer). ZeRO is an optimization technique that significantly reduces memory usage in distributed training by eliminating data redundancy. It includes multiple stages, among which ZeRO-2 not only optimizes parameter storage, but also optimizes the storage of gradients and optimizer states, greatly reducing memory requirements without sacrificing computational efficiency, thereby allowing larger models to be trained.
[0080] In an optional implementation, the method provided in this embodiment may also include the following steps: in response to the trained second model reaching a preset training target, merging the parameter weights of the optimizer with the parameter weights of the basic model to generate a trained second model.
[0081] The training target may be a preset target number of iterations for the number of iterations during training, such as 30 times, or may be a preset error rate threshold for the predicted label output by the second model to be trained, such as 45%.
[0082] The second model after training achieves the training goal. For example, the number of iterative training times reaches 30 times and the error rate of the predicted label compared with the training label is less than 45%, which means that the model training has been completed. The parameter weights of the optimizer can be merged with the parameter weights of the basic model to form a second model that has completed training.
[0083] The merging of parameter weights is usually achieved through matrix multiplication or addition operations, that is, matrix multiplication or addition operations are performed on the parameter weights of the optimizer (low-rank matrix) and the parameter weights of the basic model (high-rank matrix), and the transformed weights are updated back to the basic model, so that the basic model includes the improvements brought about by training. In this embodiment, the basic model after the parameter weights are merged is the second model that has been trained.
[0084] An optional implementation of the method for generating an environmental atmosphere in a virtual scene described in this embodiment is provided below. Figure 3 It is a flowchart of the method for generating an environmental atmosphere in a virtual scene provided in this embodiment.
[0085] like Figure 3 As shown, the method for generating an environmental atmosphere in a virtual scene provided in this embodiment includes the following steps:
[0086] Step S301, obtaining a user preset language text 311 from the user terminal 331. For example, two orioles sing in the green willows, and a line of egrets fly in the blue sky.
[0087] Step S302, obtaining state information 312 of preset atmosphere components in the virtual scene from the rendering engine 332, such as the types of light source components, atmosphere components, volumetric fog components, post-processing components, particle components, reflection components, etc. and their positions in the virtual scene.
[0088] Step S303, input the language text 311 into the first model 321, and obtain the atmosphere information 313 (including atmosphere parameters and parameter values) of the environment atmosphere described by the language text 311 output by the first model 321. For example, input "two orioles sing in the green willows, a line of egrets fly in the blue sky" into the Llama 3 model, and the Llama 3 model outputs the atmosphere information (atmosphere parameter A-parameter value a) of the environment atmosphere described by "two orioles sing in the green willows, a line of egrets fly in the blue sky".
[0089] Step S304, input the atmosphere information 313 and the state information 312 of the atmosphere component output by the first model 321 into the second model 322, and obtain the atmosphere index and index value 314 corresponding to the atmosphere component output by the second model 322. For example, the atmosphere information (atmosphere parameter A-parameter value a) and the type of the light source component and the position in the virtual scene are input into the LLaVA-3 model, and the LLaVA-3 model outputs the atmosphere index B and index value b corresponding to the light source component.
[0090] Step S305, according to the preset mapping parameters, the index value 314 of the atmosphere index corresponding to the atmosphere component output by the second model 322 is mapped so that the index value 315 of the mapped atmosphere index is located in the preset threshold range of the atmosphere index of the corresponding atmosphere component in the rendering engine. For example, the index value b corresponding to the atmosphere index B is mapped to the index value c.
[0091] Step S306, according to the index value 315 of the atmosphere index corresponding to the mapped atmosphere component, the atmosphere index of the corresponding atmosphere component in the rendering engine 332 is updated, so that the rendering engine 332 renders the environment atmosphere that conforms to the language text based on the atmosphere index corresponding to the updated atmosphere component. For example, the index value c is used to update the index value corresponding to the atmosphere index B in the rendering engine, and the rendering engine renders the environment atmosphere that conforms to "two orioles sing in the green willows, and a line of egrets fly in the blue sky" based on the atmosphere index B-index value c.
[0092] The above-mentioned first embodiment provides a method for generating an environmental atmosphere in a virtual scene, which has the following advantages: First, the method can generate the index values of the atmosphere indicators corresponding to each preset atmosphere component in the virtual scene based on the language text, and does not require developers to manually set these atmosphere indicators, which significantly reduces the workload and working hours of developers, thereby reducing the development cost of virtual applications that deploy the environmental atmosphere and improving the development efficiency of the virtual application. Second, the method can enable the rendering engine to render an environmental atmosphere that conforms to the language text based on the language text, and does not require developers to have excessively high professional knowledge, which reduces the threshold for use and is more user-friendly, especially for novice users. Third, the method generates the index values of the atmosphere indicators corresponding to each preset atmosphere component in the virtual scene based on the language text and the model. Due to the randomness of the model and the controllable language text, it can often inspire the creativity of developers, thereby achieving unexpected environmental atmosphere rendering effects.
[0093] It should be noted that the examples in the first embodiment are only for explaining the method described in this application and are not intended to be limiting for actual use. The method for generating the environmental atmosphere in the virtual scene provided in this application includes but is not limited to the method described in the first embodiment.
[0094] The second embodiment of the present application provides a system for generating an environmental atmosphere in a virtual scene. Figure 4 Schematic diagram of a system for generating an environmental atmosphere in a virtual scene provided in this embodiment.
[0095] like Figure 4 As shown, the system for generating an environmental atmosphere in a virtual scene provided by this embodiment includes: a client 410 and a server 420 .
[0096] The client 410 is used to provide a language text input interface.
[0097] In an optional implementation, the client 410 is a user interface that allows the user to input language text, which includes interface elements such as text boxes, buttons, and drop-down menus, which are not specifically limited.
[0098] The server 420 includes a first acquisition module 421 , a second acquisition module 422 , a first processing module 423 , a second processing module 424 , and an indicator adjustment module 425 .
[0099] The first acquisition module 421 is used to acquire the language text input by the user from the client 420 .
[0100] The second acquisition module 422 is used to acquire the status information of the atmosphere component preset in the virtual scene from the rendering engine.
[0101] The first processing module 423 is used to input the language text into the first model, and generate atmosphere information of the environmental atmosphere described by the language text through the first model. The atmosphere information includes preset atmosphere parameters for describing the environmental atmosphere and parameter values corresponding to the atmosphere parameters.
[0102] The second processing module 424 is used to input the state information and the atmosphere information into a second model, and generate an indicator value of the atmosphere indicator corresponding to the atmosphere component through the second model.
[0103] The indicator adjustment module 425 is used to adjust the atmosphere indicator of the corresponding atmosphere component in the rendering engine according to the indicator value of the atmosphere indicator corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere indicator of the atmosphere component.
[0104] The third embodiment of the present application provides a device for generating an environmental atmosphere in a virtual scene. Figure 5 It is a schematic diagram of the structure of a device for generating an environmental atmosphere in a virtual scene provided in this embodiment.
[0105] like Figure 5 As shown, the device for generating an environmental atmosphere in a virtual scene provided by this embodiment includes: an acquisition unit 501 , a first generation unit 502 , a second generation unit 503 , and an adjustment unit 504 .
[0106] The acquisition unit 501 is used to acquire the language text and the status information of the atmosphere component preset in the virtual scene.
[0107] Optionally, the state information of the atmosphere component includes the type of the atmosphere component and the position of the atmosphere component in the virtual scene.
[0108] The first generating unit 502 is used to input the language text into a first model, and generate atmosphere information of the environmental atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environmental atmosphere and parameter values corresponding to the atmosphere parameters.
[0109] Optionally, the step of inputting the language text into a first model and generating atmosphere information of the environment atmosphere described by the language text through the first model includes:
[0110] Encapsulating the language text and the atmosphere parameter into prompt words;
[0111] The prompt word is input into the first model so that the first model parses the language text and generates at least a parameter value for the atmosphere parameter.
[0112] The second generating unit 503 is used to input the state information and the atmosphere information into a second model, and generate an index value of the atmosphere index corresponding to the atmosphere component through the second model.
[0113] Optionally, the inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model, includes:
[0114] The state information, the atmosphere information, and the language text are input into the second model, so that the second model outputs an indicator value that conforms to the language text for the atmosphere indicator corresponding to the atmosphere component according to the state information and the atmosphere information.
[0115] Optionally, the inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model, includes:
[0116] Encapsulating the state information and the atmosphere information into prompt words;
[0117] The prompt word is input into the second model so that the second model parses the atmosphere information and outputs the indicator value of the atmosphere indicator corresponding to the atmosphere component indicated by the status information.
[0118] The adjustment unit 504 is used to adjust the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0119] Optionally, before the step of adjusting the atmosphere index corresponding to the atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, it is also used to:
[0120] Determine whether the index value of the atmosphere index corresponding to the atmosphere component is within a preset threshold range of the atmosphere index corresponding to the atmosphere component in the rendering engine;
[0121] The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes:
[0122] In response to an index value of the atmosphere indicator corresponding to a first atmosphere component being within a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, the atmosphere indicator of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere indicator corresponding to the first atmosphere component, and the first atmosphere component is any one of the atmosphere components.
[0123] Optionally, also used for:
[0124] In response to an indicator value of the atmosphere indicator corresponding to the second atmosphere component exceeding a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, mapping the indicator value of the atmosphere indicator corresponding to the second atmosphere component according to a preset mapping parameter, the second atmosphere component being any one of the atmosphere components;
[0125] The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes:
[0126] The atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere index corresponding to the mapped second atmosphere component.
[0127] Optionally, the device further includes a model training unit; the model training unit is used to:
[0128] Acquire a training sample set, the training sample set comprising a plurality of training samples, the training samples comprising training data and training labels, the training data comprising an atmosphere parameter and a parameter value preset for the atmosphere parameter, the training label comprising an atmosphere index corresponding to the atmosphere parameter in the rendering engine and an index value corresponding to the atmosphere index marked according to the parameter value;
[0129] Inputting the training sample into the second model to be trained, obtaining a prediction label generated by the second model to be trained according to the training data in the training sample, the prediction label including an atmosphere index corresponding to the atmosphere parameter predicted by the second model to be trained in the rendering engine, and an index value corresponding to the predicted parameter value;
[0130] The second model to be trained is trained according to the training labels corresponding to the training samples and the predicted labels generated by the second model to be trained based on the training samples to generate the trained second model.
[0131] Optionally, the second model to be trained includes a base model and an optimizer;
[0132] The step of training the second model to be trained according to the training label corresponding to the training sample and the prediction label generated by the second model to be trained based on the training sample includes:
[0133] The parameter weight of the optimizer is adjusted according to the training label corresponding to the training sample and the predicted label generated by the second model to be trained based on the training sample.
[0134] Optionally, also used for:
[0135] In response to the second model after training reaching a preset training target, the parameter weights of the optimizer are merged with the parameter weights of the basic model to generate the second model that has completed training.
[0136] A fourth embodiment of the present application provides a terminal device, Figure 6 It is a schematic diagram of the structure of the electronic device provided in this embodiment.
[0137] like Figure 6 As shown, the electronic device provided in this embodiment includes: a memory 601 and a processor 602;
[0138] The memory 601 is used to store computer instructions for executing a method for generating an environmental atmosphere in a virtual scene;
[0139] The processor 602 is configured to execute computer instructions stored in the memory 601 to perform the following operations:
[0140] Obtaining language text and status information of atmosphere components preset in the virtual scene;
[0141] Inputting the language text into a first model, and generating atmosphere information of the environment atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environment atmosphere and parameter values corresponding to the atmosphere parameters;
[0142] Inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model;
[0143] The atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
[0144] Optionally, the state information of the atmosphere component includes the type of the atmosphere component and the position of the atmosphere component in the virtual scene.
[0145] Optionally, the step of inputting the language text into a first model and generating atmosphere information of the environment atmosphere described by the language text through the first model includes:
[0146] Encapsulating the language text and the atmosphere parameter into prompt words;
[0147] The prompt word is input into the first model so that the first model parses the language text and generates at least a parameter value for the atmosphere parameter.
[0148] Optionally, the inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model, includes:
[0149] The state information, the atmosphere information, and the language text are input into the second model, so that the second model outputs an indicator value that conforms to the language text for the atmosphere indicator corresponding to the atmosphere component according to the state information and the atmosphere information.
[0150] Optionally, before the step of adjusting the atmosphere index corresponding to the atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, the following steps are further performed:
[0151] Determine whether the index value of the atmosphere index corresponding to the atmosphere component is within a preset threshold range of the atmosphere index corresponding to the atmosphere component in the rendering engine;
[0152] The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes:
[0153] In response to an index value of the atmosphere indicator corresponding to a first atmosphere component being within a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, the atmosphere indicator of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere indicator corresponding to the first atmosphere component, and the first atmosphere component is any one of the atmosphere components.
[0154] Optionally, also execute:
[0155] In response to an indicator value of the atmosphere indicator corresponding to the second atmosphere component exceeding a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, mapping the indicator value of the atmosphere indicator corresponding to the second atmosphere component according to a preset mapping parameter, the second atmosphere component being any one of the atmosphere components;
[0156] The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes:
[0157] The atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere index corresponding to the mapped second atmosphere component.
[0158] Optionally, also execute:
[0159] Acquire a training sample set, the training sample set comprising a plurality of training samples, the training samples comprising training data and training labels, the training data comprising an atmosphere parameter and a parameter value preset for the atmosphere parameter, the training label comprising an atmosphere index corresponding to the atmosphere parameter in the rendering engine and an index value corresponding to the atmosphere index marked according to the parameter value;
[0160] Inputting the training sample into the second model to be trained, obtaining a prediction label generated by the second model to be trained according to the training data in the training sample, the prediction label including an atmosphere index corresponding to the atmosphere parameter predicted by the second model to be trained in the rendering engine, and an index value corresponding to the predicted parameter value;
[0161] The second model to be trained is trained according to the training labels corresponding to the training samples and the predicted labels generated by the second model to be trained based on the training samples to generate the trained second model.
[0162] Optionally, the second model to be trained includes a base model and an optimizer;
[0163] The step of training the second model to be trained according to the training label corresponding to the training sample and the prediction label generated by the second model to be trained based on the training sample includes:
[0164] The parameter weight of the optimizer is adjusted according to the training label corresponding to the training sample and the predicted label generated by the second model to be trained based on the training sample.
[0165] Optionally, also execute:
[0166] In response to the second model after training reaching a preset training target, the parameter weights of the optimizer are merged with the parameter weights of the basic model to generate the second model that has completed training.
[0167] Optionally, the inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model, includes:
[0168] Encapsulating the state information and the atmosphere information into prompt words;
[0169] The prompt word is input into the second model so that the second model parses the atmosphere information and outputs the indicator value of the atmosphere indicator corresponding to the atmosphere component indicated by the status information.
[0170] The fifth embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed by a processor, they are used to implement the methods described in the embodiments of the present application.
[0171] It should be noted that the relational terms such as "first" and "second" in this article are only used to distinguish one entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. In addition, the words "include", "have", "include" and "includes" and other similar forms are the same in meaning, and the end of any one or more items after any of the above words is open-ended, and any of the above nouns does not mean that the one or more items have been exhaustively listed or are limited to the one or more items listed.
[0172] As used herein, unless expressly stated otherwise, the term "or" includes all possible combinations, except those that are not feasible. For example, if it is expressed that a database may include A or B, then unless otherwise specifically stated or not feasible, it may include database A, or B, or A and B. As a second example, if it is expressed that a database may include A, B, or C, then unless otherwise specifically stated or not feasible, the database may include database A, or B, or C, or A and B, or A and C, or B and C, or A, B, and C.
[0173] It is worth noting that the above embodiments can be implemented by hardware or software (program code), or a combination of hardware and software. If implemented by software, it can be stored in the above-mentioned computer-readable medium. When the software is executed by a processor, it can execute the above-mentioned disclosed method. The computing unit and other functional units described in the present disclosure can be implemented by hardware or software, or a combination of hardware and software. Those of ordinary skill in the art will also understand that the above-mentioned multiple modules / units can be combined into one module / unit, and each of the above-mentioned modules / units can be further divided into multiple sub-modules / sub-units.
[0174] In the above detailed description, the embodiments have been described with reference to many specific details, which may vary from implementation to implementation. Certain adaptations and modifications may be made to the embodiments. For those skilled in the art, other embodiments may be readily apparent from the specific embodiments disclosed in the present application. This specification and examples are for exemplary purposes only, and the true scope and essence of the present application are described by the claims. The sequence of steps shown in the diagrams is also for the purpose of explanation only and is not intended to be limited to any particular steps or sequence. Therefore, those skilled in the art will appreciate that these steps may be performed in different orders when implementing the same method.
[0175] In the drawings and detailed description of the present application, exemplary embodiments are disclosed. However, many variations and modifications may be made to these embodiments. Accordingly, although specific terms are used, these terms are only general and descriptive, and not for the purpose of limitation.
Claims
1. A method for generating an environmental atmosphere in a virtual scene, characterized in that: The method comprises: Obtaining language text and status information of atmosphere components preset in the virtual scene; Inputting the language text into a first model, and generating atmosphere information of the environment atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environment atmosphere and parameter values corresponding to the atmosphere parameters; Inputting the state information and the atmosphere information into a second model, and generating an index value of the atmosphere index corresponding to the atmosphere component through the second model; The atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
2. The method according to claim 1, characterized in that The state information of the atmosphere component includes the type of the atmosphere component and the position of the atmosphere component in the virtual scene.
3. The method according to claim 1, characterized in that The step of inputting the language text into a first model and generating atmosphere information of the environment atmosphere described by the language text through the first model includes: Encapsulating the language text and the atmosphere parameter into prompt words; The prompt word is input into the first model so that the first model parses the language text and generates at least a parameter value for the atmosphere parameter.
4. The method according to claim 1, characterized in that: The step of inputting the state information and the atmosphere information into a second model and generating an indicator value of the atmosphere indicator corresponding to the atmosphere component through the second model includes: The state information, the atmosphere information, and the language text are input into the second model, so that the second model outputs an indicator value that conforms to the language text for the atmosphere indicator corresponding to the atmosphere component according to the state information and the atmosphere information.
5. The method according to claim 1, characterized in that Before the step of adjusting the atmosphere index corresponding to the atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, the method further includes: Determine whether the index value of the atmosphere index corresponding to the atmosphere component is within a preset threshold range of the atmosphere index corresponding to the atmosphere component in the rendering engine; The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes: In response to an index value of the atmosphere indicator corresponding to a first atmosphere component being within a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, the atmosphere indicator of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere indicator corresponding to the first atmosphere component, and the first atmosphere component is any one of the atmosphere components.
6. The method according to claim 5, characterized in that The method further comprises: In response to an indicator value of the atmosphere indicator corresponding to the second atmosphere component exceeding a preset threshold range of the atmosphere indicator of the corresponding atmosphere component in the rendering engine, mapping the indicator value of the atmosphere indicator corresponding to the second atmosphere component according to a preset mapping parameter, the second atmosphere component being any one of the atmosphere components; The adjusting the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component includes: The atmosphere index of the corresponding atmosphere component in the rendering engine is adjusted according to the index value of the atmosphere index corresponding to the mapped second atmosphere component.
7. The method according to claim 1, characterized in that The method further comprises: Acquire a training sample set, the training sample set comprising a plurality of training samples, the training samples comprising training data and training labels, the training data comprising an atmosphere parameter and a parameter value preset for the atmosphere parameter, the training label comprising an atmosphere index corresponding to the atmosphere parameter in the rendering engine and an index value corresponding to the atmosphere index marked according to the parameter value; Inputting the training sample into the second model to be trained, obtaining a prediction label generated by the second model to be trained according to the training data in the training sample, the prediction label including an atmosphere index corresponding to the atmosphere parameter predicted by the second model to be trained in the rendering engine, and an index value corresponding to the predicted parameter value; The second model to be trained is trained according to the training labels corresponding to the training samples and the predicted labels generated by the second model to be trained based on the training samples to generate the trained second model.
8. The method according to claim 7, characterized in that The second model to be trained includes a base model and an optimizer; The step of training the second model to be trained according to the training label corresponding to the training sample and the prediction label generated by the second model to be trained based on the training sample includes: The parameter weight of the optimizer is adjusted according to the training label corresponding to the training sample and the predicted label generated by the second model to be trained based on the training sample.
9. The method according to claim 8, characterized in that The method further comprises: In response to the second model after training reaching a preset training target, the parameter weights of the optimizer are merged with the parameter weights of the basic model to generate the second model that has completed training.
10. The method according to claim 1, characterized in that The step of inputting the state information and the atmosphere information into a second model and generating an indicator value of the atmosphere indicator corresponding to the atmosphere component through the second model includes: Encapsulating the state information and the atmosphere information into prompt words; The prompt word is input into the second model so that the second model parses the atmosphere information and outputs the indicator value of the atmosphere indicator corresponding to the atmosphere component indicated by the status information.
11. A system for generating an environmental atmosphere in a virtual scene, characterized in that: The system includes a client and a server; The client is used to provide an input interface for language text; The server includes a first acquisition module, a second acquisition module, a first processing module, a second processing module, and an indicator adjustment module; The first acquisition module is used to acquire the language text input by the user from the client; The second acquisition module is used to acquire the status information of the atmosphere component preset in the virtual scene from the rendering engine; The first processing module is used to input the language text into a first model, and generate atmosphere information of the environment atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environment atmosphere and parameter values corresponding to the atmosphere parameters; The second processing module is used to input the state information and the atmosphere information into a second model, and generate an index value of the atmosphere index corresponding to the atmosphere component through the second model; The indicator adjustment module is used to adjust the atmosphere indicator of the corresponding atmosphere component in the rendering engine according to the indicator value of the atmosphere indicator corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere indicator of the atmosphere component.
12. A device for generating an environmental atmosphere in a virtual scene, characterized in that: The device comprises: an acquisition unit, a first generation unit, a second generation unit, and an adjustment unit; The acquisition unit is used to acquire the language text and the status information of the atmosphere component preset in the virtual scene; The first generating unit is used to input the language text into a first model, and generate atmosphere information of the environment atmosphere described by the language text through the first model, wherein the atmosphere information includes preset atmosphere parameters for describing the environment atmosphere and parameter values corresponding to the atmosphere parameters; The second generating unit is used to input the state information and the atmosphere information into a second model, and generate an index value of the atmosphere index corresponding to the atmosphere component through the second model; The adjustment unit is used to adjust the atmosphere index of the corresponding atmosphere component in the rendering engine according to the index value of the atmosphere index corresponding to the atmosphere component, so that the rendering engine renders an environmental atmosphere that conforms to the language text in the virtual scene based on the adjusted atmosphere index of the atmosphere component.
13. An electronic device, characterized in that: include: Memory, processor; The memory is used to store one or more computer instructions; The processor is used to execute the one or more computer instructions to implement the method according to any one of claims 1-10.
14. A computer-readable storage medium having one or more computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the method according to any one of claims 1 to 10 is performed.