Point light source effect processing method and device
By creating high dynamic range imaging maps and reflection balls in the game scene instead of real-time point light sources, the performance consumption and rendering speed issues of lighting effect processing in mobile games are solved, efficient point light effect processing is achieved, and the smoothness of the game is improved.
Patent Information
- Application Number
- CN202210484598.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-05-06
AI Technical Summary
Existing scene lighting effect processing methods in mobile games have problems such as high performance consumption, slow rendering speed, and inability to meet high lighting effect requirements. Especially when the camera changes frequently in the game scene outside the game, the real-time lighting method causes game lag.
By making high dynamic range imaging maps and reflection balls corresponding to the target point light effects in the game scene, the real-time point light sources in the game scene are replaced, including obtaining scene model data, making high dynamic range imaging maps, capturing reflection ball information and setting reflection balls in the game scene to replace the target point light sources.
While satisfying the point light effect in the game scene, it reduces performance consumption and improves the smoothness and rendering speed of the game.
Smart Images

Figure CN115063521B_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 processing point light effects. Background Art
[0002] With the development of mobile communication technology and the diversification of terminal functions, the demand for various types of image processing on touch terminals such as mobile phones and tablets is increasing. A typical example is image processing in online games. Many game scenes involve complex and rich scene lighting, which can make the game scenes more beautiful.
[0003] Existing methods for processing scene lighting effects primarily use real-time lighting. This involves adding light sources to an image based on the scene's needs and then calculating the lighting effects produced by these light sources in real time during the rendering process. This approach produces good lighting effects, but the need to calculate the lighting effects during the rendering process can slow down rendering.
[0004] To address this issue, existing technologies use baked light maps, which bake the scene's lighting information into a scene map, replacing the scene lights. While this method provides stable lighting information and offers good performance, it cannot meet the lighting requirements of certain scenes with high lighting requirements and frequent camera changes, such as the draft lobby outside of a game. Summary of the Invention
[0005] The present application provides a point light source effect processing method and device to solve the technical problems of existing scene lighting effect processing methods such as high performance consumption, slow rendering speed and inability to meet high lighting effect requirements.
[0006] The present invention provides a method for processing a point light source effect, including:
[0007] Get the scene model data corresponding to the game scene under the target point light source;
[0008] Producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model related data;
[0009] Using a reflection ball to capture target point light source information in the high dynamic range imaging map, and obtaining a high dynamic range imaging map reflection ball;
[0010] The high dynamic range imaging map reflection ball is set in the game scene to replace the target point light source in the game scene.
[0011] Optionally, obtaining scene model related data corresponding to the game scene under the target point light source includes: exporting the scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model from a game engine.
[0012] Optionally, the step of obtaining scene model related data corresponding to the game scene under the target point light source further includes: preprocessing the scene model and camera parameters corresponding to the scene model.
[0013] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model includes: deleting model elements in the scene model that are not related to the target point light source effect.
[0014] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model further includes: adjusting parameter values of the camera parameters corresponding to the scene model.
[0015] Optionally, the step of producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model related data includes:
[0016] Acquire a high dynamic range imaging picture corresponding to a target point light source effect in the game scene;
[0017] The high dynamic range imaging picture is adjusted according to the scene model to obtain the high dynamic range imaging map.
[0018] Optionally, the step of using a reflection ball to capture target point light source information in the high dynamic range imaging map to obtain the high dynamic range imaging map reflection ball includes:
[0019] Importing the high dynamic range imaging map into a game engine;
[0020] The high dynamic range imaging map is matched with the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
[0021] Optionally, setting the high dynamic range imaging map reflective ball in the game scene to replace the target point light source in the game scene includes:
[0022] In the game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
[0023] Optionally, after performing the step of setting the high dynamic range imaging map reflective ball at a preset position in the game scene, further performing the following steps:
[0024] Adjusting the game scene in which the high dynamic range imaging map reflective ball is set to achieve a target point light source effect in the game scene under the target point light source;
[0025] Acquire the game scene in which the target point light source is replaced by the high dynamic range imaging map reflection ball.
[0026] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, including: adjusting the setting parameters of the high dynamic range imaging map reflection ball in the game engine.
[0027] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, and also includes: adjusting the object material of the high dynamic range imaging map reflection ball arranged in the game scene.
[0028] The embodiment of the present application also provides a point light source effect processing device, comprising: an acquisition unit, a mapping production unit, a reflection ball production unit, and a setting unit;
[0029] The acquisition unit is used to acquire scene model related data corresponding to the game scene under the target point light source;
[0030] The texture production unit is used to produce a high dynamic range imaging texture corresponding to the target point light source effect in the game scene according to the scene model related data;
[0031] The reflection ball production unit is used to capture the target point light source information in the high dynamic range imaging map using a reflection ball to obtain the high dynamic range imaging map reflection ball;
[0032] The setting unit is used to set the high dynamic range imaging map reflection ball in the game scene to replace the target point light source in the game scene.
[0033] An embodiment of the present application further provides an electronic device, comprising: a memory and a processor;
[0034] The memory is used to store one or more computer instructions;
[0035] The processor is configured to execute the one or more computer instructions to implement the above method.
[0036] An embodiment of the present application also provides a computer-readable storage medium on which one or more computer instructions are stored, and the instructions are executed by a processor to implement the above method.
[0037] Compared with the prior art, the point light effect processing method provided by this application includes: obtaining scene model related data corresponding to the game scene under the target point light source; producing a high dynamic range imaging map corresponding to the target point light source effect in the game scene based on the scene model related data; using a reflection ball to capture the target point light source information in the high dynamic range imaging map to obtain a high dynamic range imaging map reflection ball; setting the high dynamic range imaging map reflection ball in the game scene to replace the target point light source in the game scene. This method replaces the target point light source in the game scene by producing a high dynamic range imaging map and a high dynamic range imaging map reflection ball corresponding to the target point light source effect in the game scene. While satisfying the target point light source effect in the game scene, it reduces performance consumption and improves rendering speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is an application scenario diagram of the point light source effect processing method provided in an embodiment of the present application;
[0039] Figure 2 This is a flow chart of a method for processing point light source effects provided by the first embodiment of the present application;
[0040] Figure 3 1 is a comparative schematic diagram of deleting model elements irrelevant to the target point light source effect in the scene model provided by the first embodiment of the present application;
[0041] Figure 4 This is a flow chart of producing a high dynamic range imaging map provided by the first embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of the process of producing a high dynamic range imaging map provided by the first embodiment of the present application;
[0043] Figure 6 This is a flow chart of obtaining a high dynamic range imaging map reflective sphere provided by the first embodiment of the present application;
[0044] Figure 7 2 is a schematic diagram comparing the game scenes before and after the target point light source effect processing provided by the first embodiment of the present application;
[0045] Figure 8 This is a structural diagram of a point light source effect processing device provided in the second embodiment of the present application;
[0046] Figure 9 It is a structural diagram of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION
[0047] The following description sets forth many specific details to facilitate a thorough 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 scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0048] Existing point light effect processing methods include baked light mapping methods and real-time lighting methods.
[0049] Baked light maps are a commonly used method for processing point light sources in game scenes. They can fix the lighting information generated by point light sources in the game scene to the textures of scene object models. This method replaces the real-time lighting in the game scene with baked light maps, reducing the performance consumption of terminal devices. However, baked light maps require that the texture coordinates of the scene object model textures do not overlap and the baked light positions are fixed. This can cause the lighting to appear artificial when the camera is moved.
[0050] Real-time lighting is a method for using point light sources in the original game scene. This method enhances the lighting effects of the game scene by adding point light sources, and can produce corresponding lighting effects as the camera moves. However, real-time lighting is rendered in real time as the game progresses, so real-time lighting calculations are required. For PC games, due to the large amount of computer memory and strong processing power, real-time lighting calculations do not significantly affect game flow. However, for mobile games, due to inherent performance limitations of mobile phones, real-time lighting calculations can consume a certain amount of performance, causing game lag and affecting game flow.
[0051] The baked light map method is widely used in game scenes (for example, the battle interface after the game starts). Since game players focus on controlling the virtual character to participate in the game process, they don't pay too much attention to the details of the surrounding scene. Therefore, the scene in the game does not require much point light effects, and the baked light map method can fully meet the needs.
[0052] However, for certain scenes outside the game (for example, the character selection screen before the game starts), more aesthetically pleasing point light effects are required to showcase the game's advantages and character characteristics to players. These scenes often involve numerous camera changes. Therefore, these scenes outside the game have high requirements for point light effects, and baked light mapping methods are insufficient. Real-time lighting methods are required for lighting. For mobile games, due to inherent performance limitations of mobile phones, real-time lighting methods consume performance, leading to game lag and affecting game smoothness.
[0053] To address the issues with existing point light effect processing methods, this application provides a method for processing point light effects. This method replaces real-time point light sources in game scenes by creating high-dynamic-range imaging maps and high-dynamic-range imaging map reflectors that correspond to the real-time point light effects in the game scene. While satisfying the point light effects in the game scene, it also reduces the performance overhead of real-time point light sources and improves game fluency.
[0054] The lighting effect processing method, device, electronic device and computer-readable storage medium described in this application are further described in detail below with reference to specific embodiments and drawings.
[0055] Figure 1 This is an application scenario diagram of the point light source effect processing method provided by the embodiment of this application. Figure 1 As shown, the point light source effect processing method provided in the embodiment of the present application can be applied to the scene lighting effect processing in the game. Figure 1 The lighting effects processing in the off-game draft lobby scene of a certain game is shown.
[0056] exist Figure 1 The game's off-game draft lobby scene shown uses real-time lighting, creating a more aesthetically pleasing character and scene effect. However, because real-time lighting requires real-time rendering and computation, for mobile games, it can cause the draft lobby scene to drop 2-4 frames per second, resulting in choppy gameplay.
[0057] In this scenario, it is necessary to process the real-time point light sources in the selection hall scene through the point light source effect processing method provided in the embodiment of this application, so as to reduce performance consumption and improve the smoothness of the selection hall scene while satisfying the point light source effect.
[0058] Of course, the point light source effect processing method provided in the embodiment of the present application can also be applied to various fields such as animation production and picture production.
[0059] The first embodiment of the present application provides a method for processing point light source effects.
[0060] Figure 2 This is a flow chart of the point light source effect processing method provided by this embodiment. Figure 2 The point light source effect processing method 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 limiting in actual use.
[0061] like Figure 2 As shown, the point light source effect processing method provided in this embodiment includes the following steps:
[0062] Step S201: Acquire scene model related data corresponding to the game scene under the target point light source.
[0063] The target point light source refers to the point light source in the game scene to be processed with lighting effects; optionally, the point light source can be a virtual point light source or a simulated mapping of the lighting effect of a physical point light source; the point light source can be an LED, an incandescent lamp or any other point light source, which is not specifically limited here.
[0064] The scene model refers to the model corresponding to the game scene. The game scene is a very important component in the game. Game designers will design and produce the game scene model based on the original game scene draft to form the corresponding game scene.
[0065] The scene model related data includes a scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model.
[0066] This embodiment provides an optional method for obtaining game model related data corresponding to the game scene, that is, exporting scene model related parameters (including: scene model and camera parameters corresponding to the scene model) corresponding to the game scene under the target point light source from the game engine.
[0067] You can output the scene model and camera parameters by directly exporting the map as FBX from the game engine. FBX is a file format that allows for the exchange of models, materials, actions, and camera parameters between software such as Max and Maya, leveraging the advantages of these software. Therefore, exporting scene model data in FBX format is the preferred method for obtaining scene model data corresponding to the game scene under the target point light source, as provided in this embodiment.
[0068] Based on the acquired scene model related data corresponding to the game scene under the target point light source, the scene model and the camera parameters corresponding to the scene model may also be preprocessed.
[0069] The preprocessing method includes: deleting model elements in the scene model that are irrelevant to the target point light source effect.
[0070] A game scene usually contains multiple objects, and the scene model corresponding to the game scene naturally contains multiple model elements. Some of these model elements are irrelevant to the target point light effect. Therefore, when processing the point light effect, these model elements irrelevant to the target point light effect can be deleted to reduce the complexity of the scene model. Figure 1The following example illustrates the off-game draft lobby scene. The draft lobby scene includes objects such as the characters, the rockery behind them, and the booth below them. Therefore, the exported scene model will also include multiple model elements, including the character model element, the rockery model element, and the booth model element. The character model element and the rockery model element are unrelated to the target point light effect being processed and do not participate in the design and processing of this point light source. The booth model element, however, is the target of this point light effect processing. Therefore, the character model element and the rockery model element can be deleted from the scene model, leaving only the booth model element.
[0071] Of course, in addition to objects, game scenes also contain various light sources, such as parallel lights, point lights, and skylights. Therefore, the model elements in the scene model corresponding to the game scene include not only object model elements but also light model elements. When processing a target point light effect, light model elements in the scene model that are not related to the target point light effect should also be deleted to prevent irrelevant light from affecting the lighting effect processing.
[0072] Figure 3 3 is a comparative schematic diagram of deleting model elements irrelevant to the target point light source effect in the scene model provided by this embodiment.
[0073] like Figure 3 As shown, 301 is a schematic diagram of the correct display effect of the pre-processed scene model, and 302 and 303 are schematic diagrams of the incorrect display effect of the pre-processed scene model. The pre-processed scene model shown in 301 is Figure 1 In the scene model corresponding to the game scene shown, object model elements such as character model elements, rockery model elements, and stone model elements have been deleted. At the same time, light source model elements such as skylight model elements have also been deleted, and only model elements to be lit, namely booth model elements, have been retained. In the preprocessed scene model shown in 302, skylight model elements that are irrelevant to the target point light source effect targeted by this point light source effect processing have not been deleted. In the preprocessed scene model shown in 303, rockery model elements and stone model elements that are irrelevant to the target point light source effect targeted by this point light source effect processing have not been deleted. If subsequent target point light source effect processing is performed in the preprocessed scene model shown in 302, the processing process will be affected by the skylight, and if subsequent target point light source effect processing is performed in the preprocessed scene model shown in 303, the correct target point light source processing effect cannot be obtained due to the occlusion of stone model elements and the like.
[0074] The preprocessing method further includes: adjusting parameter values of camera parameters corresponding to the scene model.
[0075] Since the camera parameters of the game engine are inconsistent with the camera parameters in the high dynamic range imaging editing software, if the camera parameters corresponding to the scene model are not pre-processed, the lens will be inconsistent when lighting the game scene after the point light effect is processed, and the target point light effects in the game scene will be inconsistent before and after the point light effect is processed.
[0076] Adjusting the camera parameters corresponding to the scene model is generally achieved by setting the corresponding camera parameters of the scene model to the same values as the camera parameters in the game engine in software such as Maya or 3dsmax. For example, if the focal length of the camera in the game engine is 3.6mm, then the scene model can be imported into Maya software and the camera focal length corresponding to the scene model can be adjusted to 3.6mm in Maya. This will ensure that the camera focal length corresponding to the scene model in the high dynamic range imaging editing software is consistent with the camera focal length in the game engine when processing the target point light effect.
[0077] Step S202: creating a high dynamic range imaging map corresponding to the target point light source effect in the game scene based on the scene model related data.
[0078] The High Dynamic Range Imaging (HDR) map is a seamless map created using high dynamic range imaging photos. It can be used for model rendering in architecture, furniture, machinery, film and television, and post-production. It can also be used as an illumination and reflection light source for the rendered model. For example, when rendering highly reflective models such as cars or stainless steel, the HDR map can serve as ambient light, creating a reflector-like illumination effect and making the surface of the rendered object produce ultra-rich and realistic natural reflection effects.
[0079] This embodiment provides an optional method for producing a high dynamic range imaging map, that is, using high dynamic range imaging editing software to produce the high dynamic range imaging map corresponding to the target point light source effect in the game scene.
[0080] The high dynamic range imaging editing software is an important tool for producing high dynamic range imaging photos or maps. HDR Light Studio is a relatively mature high dynamic range imaging editing software.
[0081] Figure 4 This is a flow chart of producing a high dynamic range imaging map provided by this embodiment. Figure 5 This is a schematic diagram of the process of making a high dynamic range imaging map provided by this embodiment. Figure 4 and Figure 5The method provided in this embodiment for producing the high dynamic range imaging map corresponding to the target point light source effect in the game scene using high dynamic range imaging editing software is described in detail.
[0082] like Figure 4 and Figure 5 As shown, the method provided in this embodiment for producing the high dynamic range imaging map corresponding to the target point light source effect in the game scene using high dynamic range imaging editing software includes the following steps:
[0083] Step S202-1: import the scene model 501 into high dynamic range imaging editing software.
[0084] Scene model 501 is the scene model corresponding to the game scene under the target point light source obtained in step S201. Preferably, the scene model imported into the high dynamic range imaging editing software is a preprocessed scene model, including: deleting model elements in the scene model that are not related to the target point light source effect; and also including: adjusting the parameter values of the camera parameters corresponding to the scene model. When the preprocessed scene model is imported into the high dynamic range imaging editing software for target point light source effect processing, it can minimize influencing factors, making the processed target point light source effect more accurate.
[0085] An optional way to import the scene model is to drag the scene model in fbx format directly into high dynamic range imaging editing software (such as HDR Light Studio).
[0086] Step S202-2: Obtain a high dynamic range imaging picture 502 corresponding to the target point light source effect in the game scene.
[0087] The High Dynamic Range Imaging (HDR) image refers to a photo taken using the camera's high dynamic range imaging function. It is a photo with lighting information data in a high dynamic range. The color parameter performance index of ordinary photos is generally 8 bits, while the color parameter performance index of high dynamic range imaging photos is 32 bits. In other words, high dynamic range imaging photos have more grayscale details and richer picture details.
[0088] Typically, HDR images are natural scenery or indoor scenes. HDR editing software also includes many included HDR images. Of course, you can also capture your own HDR images if needed. For example, if the target point light source in a game scene has a cafe-style lighting effect, you'll need to search the HDR editing software for HDR images with that effect. If so, import that image into the software. If not, search the HDR image library or capture your own.
[0089] In summary, the high dynamic range imaging picture 502 obtained in this step is a picture corresponding to the target point light source effect in the game scene.
[0090] Step S202 - 3 : adjusting the high dynamic range imaging picture 502 according to the scene model 501 to obtain the high dynamic range imaging map 503 .
[0091] Through steps S202 - 1 and S202 - 2 , the scene model 501 and the high dynamic range imaging picture 502 are imported into the high dynamic range imaging editing software and are located in the same editing canvas.
[0092] Comparing the target point light source effect in the scene model 501, the lighting effect of the high dynamic range image 502 is adjusted. For example, the exposure of the high dynamic range image 502 and the lighting parameters of the light source (such as light intensity, light color, light position, light shape, etc.) are adjusted. Another example is to add the basic lighting provided in the HDR Light Studio software to the high dynamic range image 502 as needed.
[0093] After the light effect adjustment is performed on the high dynamic range imaging picture 502 , the high dynamic range imaging map 503 can be synthesized.
[0094] Therefore, the high dynamic range imaging map 503 obtained through the above steps is actually a light map that uses the high dynamic range imaging picture 502 as a base map and stores the target point light source information in the scene model 501.
[0095] Step S203 : Using a reflection ball to capture target point light source information in the high dynamic range imaging map, and obtaining a high dynamic range imaging map reflection ball.
[0096] The Reflection Ball is a common tool used in game scene creation, capturing scene lighting information within a certain range. In game scene creation, Reflection Balls are often placed within or near model elements that should reflect light, such as water surfaces and metal models. This creates a reflective effect that reflects the surrounding environment, making the scene appear more realistic. Reflection Balls are a common tool in game engines and can be used directly within the game engine.
[0097] Although conventional reflection balls can also achieve the effect of making the model reflect the surrounding environment, they must be combined with real-time point light sources, otherwise the reflection effect will not be ideal.
[0098] The point light source effect processing method provided in this embodiment is to provide a lighting method that replaces the real-time point light source. Therefore, the reflective ball needs to be processed so that the reflective ball can show a better reflection effect without the need for real-time point light source lighting.
[0099] Through the above steps, a high dynamic range imaging map storing the target point light source information of the target point light source in the scene model is obtained, and a reflection ball is further used to capture the target point light source information in the high dynamic range imaging map to obtain a high dynamic range imaging map reflection ball.
[0100] Figure 6 This is a flow chart of obtaining a high dynamic range imaging map reflection ball provided by this embodiment. Figure 6 As shown, the method provided in this embodiment uses a reflective ball to capture the target point light source information in the high dynamic range imaging map, and obtains the reflective ball of the high dynamic range imaging map, including the following steps:
[0101] Step S203-1: import the high dynamic range imaging map into the game engine.
[0102] Import the acquired high dynamic range imaging map into the game engine. It should be noted that when importing, the high dynamic range imaging map should be modified to the size of the high dynamic range imaging picture in the game engine. For example, if the size of the high dynamic range imaging picture in the game engine is 265×265, then the size of the high dynamic range imaging map to be imported needs to be modified to 265×265.
[0103] Step S203-2: performing a bonding process on the high dynamic range imaging map and the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
[0104] In the game engine, the high dynamic range imaging map and the reflection ball are fitted so that the reflection ball captures the target point light source information in the high dynamic range imaging map, thereby obtaining the high dynamic range imaging map reflection ball.
[0105] Compared with the conventional reflective balls in the game engine, the high dynamic range imaging map reflective ball stores target point light source information with stronger intensity and larger range. The lighting effect it produces is consistent with the lighting effect produced by the real-time target point light source. Therefore, the high dynamic range imaging map reflective ball can completely replace the target point light source in the game scene.
[0106] Step S204: setting the high dynamic range imaging map reflection ball in the game scene to replace the target point light source in the game scene.
[0107] An optional implementation provided by this embodiment is: in a game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
[0108] The preset position refers to the position of the model element in the game scene where the target point light effect processing is to be performed, or the position around it. The specific position needs to be determined based on the subsequent adjustment of the target point light effect. For example: Figure 1 In the game selection hall scene shown, the point light effect processing is targeted at the booth model element below the character. Therefore, the position of the booth model element and its surrounding positions are the preset positions of the high dynamic range imaging map reflection ball.
[0109] The method for setting up the high dynamic range imaging map reflection ball is usually to create a new viewport in the game engine, import the scene model corresponding to the game scene under the target point light source and the camera parameters corresponding to the scene model, delete the target point light source, and arrange the high dynamic range imaging map reflection ball at a preset position in the scene model. Then, a game scene can be obtained by using the high dynamic range imaging map reflection ball to replace the real-time point light source of the scene.
[0110] Another optional implementation provided by this embodiment is: after executing the step of setting the high dynamic range imaging map reflective ball at a preset position in the game scene, further executing the following steps:
[0111] The game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source; and the game scene in which the high dynamic range imaging map reflection ball is used to replace the target point light source is obtained.
[0112] The adjustment described in this step involves placing the HDR imagery reflective spheres at preset locations within the game scene. This adjustment is based on the target point light source effect within the game scene under the target point light source. This is an overall adjustment of the game scene. The adjustment in step S202, on the other hand, involves adjusting the HDR imagery based on the target point light source effect. This is an adjustment specifically focused on the lighting effects of the HDR imagery.
[0113] Since the high dynamic range imaging map in the high dynamic range imaging map reflection ball is produced by high dynamic range imaging editing software, it is difficult to achieve consistency with the target point light source effect in the game scene through one production. It is necessary to repeatedly adjust the target point light source effect in the game scene where the high dynamic range imaging map reflection ball is set based on the target point light source effect in the game scene to make it consistent with the target point light source effect in the game scene.
[0114] Of course, if repeated adjustments to the target point light source effect in the game scene where the HDR imaging map reflective ball is set in this step still fail to achieve the same effect as the target point light source effect in the game scene, the process can return to step S202 and adjust the lighting effect of the HDR imaging map again. Therefore, the adjustment includes adjusting the target point light source effect of the HDR imaging map in the HDR imaging editing software.
[0115] That is to say, adjustments can be made to the high dynamic range imaging map, that is, the target point light source effect of the high dynamic range imaging map can be adjusted in the high dynamic range imaging editing software, the exposure of the high dynamic range imaging image can be adjusted, and the light effect parameters (such as: light intensity, light color, light source position, light source shape, etc.) can also be adjusted.
[0116] The adjustment further includes: adjusting setting parameters of the high dynamic range imaging map reflective ball in the game scene in the game engine.
[0117] In other words, adjustments can also be made to the HDR imagery reflective spheres set in the game scene, i.e., the setting parameters of the HDR imagery reflective spheres can be adjusted in the game engine, such as the intensity parameter, color parameter, and position parameter of the HDR imagery reflective spheres.
[0118] In the process of processing point light effects, in order to highlight the point light effect, the high dynamic range imaging map produced is often very strong. Therefore, the position, intensity, and color of the high dynamic range imaging map reflection ball need to be set to achieve the target point light effect in the game scene.
[0119] The adjustment further includes: adjusting the object material of the high dynamic range imaging map reflective ball arranged in the game scene.
[0120] The object material refers to the material of the object model on which the HDR image reflector is placed. Examples include cloth texture, wood texture, glossy stainless steel, matte stainless steel, leather, and translucent materials. Different object materials display different levels of the point light effect of the HDR image reflector.
[0121] Since the arrangement of the high dynamic range imaging map reflection ball in the game scene is to enable the object model elements in the game scene to project the surrounding environment more naturally, the object of arranging the high dynamic range imaging map reflection ball is equally important for the display of the point light source effect.
[0122] This embodiment provides several optional methods for adjusting the object, including:
[0123] First, the material of the object is adjusted.
[0124] Based on the basic properties of reflective spheres, they provide effective glossy reflections for object models in game scenes. The lower the roughness of the object model, the better the reflection effect, and the better the target point light source effect of the HDR imaged reflective sphere reflected on the model. Typically, the roughness of an object material cannot exceed 1, otherwise the target point light source effect of the HDR imaged reflective sphere will not be fully displayed. Therefore, in order to fully display the target point light source effect of the HDR imaged reflective sphere, the object material needs to be adjusted.
[0125] Second, the structure of the object is adjusted.
[0126] For mobile games, the underlying settings reduce the recognition of merged models to save performance, and therefore need to split the model into separate slices. This separate slice structure allows the model to more sensitively capture the point light effect of the HDR imaged reflective sphere. Therefore, in order to correctly achieve the target point light effect of the HDR imaged reflective sphere, the object structure needs to be adjusted to a separate slice structure.
[0127] Third, adjust the performance of the object.
[0128] In order to ensure that the material is not over-consumed in the scene model, the material's response to the effect of the reflection ball is limited. Therefore, ordinary materials can only reflect one reflection ball effect. However, when there is a special need for a material corresponding to two reflection ball effects in the scene, it is necessary to turn on the material's high-quality reflection switch to avoid uneven point light effects in the game scene. Therefore, for object models that need to correspond to two reflection ball effects, in order to achieve the uniformity of the target point light effect of the high dynamic range imaging map reflection ball, it is necessary to adjust the object's performance, that is, turn on the material's high-quality reflection switch.
[0129] In addition to the adjustment method described above, based on the target point light source effect in the game scene, the target point light source effect in the game scene where the high dynamic range imaging map reflection ball is set is adjusted, and other adjustment methods are also included, such as: adjusting other light sources (since the high dynamic range imaging map reflection ball is used to replace the target point light source in the game scene, it is necessary to increase the brightness of the skylight to increase the brightness of the game scene). Other adjustment methods are not described in detail here.
[0130] The first embodiment above provides an optional implementation of the point light source effect processing method, and the specific steps are as follows:
[0131] First, a scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model are exported from the game engine.
[0132] Second, preprocessing is performed on the scene model and the camera parameters corresponding to the scene model.
[0133] Third, the pre-processed scene model and the camera parameters corresponding to the scene model are imported into the high dynamic range imaging editing software.
[0134] Fourth, obtain a high dynamic range imaging picture corresponding to the target point light source effect in the game scene, and import the high dynamic range imaging picture into the high dynamic range imaging editing software.
[0135] Fifth, perform light effect adjustment on the high dynamic range imaging picture to obtain the high dynamic range imaging map.
[0136] Sixth, the high dynamic range imaging map is imported into the game engine.
[0137] Seventh, the high dynamic range imaging map is matched with the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
[0138] Eighth, in the game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
[0139] Ninth, based on the target point light source effect in the game scene, the target point light source effect in the game scene where the high dynamic range imaging map reflection ball is set is adjusted to obtain a game scene that uses the high dynamic range imaging map reflection ball to replace the real-time target point light source in the game scene.
[0140] Through the point light source effect processing method provided in the first embodiment of the present application, an alternative form of a game scene illuminated by a real-time point light source can be obtained. Figure 7 3 is a schematic diagram comparing the game scenes before and after the point light source effect processing provided by this embodiment.
[0141] like Figure 7 As shown, the target point light effects of game scene 701 before and after point light effect processing are essentially identical, with no significant difference. However, the lights in game scene 702 after processing only have parallel light, while the types of lights in game scene 701 before processing are more complex. Therefore, the point light effect processing method provided in this embodiment can reduce the consumption of real-time point lights in the game scene while ensuring the artistic effect of the game scene.
[0142] The second embodiment of the present application provides a point light source effect processing device. Figure 8 Schematic diagram of the structure of the point light source effect processing device provided in this embodiment.
[0143] like Figure 8 As shown, the point light source effect processing device provided by this embodiment includes: an acquisition unit 801, a texture production unit 802, a reflection ball production unit 803, and a setting unit 804.
[0144] The acquisition unit 801 is used to acquire scene model related data corresponding to the game scene under the target point light source.
[0145] Optionally, obtaining scene model related data corresponding to the game scene under the target point light source includes: exporting the scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model from a game engine.
[0146] Optionally, the step of obtaining scene model related data corresponding to the game scene under the target point light source further includes: preprocessing the scene model and camera parameters corresponding to the scene model.
[0147] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model includes: deleting model elements in the scene model that are not related to the target point light source effect.
[0148] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model further includes: adjusting parameter values of the camera parameters corresponding to the scene model.
[0149] The texture creation unit 802 is configured to create a high dynamic range imaging texture corresponding to the target point light source effect in the game scene based on the scene model related data.
[0150] Optionally, the step of producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model related data includes:
[0151] Acquire a high dynamic range imaging picture corresponding to a target point light source effect in the game scene;
[0152] The high dynamic range imaging picture is adjusted according to the scene model to obtain the high dynamic range imaging map.
[0153] The reflection ball production unit 803 is used to capture the target point light source information in the high dynamic range imaging map using a reflection ball to obtain the high dynamic range imaging map reflection ball.
[0154] Optionally, the step of using a reflection ball to capture target point light source information in the high dynamic range imaging map to obtain the high dynamic range imaging map reflection ball includes:
[0155] Importing the high dynamic range imaging map into a game engine;
[0156] The high dynamic range imaging map is matched with the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
[0157] The setting unit 804 is used to set the high dynamic range imaging map reflection ball in the game scene to replace the target point light source in the game scene.
[0158] Optionally, setting the high dynamic range imaging map reflective ball in the game scene to replace the target point light source in the game scene includes:
[0159] In the game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
[0160] Optionally, after performing the step of setting the high dynamic range imaging map reflective ball at a preset position in the game scene, further performing the following steps:
[0161] Adjusting the game scene in which the high dynamic range imaging map reflective ball is set to achieve a target point light source effect in the game scene under the target point light source;
[0162] Acquire the game scene in which the target point light source is replaced by the high dynamic range imaging map reflection ball.
[0163] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, including: adjusting the setting parameters of the high dynamic range imaging map reflection ball in the game engine.
[0164] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, and also includes: adjusting the object material of the high dynamic range imaging map reflection ball arranged in the game scene.
[0165] A third embodiment of the present application provides an electronic device, Figure 9 Schematic diagram of the structure of the electronic device provided in this embodiment.
[0166] like Figure 9 As shown, the electronic device provided by this embodiment includes: a memory 901 and a processor 902.
[0167] The memory 901 is used to store computer instructions for executing the point light source effect processing method.
[0168] The processor 902 is configured to execute computer instructions stored in the memory 901 to perform the following operations:
[0169] Get the scene model data corresponding to the game scene under the target point light source;
[0170] Producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model related data;
[0171] Using a reflection ball to capture target point light source information in the high dynamic range imaging map, and obtaining a high dynamic range imaging map reflection ball;
[0172] The high dynamic range imaging map reflection ball is set in the game scene to replace the target point light source in the game scene.
[0173] Optionally, obtaining scene model related data corresponding to the game scene under the target point light source includes: exporting the scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model from a game engine.
[0174] Optionally, the step of obtaining scene model related data corresponding to the game scene under the target point light source further includes: preprocessing the scene model and camera parameters corresponding to the scene model.
[0175] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model includes: deleting model elements in the scene model that are not related to the target point light source effect.
[0176] Optionally, the preprocessing of the scene model and the camera parameters corresponding to the scene model further includes: adjusting parameter values of the camera parameters corresponding to the scene model.
[0177] Optionally, the step of producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model related data includes:
[0178] Acquire a high dynamic range imaging picture corresponding to a target point light source effect in the game scene;
[0179] The high dynamic range imaging picture is adjusted according to the scene model to obtain the high dynamic range imaging map.
[0180] Optionally, the step of using a reflection ball to capture target point light source information in the high dynamic range imaging map to obtain the high dynamic range imaging map reflection ball includes:
[0181] Importing the high dynamic range imaging map into a game engine;
[0182] The high dynamic range imaging map is matched with the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
[0183] Optionally, setting the high dynamic range imaging map reflective ball in the game scene to replace the target point light source in the game scene includes:
[0184] In the game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
[0185] Optionally, after performing the step of setting the high dynamic range imaging map reflective ball at a preset position in the game scene, further performing the following steps:
[0186] Adjusting the game scene in which the high dynamic range imaging map reflective ball is set to achieve a target point light source effect in the game scene under the target point light source;
[0187] Acquire the game scene in which the target point light source is replaced by the high dynamic range imaging map reflection ball.
[0188] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, including: adjusting the setting parameters of the high dynamic range imaging map reflection ball in the game engine.
[0189] Optionally, the game scene in which the high dynamic range imaging map reflection ball is set is adjusted to achieve the target point light source effect in the game scene under the target point light source, and also includes: adjusting the object material of the high dynamic range imaging map reflection ball arranged in the game scene.
[0190] The fourth 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 any one of the point light source effect processing methods in the first embodiment of the present application.
[0191] It should be noted that relational terms such as "first" and "second" in this document are used only 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 synonymous in meaning, and the ending of any one or more items following any of the above words is open-ended, and none of the above terms indicates that the one or more items are exhaustive or limited to the one or more items listed.
[0192] As used herein, unless expressly stated otherwise, the term "or" includes all possible combinations, except those that are infeasible. For example, if a statement states that a database may include A or B, then unless otherwise specified or infeasible, it may include databases A, B, or A and B. As a second example, if a statement states that a database may include A, B, or C, then unless otherwise specified or infeasible, it may include databases A, B, or C, or A and B, or A and C, or B and C, or A, B, and C.
[0193] 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 this 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.
[0194] In the above detailed description, the embodiments have been described with reference to many specific details, which may vary depending on the implementation. Certain adaptations and modifications may be made to the embodiments. For those skilled in the art, other embodiments will be readily apparent from the specific embodiments disclosed herein. This description and examples are for illustrative purposes only, and the true scope and nature of this application are described in the claims. The order of steps shown in the figures is also for illustrative purposes only and is not intended to be limiting to any particular steps or order. Therefore, those skilled in the art will appreciate that these steps may be performed in different orders when implementing the same method.
[0195] In the figures and detailed description of this 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 used in a general and descriptive sense only and not for purposes of limitation.
Claims
1. A point light source effect processing method, characterized in that: include: Get the scene model data corresponding to the game scene under the target point light source; Creating a high dynamic range imaging map corresponding to a target point light source effect in the game scene based on the scene model-related data, wherein the high dynamic range imaging map is obtained by adjusting the lighting effect of a high dynamic range imaging picture based on the target point light source effect in the game scene, and the high dynamic range imaging picture is a photograph corresponding to the target point light source effect in the game scene taken using a camera's high dynamic range imaging function; Using a reflection ball to capture target point light source information in the high dynamic range imaging map, and obtaining a high dynamic range imaging map reflection ball; The high dynamic range imaging map reflection ball is set in the game scene to replace the target point light source in the game scene.
2. The method according to claim 1, characterized in that The obtaining of scene model related data corresponding to the game scene under the target point light source includes: deriving the scene model corresponding to the game scene under the target point light source and camera parameters corresponding to the scene model from a game engine.
3. The method according to claim 1, characterized in that The method of obtaining scene model related data corresponding to the game scene under the target point light source also includes: preprocessing the scene model and camera parameters corresponding to the scene model.
4. The method according to claim 3, characterized in that The preprocessing of the scene model and the camera parameters corresponding to the scene model includes: deleting model elements in the scene model that are irrelevant to the target point light source effect.
5. The method according to claim 3, characterized in that The preprocessing of the scene model and the camera parameters corresponding to the scene model further includes: adjusting parameter values of the camera parameters corresponding to the scene model.
6. The method according to claim 1, characterized in that The step of producing a high dynamic range imaging map corresponding to a target point light source effect in the game scene according to the scene model related data includes: Acquire a high dynamic range imaging picture corresponding to a target point light source effect in the game scene; The high dynamic range imaging picture is adjusted according to the scene model to obtain the high dynamic range imaging map.
7. The method according to claim 1, characterized in that The method of using a reflection ball to capture target point light source information in the high dynamic range imaging map and obtaining the high dynamic range imaging map reflection ball includes: Importing the high dynamic range imaging map into a game engine; The high dynamic range imaging map is matched with the reflection ball in the game engine to obtain the high dynamic range imaging map reflection ball.
8. The method according to claim 1, characterized in that The step of setting the high dynamic range imaging map reflective ball in the game scene to replace the target point light source in the game scene includes: In the game engine, the high dynamic range imaging map reflective ball is set at a preset position in the game scene.
9. The method according to claim 8, characterized in that After performing the step of setting the high dynamic range imaging map reflective ball at a preset position in the game scene, further perform the following steps: Adjusting the game scene in which the high dynamic range imaging map reflective ball is set to achieve a target point light source effect in the game scene under the target point light source; Acquire the game scene in which the target point light source is replaced by the high dynamic range imaging map reflection ball.
10. The method according to claim 9, characterized in that The adjusting of the game scene in which the high dynamic range imaging map reflective ball is set to achieve the target point light source effect in the game scene under the target point light source includes: adjusting the setting parameters of the high dynamic range imaging map reflective ball in the game engine.
11. The method according to claim 9, characterized in that The adjusting of the game scene in which the high dynamic range imaging map reflective ball is set to achieve the target point light source effect in the game scene under the target point light source also includes: adjusting the object material in which the high dynamic range imaging map reflective ball is arranged in the game scene.
12. A point light source effect processing device, characterized in that: include: Acquisition unit, mapping unit, reflection ball production unit, setting unit; The acquisition unit is used to acquire scene model related data corresponding to the game scene under the target point light source; The texture creation unit is configured to create a high dynamic range imaging texture corresponding to a target point light source effect in the game scene based on the scene model-related data, wherein the high dynamic range imaging texture is obtained by adjusting the lighting effect of a high dynamic range imaging picture based on the target point light source effect in the game scene, and the high dynamic range imaging picture is a photograph corresponding to the target point light source effect in the game scene taken using a high dynamic range imaging function of a camera; The reflection ball production unit is used to capture the target point light source information in the high dynamic range imaging map using a reflection ball to obtain the high dynamic range imaging map reflection ball; The setting unit is used to set the high dynamic range imaging map reflection ball in the game scene to replace the target point light source in the game scene.
13. An electronic device, characterized in that: include: memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to implement the method according to any one of claims 1 to 11.
14. A computer-readable storage medium having one or more computer instructions stored thereon, characterized in that: The instruction is executed by a processor to implement the method according to any one of claims 1 to 11.