Component editing method and device in game, program product and electronic equipment
By displaying target texture maps and material editing controls during the game editing phase and determining material parameters in response to user actions, the problem of surging resource quantities in existing technologies is solved, enabling efficient component editing and rich effect presentation, thus improving user experience and flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-31
AI Technical Summary
In games that support UGC, existing technologies require providing separate texture resources for each type of component, resulting in a surge in the number of resources, low development efficiency, complex resource management, limited user experience, and insufficient scalability.
By displaying the target texture map and material editing controls of the basic components during the game editing stage, responding to user editing operations, determining material parameters, and rendering based on the target texture map and material parameters during the game running stage, the target components are generated to achieve the presentation of various effects.
It lowers the barrier to entry for UGC content creation, enhances the player's creation experience, reduces the number of texture resources, and improves the flexibility and scalability of component editing.
Smart Images

Figure CN121754888A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to a method and apparatus for editing components in a game, a program product, and an electronic device. Background Technology
[0002] In games that support UGC (User-Generated Content), players typically require various types of component resources to meet the needs of different environments and scenes when building level maps. Current technologies require providing separate texture resources for each type of component for players to choose from. For example, for a wood component, if a twisted texture is desired, a separate component with twisted wood grain needs to be created; if a spliced plank effect is desired, a separate plank component needs to be created. This approach leads to a rapid increase in the number of resources, with each new effect requiring the creation of a separate component, which is time-consuming, inefficient, and increases the workload for developers. Furthermore, these technologies struggle to adapt to constantly changing requirements, lacking flexibility and scalability. Summary of the Invention
[0003] This disclosure provides a method for editing components in a game to at least partially address the problem of escalating resource quantities in related technologies.
[0004] According to a first aspect of this disclosure, a method for editing components in a game is provided, the method comprising: During the game editing phase, the graphical user interface displays the game editing scene and the basic components within the game editing scene; In response to the first editing operation, a target texture map corresponding to the basic component and a material editing control set corresponding to the target texture map are displayed. In response to the second editing operation, at least one material parameter is determined for the target texture map, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map; During the game's execution phase, the game's execution scene is displayed in the graphical user interface, and the basic components are rendered based on the rendering method determined by the target texture map and the material parameters, so as to generate the corresponding target components in the game's execution scene.
[0005] According to a second aspect of this disclosure, a component editing device for a game is provided, the device comprising: A basic component display module is used to display the game editing scene and the basic components in the game editing scene on the graphical user interface during the game editing stage. The first editing operation response module is used to respond to the first editing operation by displaying the target texture map corresponding to the basic component and the material editing control set corresponding to the target texture map; The second editing operation response module is used to respond to the second editing operation and determine at least one material parameter set for the target texture map, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map; The rendering module is used to display the game running scene in the graphical user interface during the game running phase, and to render the basic components based on the rendering method determined by the target texture map and the material parameters, so as to render and generate the corresponding target components in the game running scene.
[0006] According to a third aspect of this disclosure, a program product is provided, including a computer program that, when executed by a processor, implements the method of the first aspect described above and possible implementations thereof.
[0007] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect and possible implementations thereof by executing the executable instructions.
[0008] This disclosure provides a component editing method in a game. During the game editing phase, a game editing scene and basic components within the game editing scene are displayed in the graphical user interface. In response to a first editing operation, a target texture map corresponding to the basic component and a material editing control corresponding to the target texture map are displayed. In response to a second editing operation, at least one material parameter set for the target texture map is determined, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map. During the game running phase, a game running scene is displayed in the graphical user interface, and the basic components are rendered based on the rendering method determined by the target texture map and the material parameters to generate corresponding target components in the game running scene. On the one hand, it provides users with material editing controls corresponding to the target texture map, responds to the user's second editing operation on the material editing controls, determines the material parameters set for the target texture map, and renders according to these material parameters. Players only need to select the target texture map and adjust the corresponding material parameters to achieve the target component with the desired effect, lowering the threshold for UGC content creation and improving the player's creative experience. On the other hand, it solves the problem of providing different texture resources for components with different display effects in related technologies, reducing the number of texture resources. Furthermore, through the channel values in different texture channels of the target texture map and the material parameters, a variety of different effects can be presented in the basic component, improving the flexibility and scalability of component editing. Attached Figure Description
[0009] Figure 1 A flowchart illustrating a component editing method in a game according to this exemplary embodiment is shown; Figure 2 This diagram illustrates a target texture map and a material editing control corresponding to the target texture map in this exemplary embodiment. Figure 3 This diagram illustrates the material parameters included in a material editing control in this exemplary embodiment. Figure 4 A schematic diagram illustrating the normal data of a target texture map in this exemplary embodiment; Figure 5 A schematic diagram illustrating texture variation data of a target texture map in this exemplary embodiment; Figure 6 A schematic diagram illustrating masking data for a target texture map in this exemplary embodiment; Figure 7 This illustration shows a basic component in this example embodiment and a target component obtained after editing the coloring level of the material details; Figure 8 A schematic diagram of a target component corresponding to different levels of material detail roughness in this exemplary embodiment is shown; Figure 9 This diagram illustrates a target component corresponding to a different material detail display range in this exemplary embodiment; Figure 10 A schematic diagram illustrating a basic component and a target component obtained after editing the material detail normal intensity in this exemplary embodiment, including a target texture map and a graphical user interface of parameter adjustment controls; Figure 11 This diagram illustrates a component editing apparatus in a game according to this exemplary embodiment; Figure 12 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation
[0010] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.
[0011] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.
[0012] In games that support UGC (User Generated Content), players typically need various types of component resources to meet different environmental and scene requirements when building level maps. For example, glass materials may require variations such as smooth, cracked, or scratched textures; cloth materials may include rope weave textures, silk textures, or wool textures. Traditional methods require providing separate texture resources for each type of component for players to choose from. This approach has several drawbacks: First, it leads to an exponential increase in the number of resources, consuming storage space and development resources. Second, it results in low development efficiency, as each new effect requires a separate component, which is time-consuming and inefficient, increasing the workload for developers. Third, it complicates resource management; as the number of components and skins increases, resource management and maintenance become complex, making efficient updates and maintenance difficult. Fourth, it limits the user experience; the large number of components and skins can confuse players when choosing, reducing the user experience. Fifth, it lacks scalability; this method struggles to adapt to constantly changing needs, lacking flexibility and extensibility.
[0013] In view of the above problems, an exemplary embodiment of this disclosure provides a method for editing components in a game. (See reference...) Figure 1 As shown, the component editing method in the game can include the following steps: Step S110: In the game editing stage, the game editing scene and the basic components in the game editing scene are displayed in the graphical user interface; Step S120: In response to the first editing operation, display the target texture map corresponding to the basic component and the material editing control set corresponding to the target texture map; Step S130: In response to the second editing operation, determine at least one material parameter set for the target texture map, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map; Step S140: During the game running phase, the game running scene is displayed in the graphical user interface, and the basic components are rendered based on the rendering method determined by the target texture map and the material parameters, so as to render and generate the corresponding target components in the game running scene.
[0014] In the component editing method described above, during the game editing phase, a game editing scene and basic components within the game editing scene are displayed in the graphical user interface; in response to a first editing operation, a target texture map corresponding to the basic component and a material editing control set corresponding to the target texture map are displayed; in response to a second editing operation, at least one material parameter set for the target texture map is determined, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map; during the game running phase, a game running scene is displayed in the graphical user interface, and the basic components are rendered based on the rendering method determined by the target texture map and the material parameters to generate the corresponding target components in the game running scene. On the one hand, it provides users with material editing controls corresponding to the target texture map, responds to the user's second editing operation on the material editing controls, determines the material parameters set for the target texture map, and renders according to these material parameters. Players only need to select the target texture map and adjust the corresponding material parameters to achieve the target component with the desired effect, lowering the threshold for UGC content creation and improving the player's creative experience. On the other hand, it solves the problem of providing different texture resources for components with different display effects in related technologies, reducing the number of texture resources. Furthermore, through the channel values in different texture channels of the target texture map and the material parameters, a variety of different effects can be presented in the basic component, improving the flexibility and scalability of component editing.
[0015] The following will provide further explanation and description of steps S110-S140.
[0016] In step S110, during the game editing stage, the game editing scene and the basic components within the game editing scene are displayed in the graphical user interface.
[0017] The game editing scene displayed in the graphical user interface can be a three-dimensional scene. This three-dimensional scene may include a component library, which can include various types of basic components. These basic components can be terrain-based or obstacle-based, without specific limitations in this disclosure. Basic components are reusable 3D models used by players to build levels or scenes in the game, and are the smallest functional modules of UGC content. These basic components come with a basic appearance and structure, such as the planar structure of a template and its original wood grain.
[0018] In step S120, in response to the first editing operation, a target texture map corresponding to the basic component and a material editing control set corresponding to the target texture map are displayed.
[0019] The first editing operation can be a drag-and-drop operation of a basic component, that is, dragging the basic component from the component library into the 3D scene. Once the basic component is displayed in the 3D scene, it can be displayed as follows: Figure 2 The image shows the target texture map corresponding to this basic component and the material editing controls corresponding to this target texture map. (Reference) Figure 3 As shown, the material editing control may include multiple material parameters, such as the degree of coloring of material details, the roughness of material details, the metallicity of material details, the self-illumination intensity of material details, the parallax depth of material details, the display range of material details, the normal intensity of material details, the horizontal repeatability of material details, the vertical repeatability of material details, the horizontal offset of material details, the vertical offset of material details, and the rotation angle of material details. In this disclosure, no specific limitation is made on the material parameters included in the material editing control.
[0020] In step S130, in response to the second editing operation, at least one material parameter is determined for the target texture map, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map.
[0021] The second editing operation involves adjusting at least one material parameter included in the material editing control. The target texture map is a multi-channel texture map, and its channels can store effect attributes that would otherwise require multiple independent textures to achieve. This target texture map can include four map channels: RGBA. Splitting the map channels of the target texture map is equivalent to splitting its RGBA channels. Different attribute information can be stored in each map channel. Different material parameters correspond to different map channels of the target texture map, and the channel values stored in different map channels determine the display effect of the target texture map.
[0022] In one implementation, the texture channels of the target texture map are split to obtain split channels, and the attribute information of the target texture map is stored based on the split channels, including: The texture channels of the target texture map are split into a first channel, a second channel, and a third channel; The first channel stores the normal information of the target texture map, the second channel stores the texture information of the target texture map, and the third channel stores the masking information of the target texture map.
[0023] Specifically, the four channels of the target texture map are split into a first channel, a second channel, and a third channel. The first channel can store data such as... Figure 4The normal data of the target texture map shown can be stored in the second channel as follows: Figure 5 The texture variation data of the target texture map shown can be stored in the third channel as follows: Figure 6 The masking data for the target texture map is shown. The normal information of the target texture map can be a 3D normal vector, and the texture information can be the dynamic rendering effect of the texture. This dynamic texture information is used to control the grayscale data set of the dynamic rendering of the detailed texture, i.e., it is a grayscale image. The normal information in the first channel is superimposed with the normal information of the base component, causing a bump effect on the surface of the base component. The texture information in the second channel controls the changes in the texture in the base component, such as directional rendering. The masking information in the third channel controls the color, metallicity, roughness, etc. of the component.
[0024] In one optional implementation, the first channel can be an R or G channel, the second channel can be a B channel, and the third channel can be an A channel. In other optional implementations, the first channel can be a B or A channel, the second channel can be an R channel, and the third channel can be a G channel. This disclosure does not specifically limit the channel splitting of the target texture map.
[0025] In step S140, during the game running phase, the game running scene is displayed in the graphical user interface, and the basic components are rendered based on the rendering method determined by the target texture map and the material parameters, so as to render and generate the corresponding target components in the game running scene.
[0026] During game runtime, the game scene is displayed in the graphical user interface. The target texture map is rendered onto the base component to obtain the target component, which is then displayed in the game scene. The target component is made by rendering the target texture map onto the base component. The rendering method is determined based on the material parameters edited by the user and the texture channel corresponding to those material parameters.
[0027] In one embodiment, the method further includes: The target texture map is sampled to obtain the first channel value, the second channel value, and the third channel value of the target texture map; The first channel value is solved to obtain the normal vector of the target texture map; Based on the second channel value, the texture change data of the target texture map is obtained; Based on the third channel value, the masking data of the target texture map is obtained.
[0028] Specifically, UV sampling is performed on the detailed texture of the target texture map. That is, UV sampling is performed on all textures of the target texture map, including multiple texture channels, to obtain the first, second, and third channel values of the target texture map. The first channel stores the normal information of the target texture map; therefore, the normal vector of the target texture map can be obtained by solving the first channel value. The second channel stores the texture variation information of the target texture map; after sampling the second channel value, the texture variation data of the target texture map can be obtained based on this second channel value. The third channel stores the masking information of the target texture map; after sampling the third channel value, the masking data of the target texture map can be obtained based on this third channel value.
[0029] In one optional implementation, when the first split channel is an R channel and a G channel, the R channel stores the X component of the normal vector, and the G channel stores the Y component of the normal vector. After obtaining the X component and the Y component, the Z component of the normal vector can be derived from the X component and the Y component. Based on the X component, the Y component and the Z component, the normal vector of the target texture map is obtained.
[0030] In one implementation, rendering the basic component based on a rendering method determined by the target texture map and the material parameters includes: Determine the target channel value corresponding to the material parameter, determine the rendering method based on the target channel value and the material parameter, and perform rendering based on the rendering method.
[0031] Specifically, the target channel value corresponding to the material parameter is determined, and the rendering method of the target texture map is determined based on the target channel value and the material parameter. After determining the rendering method, the target texture map is rendered on the base component.
[0032] In one implementation, when the object of the second editing operation is chromaticity for material details, the steps of determining the target channel value corresponding to the material parameters, determining the rendering method based on the target channel value and the material parameters, and performing rendering based on the rendering method include: The color of the texture in the target texture map is adjusted according to the chromaticity of the material details to obtain a first color; Based on the masking data in the third channel value corresponding to the chromaticity of the material detail, the color of the base component is superimposed with the first color to obtain the second color; The basic components are rendered based on the second color.
[0033] Specifically, Figure 7The diagram illustrates a basic component and a target component rendered based on the material detail chromaticity. When the user edits the material parameter in the material editing control to the material detail chromaticity, firstly, the color of the target texture map is obtained, and the texture color in the target texture map is adjusted according to this material detail chromaticity to obtain a first color. Secondly, the target channel corresponding to the material detail chromaticity is the third channel. Therefore, the mask data of the target texture map corresponding to this third channel value is obtained. Based on this mask data, the color of the basic component is superimposed with the first color to obtain a second color. The target texture map is then rendered in the basic component based on the second color.
[0034] In this embodiment, the chromaticity value of the material details directly controls the proportion of the texture color parameters in the final image. The higher the value, the more prominent the detail color; the lower the value, the fainter the detail color, ultimately achieving the effect of freely adjusting the intensity of detail color.
[0035] In one implementation, when the object of the second editing operation is material detail roughness, the steps of determining the target channel value corresponding to the material parameter, determining the rendering method based on the target channel value and the material parameter, and performing rendering based on the rendering method include: The roughness of the texture in the target texture map is adjusted according to the material detail roughness to obtain a first roughness; Based on the masking data in the third channel value corresponding to the material detail roughness, the roughness of the basic component is superimposed with the first roughness to obtain the second roughness; The basic component is rendered based on the second roughness.
[0036] Specifically, Figure 8 The diagram illustrates target components corresponding to different levels of material detail roughness. When the user edits the material parameter as material detail roughness in the material editing control, firstly, the roughness of the target texture map is obtained. Based on the user-edited material detail roughness, the roughness of the texture in the target texture map is adjusted to obtain the first roughness. Secondly, the target channel corresponding to this material detail roughness is the third channel. Therefore, the mask data of the target texture map corresponding to the third channel is obtained. Based on this mask data, the roughness of the base component is superimposed with the first roughness to obtain the second roughness. The base component is then rendered based on the second roughness.
[0037] In this embodiment, the roughness of the base component and the first roughness of the target texture map are mixed by masking data to obtain the second roughness of the target texture map, thus distinguishing the roughness of the target texture map from the roughness of the base component and achieving a more refined material texture.
[0038] In one implementation, when the object of the second editing operation is the metallicity of a material detail, the steps of determining the target channel value corresponding to the material parameter, determining the rendering method based on the target channel value and the material parameter, and performing rendering based on the rendering method include: The metallicity of the target texture map is adjusted based on the metallicity of the material details to obtain a first metallicity; Based on the masking data in the third channel value corresponding to the metallicity of the material details, the metallicity of the basic component is superimposed with the first metallicity to obtain the second metallicity; The basic components are rendered based on the second metallicity.
[0039] Specifically, when the user edits the material parameter as material detail metallicity in the material editing control, firstly, the metallicity of the target texture map is obtained, and the metallicity of the texture in the target texture map is adjusted according to the material detail metallicity edited by the user to obtain the first metallicity; secondly, the target channel corresponding to the material detail metallicity is the third channel, so the mask data of the target texture map corresponding to the third channel is obtained, and the metallicity of the basic component is superimposed with the first metallicity according to the mask data to obtain the second metallicity, and the basic component is rendered based on the second metallicity.
[0040] In this embodiment, the metallicity of the base component and the first metallicity of the target texture map are mixed by masking data to obtain the second metallicity, thereby distinguishing the metallicity of the target texture map from the metallicity of the base component and achieving a more refined material texture.
[0041] In related technologies, Unity's Metallic and Smoothness affect the overall metallicity and roughness of an object. It's not possible to adjust the metallicity and roughness of detail textures individually, nor are there any other effect adjustments, and three additional texture maps are required to achieve the desired effect. However, this disclosure achieves various editing effects on the roughness and metallicity of basic components through the masking data of the target texture map.
[0042] In one implementation, when the object of the second editing operation is the self-illumination intensity of material details, the steps of determining the target channel value corresponding to the material parameters, determining the rendering method based on the target channel value and the material parameters, and performing rendering based on the rendering method include: The emission color of the target texture map is adjusted according to the self-emission intensity of the material details to obtain the first emission color; The target emission color of the target texture map is determined based on the masking data in the third channel value corresponding to the self-emission intensity of the material detail and the first emission color. The basic components are rendered based on the target emission color.
[0043] Specifically, when the user edits the material parameter as the material detail self-illumination intensity in the material editing control, firstly, the illumination color of the target texture map is obtained, and the illumination color of the texture in the target texture map is adjusted according to the material detail self-illumination intensity set by the user to obtain the first illumination color; secondly, the target channel corresponding to the material detail self-illumination intensity is the third channel, therefore, the mask data of the target texture map corresponding to the third channel is obtained, and the target illumination color is obtained according to the mask data and the first illumination color, and the basic component is rendered according to the target illumination color.
[0044] For example, when the user sets the material detail self-illumination intensity to 0.8, the target self-illumination color equals the emission color of the target texture map. 0.8 Masking data, that is, when the color of the target texture map is yellow, it emits yellow light with 80% brightness in the area with a masking value of 1, and does not emit light in the area with a masking value of 0.
[0045] In one implementation, when the object of the second editing operation is material detail parallax depth, the steps of determining the target channel value corresponding to the material parameter, determining the rendering method based on the target channel value and the material parameter, and performing rendering based on the rendering method include: Based on the material detail parallax depth and the masking data in the third channel value corresponding to the material detail parallax depth, the UV coordinate offset is determined, and the UV coordinates of the base component are offset according to the UV coordinate offset to obtain the target UV coordinates. The first channel value is sampled based on the target UV coordinates, and the sampling result is calculated into a target normal vector. The base component is then rendered based on the target normal vector.
[0046] Specifically, the rendering of detail parallax depth simulates the visual offset observed by the human eye, allowing 2D detail textures to appear as 3D raised and recessed textures on the surface of the base component. The detail parallax depth parameter is the core coefficient for calculating the texture offset distance, and the offset effect dynamically changes with the player's viewpoint. When the user edits the material parameter as the material detail parallax depth in the material editing control, firstly, the range of the material detail parallax depth is validated. If the validation passes, in the area where the mask data is effective, the UV offset is calculated based on the material detail parallax depth. Based on this UV offset, the UV coordinates are offset to obtain the target UV. Then, the normal information in the first channel of the target texture map is sampled using this target UV, and the sampled normal information is solved to obtain the target normal vector. The base component is then rendered based on this target normal vector.
[0047] In one implementation, when the object of the second editing operation is the material detail display area, adjusting the properties of the target texture map according to the material parameters, and rendering the target texture map in the base component based on the adjusted properties and the channel values corresponding to the material parameters, includes: The texture variation data in the second channel value is adjusted according to the material detail display range; The target texture map is rendered onto the base component based on the adjusted texture change data.
[0048] Specifically, Figure 9 The diagram illustrates the target components corresponding to different material detail display ranges. When the user edits the material parameter in the material editing control to the material detail display range, firstly, the texture change data of the target texture map in the second channel value corresponding to the material detail display range is obtained. Secondly, this texture change data is compared with the material detail display range, and the texture change data is adjusted according to the material detail display range to obtain the adjusted texture change data. Finally, the rendering of the basic component is controlled based on the adjusted texture change data.
[0049] In one implementation, adjusting the texture variation data in the second channel value according to the material detail display range includes: When the grayscale value of a pixel in the texture change data is greater than the material detail display range, the grayscale value of the pixel is set to a first preset value; When the grayscale value of a pixel in the texture change data is not greater than the material detail display range, the grayscale value of the pixel is set to a second preset value.
[0050] Specifically, the texture change data can be a texture change map, which is a grayscale image. The grayscale value of each pixel in the texture change map is compared with the material detail display range set by the user. When the grayscale value of a pixel is greater than the material detail display range, the grayscale value of the pixel can be set to a first preset value. When the grayscale value of a pixel is not greater than the material detail display range, the grayscale value of the pixel can be set to a second preset value.
[0051] In one optional implementation, the first preset value can be 1, and the second preset value can be 0. The first and second preset values are not specifically limited in this disclosure. When the first preset value is set to 1, it indicates that the texture of the target texture map is displayed at the pixel position corresponding to the base component. When the second preset value is set to 0, it indicates that the texture of the target texture map is hidden at the pixel position corresponding to the base component, and only the texture of the base component itself is displayed.
[0052] In one implementation, controlling the rendering of the base component based on the adjusted texture change data includes: Based on the grayscale values of the pixels in the adjusted texture change data, determine the display effect of the target texture map in the basic component; The basic components are rendered based on the aforementioned display effect control.
[0053] Specifically, based on the grayscale value of each pixel in the adjusted texture change data, the display effect of the target texture map in the basic component is determined. That is, when the grayscale value of a pixel is 1, the color of the corresponding pixel in the target texture map is fully displayed; when the grayscale value of a pixel is 0, the color of the corresponding pixel in the target texture map is not displayed. The rendering of the basic component is controlled based on this display effect.
[0054] In one implementation, when the object of the second editing operation is the material detail normal intensity, the steps of determining the target channel value corresponding to the material parameter, determining the rendering method based on the target channel value and the material parameter, and performing rendering based on the rendering method include: Obtain the normal vector in the first channel value corresponding to the material detail normal intensity, and mix the normal vector Xiangling with the first normal vector of the base component based on the material detail normal intensity to obtain the target normal vector; Lighting calculations are performed based on the target normal vector to obtain the target calculation results, and rendering is performed based on the target calculation results.
[0055] Specifically, Figure 10This diagram illustrates the basic component and the target component obtained after editing the material detail normal intensity. When the user edits the material parameter to the material detail normal intensity in the material editing control, firstly, the channel corresponding to this material detail normal intensity is determined as the first channel, and its value is obtained. Based on this first channel value, the normal vector is obtained. Then, based on the user-set material detail normal intensity, the obtained normal vector is blended with the first normal vector of the basic component to obtain the target normal vector. After obtaining the target normal vector, the final color of each pixel is calculated using a lighting model based on this target normal vector, and the basic component is rendered based on the final color of each pixel.
[0056] In one embodiment, when the object of the second editing operation is the horizontal repeatability of material details and / or the vertical repeatability of material details, the method further includes: Based on the horizontal and / or vertical repeatability of material details, the UV coordinates of the base component are scaled to obtain scaled UV coordinates. The target texture map is sampled based on scaled UV coordinates, and the basic components are rendered based on the sampling results.
[0057] Specifically, the horizontal and vertical repeatability of material details control the number of times the detailed texture of the target texture map is repeated in the horizontal and vertical directions of the base component, determining the density of the texture. When the user edits the material parameters in the material editing control as the horizontal and / or vertical repeatability of material details, firstly, the UV coordinates of the base component are scaled according to the horizontal and / or vertical repeatability of material details to obtain scaled UV coordinates, and then the target texture map is sampled based on the scaled UV coordinates to obtain the sampling result, and the base component is rendered based on the sampling result.
[0058] In one embodiment, when the object of the second editing operation is a horizontal offset of material details and / or a vertical offset of material details, the method further includes: Based on the horizontal offset and / or vertical offset of the material details, the UV coordinates of the base component are offset to obtain the offset UV coordinates; The target texture map is sampled based on the offset UV coordinates, and the basic components are rendered based on the sampling results.
[0059] Specifically, the horizontal and / or vertical offset of material details control the positional offset of the detail texture in the horizontal and vertical directions of the base component. When the user edits the material parameters in the material editing control as horizontal and / or vertical offset of material details, the UV coordinates of the base component are offset according to the horizontal and / or vertical offset of material details to obtain offset UV coordinates. The target texture map is sampled based on the offset UV coordinates to obtain the sampling result, and the base component is rendered according to the sampling result.
[0060] In one embodiment, when the object of the second editing operation is the rotation angle of material details, the method further includes: Based on the rotation angle of the material details, the UV coordinates of the basic component are rotated to obtain the rotated UV coordinates; The target texture map is sampled based on rotated UV coordinates, and the basic components are rendered based on the sampling results.
[0061] Specifically, the material detail rotation angle is used to control the rotation of the detailed texture of the target texture map around a point on the surface of the base component. When the user edits the material parameter as the material detail rotation angle in the material editing control, the UV coordinates of the base component are rotated according to the material detail rotation angle to obtain the rotated UV coordinates. The target texture map is then sampled based on the rotated UV coordinates to obtain the sampling result, and the base component is rendered based on the sampling result.
[0062] In related technologies, the DetailMask needs to change synchronously with the Albedo's Tiling and Offset parameters, resulting in the tiling and offset effects of the detail texture being limited by the Albedo's base texture parameters and unable to be adjusted independently. Compared to related technologies, this disclosure improves the independent controllability of the detail texture. The detail texture exists as an independent mask, and its tiling and offset parameters are decoupled from the Albedo's base texture parameters. The tiling density and offset position of the detail texture can be freely adjusted on the Albedo surface, achieving more flexible control over the detail texture layout. On the other hand, it enhances the refinement and diversity of material representation. Through the independent mask design of the detail texture, the tiling range and offset direction of the detail texture can be independently controlled on the same Albedo base texture surface, achieving a material effect with a unified base texture and differentiated detail textures, enriching the visual representation dimensions of component materials. Furthermore, it reduces the complexity of user editing operations. Users can directly edit the material parameters in the material editing control without modifying the base texture parameters, simplifying the component material editing process and improving editing efficiency.
[0063] Exemplary embodiments of this disclosure also provide a component editing device in a game, with reference to... Figure 11 As shown, it includes: The basic component display module 1110 is used to display the game editing scene and the basic components in the game editing scene on the graphical user interface during the game editing stage. The first editing operation response module 1120 is used to respond to the first editing operation by displaying the target texture map corresponding to the basic component and the material editing control set corresponding to the target texture map; The second editing operation response module 1130 is used to respond to the second editing operation and determine at least one material parameter set for the target texture map, wherein different material parameters correspond to different texture channels of the target texture map, and the channel values stored in the texture channels are used to determine the display effect of the target texture map; The rendering module 1140 is used to display the game running scene in the graphical user interface during the game running phase, and to render the basic components based on the rendering method determined by the target texture map and the material parameters, so as to render and generate the corresponding target components in the game running scene.
[0064] In one exemplary embodiment, the rendering module includes: The sampling module is used to sample the target texture map to obtain the first channel value, the second channel value, and the third channel value of the target texture map; The normal vector calculation module is used to calculate the first channel value to obtain the normal vector of the target texture map; The texture change data acquisition module is used to obtain the texture change information of the target texture map based on the second channel value; Based on the third channel value, the masking data of the target texture map is obtained.
[0065] In one exemplary embodiment, the rendering module includes: The target component rendering module is used to determine the target channel value corresponding to the material parameter, determine the rendering method based on the target channel value and the material parameter, and perform rendering based on the rendering method.
[0066] In one exemplary embodiment, when the object of the second editing operation is the chromaticity of material details, the target component rendering module includes: The first color acquisition module is used to adjust the color of the texture in the target texture map according to the chromaticity of the material details to obtain the first color; The color overlay module is used to overlay the color of the base component with the first color based on the masking data in the third channel value corresponding to the chromaticity of the material detail, so as to obtain the second color; The color rendering module is used to render the basic component based on the second color.
[0067] In one exemplary embodiment, when the object of the second editing operation is material detail roughness, the target component rendering module includes: The roughness adjustment module is used to adjust the roughness of the texture in the target texture map according to the material detail roughness to obtain a first roughness; A roughness blending module is used to superimpose the roughness of the base component with the first roughness based on the masking data in the third channel value corresponding to the material detail roughness to obtain a second roughness; A roughness rendering module is used to render the basic component based on the second roughness.
[0068] In one exemplary embodiment, when the object of the second editing operation is the metallicity of a material detail, the target component rendering module includes: The metallicity adjustment module is used to adjust the metallicity of the target texture map according to the metallicity of the material details to obtain a first metallicity; A metallicity blending module is used to superimpose the metallicity of the base component with the first metallicity based on the masking data in the third channel value corresponding to the metallicity of the material details, to obtain a second metallicity. The metallicity rendering module is used to render the basic components based on the second metallicity.
[0069] In one exemplary embodiment, when the object of the second editing operation is the self-illumination intensity of material details, the target component rendering module includes: The emission color adjustment module is used to adjust the emission color of the target texture map according to the self-emission intensity of the material details to obtain a first emission color; The target emission color determination module is used to determine the target emission color of the target texture map based on the masking data in the third channel value corresponding to the self-emission intensity of the material detail and the first emission color; The emission color rendering module is used to render the basic components based on the target emission color.
[0070] In one exemplary embodiment, when the object of the second editing operation is material detail parallax depth, the target component rendering module includes: The UV offset determination module is used to determine the UV coordinate offset based on the material detail parallax depth and the masking data in the third channel value corresponding to the material detail parallax depth, and to offset the UV coordinates of the basic component based on the UV coordinate offset to obtain the target UV coordinates. The component rendering module is used to sample the first channel value based on the target UV coordinates, solve the sampling result into a target normal vector, and render the basic component based on the target normal vector.
[0071] In one exemplary embodiment, when the object of the second editing operation is a material detail display area, the target component rendering module includes: The texture change data adjustment module is used to adjust the texture change data in the second channel value according to the material detail display range; The texture rendering module is used to control the rendering of the basic components based on the adjusted texture change data.
[0072] In one exemplary embodiment, the texture change data adjustment module includes: The first adjustment module is used to set the gray value of the pixel to a first preset value when the gray value of the pixel in the texture change data is greater than the material detail display range; The second adjustment module is used to set the gray value of the pixel to a second preset value when the gray value of the pixel in the texture change data is not greater than the material detail display range.
[0073] In one exemplary embodiment, the texture rendering module includes: The display effect determination module is used to determine the display effect of the target texture map in the basic component based on the grayscale values of the pixels in the adjusted texture change data. The display effect rendering module is used to render the basic components based on the display effect control.
[0074] In one exemplary embodiment, when the object of the second editing operation is the material detail normal intensity, the target component rendering module includes: The normal vector adjustment module is used to obtain the normal vector in the first channel value corresponding to the material detail normal intensity, and to mix the normal vector of the material detail normal with the first normal vector of the base component based on the material detail normal intensity to obtain the target normal vector. The lighting calculation module is used to perform lighting calculations based on the target normal vector, obtain the target calculation result, and perform rendering based on the target calculation result.
[0075] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.
[0076] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0077] Furthermore, although the steps of the method in this invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0078] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the methods described above.
[0079] In one implementation, the computer program product can be a tangible product, such as a computer-readable storage medium storing a computer program. The readable storage medium can be based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, and includes, but is not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.
[0080] In one implementation, the computer program product can be an intangible product. For example, the computer program product can be a virtual digital product, such as an executable file or installation package containing a computer program.
[0081] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0082] Computer programs can be carried or transmitted via signals such as electrical, magnetic, optical, electromagnetic, and infrared rays. Electronic devices can convert the signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, to be executed by the processor of the electronic device) the method steps of various embodiments of this disclosure, such as... Figure 1 The steps are shown.
[0083] Implementing the above method steps through a computer program has the following technical effects: Firstly, it provides users with a material editing control corresponding to the target texture map, responds to the user's second editing operation on the material editing control, determines the material parameters set for the target texture map, and performs rendering based on these material parameters. Players only need to select the target texture map and adjust the corresponding material parameters to achieve the target component with the desired effect, lowering the barrier to entry for UGC content creation and improving the player's creative experience. Secondly, it solves the problem of needing to provide different texture resources for components with different display effects in related technologies, reducing the number of texture resources. Thirdly, through the channel values and material parameters in different texture channels of the target texture map, a variety of different effects can be presented in the basic component, improving the flexibility and scalability of component editing.
[0084] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device includes a processor and a memory. The memory stores executable instructions for the processor, such as computer programs. The processor executes these executable instructions to perform the method steps of various exemplary embodiments of this disclosure.
[0085] The following is for reference. Figure 12 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 12 The electronic device 1200 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0086] like Figure 12As shown, the electronic device 1200 may include: a processor 1210, a memory 1220, a bus 1230, an I / O (input / output) interface 1240, and a network adapter 1250.
[0087] Memory 1220 may include volatile memory, such as RAM 1221 and cache unit 1222, and may also include non-volatile memory, such as ROM 1223. Memory 1220 may also include one or more program modules 1224, such program modules 1224 including, but not limited to: operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 1224 may include the modules in the above-described apparatus.
[0088] The processor 1210 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0089] The processor 1210 can be used to execute executable instructions stored in the memory 1220 to perform method steps of various embodiments of this disclosure, such as... Figure 1 The steps are shown.
[0090] By executing the above method steps through processor 1010, the following technical effects are achieved: Firstly, it provides users with a material editing control corresponding to the target texture map, responds to the user's second editing operation on the material editing control, determines the material parameters set for the target texture map, and renders according to these material parameters. Players only need to select the target texture map and adjust the corresponding material parameters to achieve the target component with the desired effect, lowering the barrier to entry for UGC content creation and improving the player's creative experience. Secondly, it solves the problem of providing different texture resources for components with different display effects in related technologies, reducing the number of texture resources. Thirdly, through the channel values and material parameters in different texture channels of the target texture map, a variety of different effects can be presented in the basic component, improving the flexibility and scalability of component editing.
[0091] Bus 1230 is used to connect different components of electronic device 1200, and may include data bus, address bus and control bus.
[0092] Electronic device 1200 can communicate with one or more external devices 1300 (such as keyboard, mouse, external controller, etc.) through I / O interface 1240.
[0093] Electronic device 1200 can communicate with one or more networks via network adapter 1250. For example, network adapter 1250 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 1250 can communicate with other modules of electronic device 1200 via bus 1230.
[0094] In one embodiment, the electronic device 1200 further includes a display for displaying a graphical user interface.
[0095] although Figure 12 Other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, may also be configured in the electronic device 1200.
[0096] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, apparatus, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be referred to as "circuit," "module," or "system," respectively.
[0097] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.
Claims
1. A component editing method in a game, characterized by, The method comprises the following steps of: providing a graphical user interface by a terminal device, the method comprising: displaying a game editing scene and a base component in the game editing scene in the graphical user interface in a game editing stage; in response to a first editing operation, displaying a target texture map corresponding to the base component and a material editing control set corresponding to the target texture map; in response to a second editing operation, determining at least one material parameter set for the target texture map, wherein different material parameters correspond to different map channels of the target texture map, and channel values stored in the map channels are used to determine a display effect of the target texture map; 2. The method of claim 1, wherein, displaying a game running scene in the graphical user interface in a game running stage, and rendering the base component based on a rendering mode determined by the target texture map and the material parameter to generate a corresponding target component in the game running scene. The method further comprises: sampling the target texture map to obtain a first channel value, a second channel value and a third channel value of the target texture map; solving the first channel value to obtain a normal vector of the target texture map; based on the second channel value, obtaining texture change data of the target texture map; 3. The method of claim 2, wherein, based on the third channel value, obtaining mask data of the target texture map. The rendering of the base component based on the rendering mode determined by the target texture map and the material parameter comprises:
4. The method of claim 3, wherein, determining a target channel value corresponding to the material parameter, determining the rendering mode based on the target channel value and the material parameter, and rendering based on the rendering mode. When the operation object of the second editing operation is a material detail shading degree, the determination of the target channel value corresponding to the material parameter, the determination of the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode comprise: adjusting the color of the texture in the target texture map according to the material detail shading degree to obtain a first color; superimposing the color of the base component and the first color according to the mask data in the third channel value corresponding to the material detail shading degree to obtain a second color; 5. The method of claim 3, wherein, rendering the base component based on the second color. When the operation object of the second editing operation is a material detail roughness, the determination of the target channel value corresponding to the material parameter, the determination of the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode comprise: adjusting the roughness of the texture in the target texture map according to the material detail roughness to obtain a first roughness; superimposing the roughness of the base component and the first roughness according to the mask data in the third channel value corresponding to the material detail roughness to obtain a second roughness; rendering the base component based on the second roughness.
6. The method of claim 3, wherein, In a case where the operation object of the second editing operation is a material detail metallicity, the determining the target channel value corresponding to the material parameter, the determining the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode, include: adjusting a metallicity of the target texture map according to the material detail metallicity, to obtain a first metallicity; superimposing the metallicity of the base component and the first metallicity according to the mask data in the third channel value corresponding to the material detail metallicity, to obtain a second metallicity; rendering the base component based on the second metallicity.
7. The method of claim 3, wherein, In a case where the operation object of the second editing operation is a material detail self-illumination intensity, the determining the target channel value corresponding to the material parameter, the determining the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode, include: adjusting an emission color of the target texture map according to the material detail self-illumination intensity, to obtain a first emission color; determining a target emission color of the target texture map according to the mask data in the third channel value corresponding to the material detail self-illumination intensity and the first emission color; rendering the base component based on the target emission color.
8. The method of claim 3, wherein, In a case where the operation object of the second editing operation is a material detail parallax depth, the determining the target channel value corresponding to the material parameter, the determining the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode, include: determining a UV coordinate offset according to the material detail parallax depth and the mask data in the third channel value corresponding to the material detail parallax depth, and offsetting a UV coordinate of the base component according to the UV coordinate offset to obtain a target UV coordinate; sampling the first channel value based on the target UV coordinate, calculating a sampling result as a target normal vector, and rendering the base component based on the target normal vector.
9. The method of claim 3, wherein, In a case where the operation object of the second editing operation is a material detail display range, the adjusting an attribute of the target texture map according to the material parameter, and the rendering the target texture map in the base component based on the adjusted attribute and a channel value corresponding to the material parameter, include: adjusting the texture change data in the second channel value according to the material detail display range; controlling the rendering of the base component according to the adjusted texture change data.
10. The method of claim 9, wherein, The adjusting the texture change data in the second channel value according to the material detail display range, includes: in a case where a gray value of a pixel point in the texture change data is greater than the material detail display range, setting the gray value of the pixel point as a first preset value; in a case where the gray value of the pixel point in the texture change data is not greater than the material detail display range, setting the gray value of the pixel point as a second preset value.
11. The method of claim 9, wherein, The controlling the rendering of the base component according to the adjusted texture change data, includes: Determine a display effect of the target texture map in the base component according to the gray value of the pixel point in the adjusted texture change data; Control rendering of the base component based on the display effect.
12. The method of claim 3, wherein, When the operation object of the second editing operation is a material detail normal intensity, the determining of the target channel value corresponding to the material parameter, the determining of the rendering mode based on the target channel value and the material parameter, and the rendering based on the rendering mode, include: Obtain a normal vector in a first channel value corresponding to the material detail normal intensity, and mix the normal vector and a first normal vector of the base component based on the material detail normal intensity to obtain a target normal vector; Perform light calculation based on the target normal vector to obtain a target calculation result, and perform rendering based on the target calculation result.
13. An assembly generation device, characterized by Provide a graphical user interface through a terminal device, and the apparatus includes: A base component display module configured to display a game editing scene and a base component in the game editing scene in a game editing stage through the graphical user interface; A first editing operation response module configured to display a target texture map corresponding to the base component and a material editing control configured based on the target texture map in response to a first editing operation; A second editing operation response module configured to determine at least one material parameter configured for the target texture map in response to a second editing operation, wherein different material parameters correspond to different map channels of the target texture map, and channel values stored in the map channels are used to determine a display effect of the target texture map; A rendering module configured to display a game running scene through the graphical user interface in a game running stage, and perform rendering on the base component based on a rendering mode determined based on the target texture map and the material parameter to generate a corresponding target component in the game running scene.
14. A program product comprising a computer program, characterized in that The computer program is executed by a processor to implement the method of any one of claims 1-12.
15. An electronic device, comprising: Include: A processor; A memory configured to store executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-12 by executing the executable instructions.