Search

CN-121999102-A - Virtual object rendering method, device, equipment, medium and program product

CN121999102ACN 121999102 ACN121999102 ACN 121999102ACN-121999102-A

Abstract

The invention relates to the technical field of computer graphics and discloses a virtual object rendering method, a device, equipment, a medium and a program product, wherein the virtual object rendering method comprises the steps of obtaining a plurality of groups of PBR (physical property texture channel) atlas containing data of a plurality of physical property texture channels; when the mapping switching triggering condition for the target virtual object is met, a target PBR mapping set corresponding to the condition is determined from a plurality of groups of PBR mapping sets, then synchronous interpolation processing is carried out on the first texture channel data of the current PBR mapping set and the second texture channel data of the target PBR mapping set to generate transition mapping data, and finally, the target virtual object is rendered according to the transition mapping data. The method and the device can realize smooth transition of the material state of the virtual object, and promote reality sense and visual continuity of rendering.

Inventors

  • XU MIN
  • LIU SHENGGANG

Assignees

  • 网易(上海)网络有限公司

Dates

Publication Date
20260508
Application Date
20251224

Claims (13)

  1. 1.A method of rendering a virtual object, the method comprising: Acquiring a plurality of groups of PBR mapping sets, wherein the PBR mapping sets comprise texture channel data with various physical properties; Determining a target PBR map set corresponding to a map switch trigger condition from the plurality of groups of PBR map sets in response to the map switch trigger condition for the target virtual object being met; Synchronously interpolating first texture channel data corresponding to a current PBR mapping set and second texture channel data corresponding to the target PBR mapping set to obtain transition mapping data; And rendering the target virtual object according to the transition mapping data.
  2. 2. The method of claim 1, wherein prior to the step of responding to satisfaction of a map switch trigger condition for a target virtual object, the method further comprises: Assigning a globally unique identifier to each of the plurality of sets of PBR maps; Establishing a mapping relation between the identifier and texture channel data contained in the PBR mapping set, wherein the mapping relation is a pre-configured corresponding relation between the identifier and each texture channel data contained in the PBR mapping set; the texture channel data includes at least one of an albedo map, a roughness map, a metallicity map, a normal map, and an ambient light shading map.
  3. 3. The method of claim 2, wherein the determining the target PBR map set corresponding to the map switch trigger condition from the plurality of sets of PBR maps comprises: analyzing a target identifier from the mapping switching triggering condition; And determining a target PBR mapping set corresponding to the target identifier from the plurality of groups of PBR mapping sets through the mapping relation based on the target identifier.
  4. 4. The method of claim 1, wherein the responding to the meeting of the mapping switch trigger condition for the target virtual object comprises: the method comprises the steps of obtaining parameter information of a target virtual object, wherein the parameter information comprises at least one of an environment humidity value, an illumination intensity value, a damaged state of the target virtual object and time axis information; and if the parameter information is positioned in the preset trigger value interval, judging that the mapping switching trigger condition is met.
  5. 5. The method of claim 4, wherein the determining a target PBR map set corresponding to the map switch trigger condition from the plurality of sets of PBR maps further comprises: when the parameter information simultaneously meets a plurality of preset mapping switching triggering conditions, acquiring priority weights corresponding to the mapping switching triggering conditions; And taking the PBR mapping set corresponding to the mapping switching triggering condition with the highest priority as the target PBR mapping set.
  6. 6. The method of claim 1, wherein the synchronously interpolating the first texture channel data corresponding to the current PBR map set and the second texture channel data corresponding to the target PBR map set to obtain transition map data comprises: Acquiring mask texture data associated with the map switching trigger condition; determining a mixing weight of each pixel position on the surface of the target virtual object to the first texture channel data and the second texture channel data; and based on the mixing weight, carrying out weighted calculation on the first texture channel data and the second texture channel data to obtain the transition map data.
  7. 7. The method of claim 1, wherein the synchronously interpolating the first texture channel data corresponding to the current PBR map set and the second texture channel data corresponding to the target PBR map set to obtain transition map data comprises: Acquiring a transition coefficient, wherein the transition coefficient is used for representing the progress proportion of transition from a current state to a target state; and based on the transition coefficient, performing linear weighting calculation on the first texture channel data and the second texture channel data to obtain transition map data, wherein the linear weighting calculation is synchronously performed on all the texture channel data contained in the PBR map set in the same rendering frame.
  8. 8. The method of claim 2, wherein after the step of obtaining the transition map data, the method further comprises: Acquiring a first pixel value of a metalness map in the transition map data; if the first pixel value is smaller than a preset cutting threshold value, correcting the first pixel value to a preset first discrete value; and if the first pixel value is larger than or equal to the cutting threshold value, correcting the first pixel value into a preset second discrete value.
  9. 9. The method of claim 2, wherein after the step of obtaining the transition map data, the method further comprises: acquiring a second pixel value of the roughness map in the transition map data; Judging whether the second pixel value is in a preset effective physical parameter range or not; and if the second pixel value exceeds the effective physical parameter range, correcting the second pixel value to be within the effective physical parameter range.
  10. 10. A virtual object rendering apparatus, the apparatus comprising: The acquisition module is used for acquiring a plurality of groups of PBR mapping sets, wherein the PBR mapping sets contain texture channel data with various physical properties; the determining module is used for determining a target PBR mapping set corresponding to the mapping switching triggering condition from the plurality of groups of PBR mapping sets when the mapping switching triggering condition for the target virtual object is met; the interpolation module is used for synchronously interpolating the first texture channel data corresponding to the current PBR mapping set and the second texture channel data corresponding to the target PBR mapping set to obtain transition mapping data; And the rendering module is used for rendering the target virtual object according to the transition mapping data.
  11. 11. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the virtual object rendering method of any of claims 1 to 9.
  12. 12. A computer-readable storage medium, having stored thereon computer instructions for causing a computer to perform the virtual object rendering method of any one of claims 1 to 9.
  13. 13. A computer program product comprising computer instructions for causing a computer to perform the method of rendering a virtual object according to any one of claims 1 to 9.

Description

Virtual object rendering method, device, equipment, medium and program product Technical Field The present disclosure relates to the field of computer graphics, and in particular, to a method, apparatus, device, medium, and program product for rendering a virtual object. Background In existing computer graphics applications such as virtual reality and game development, PBR (PHYSICALLY BASED RENDERING, physical-based rendering) techniques are widely adopted to present realistic material effects. However, in the related art, when the material state of the virtual object is changed (for example, from dry to wet), a direct replacement material instance or a simple texture switching method is generally adopted. The processing mode causes that the switching between different states is visually presented as instant mutation, obvious visual fault phenomenon is generated, the synchronism and physical consistency of multi-channel data such as albedo, roughness, normal line and the like in the switching process are difficult to ensure, and the immersion feeling of a user is reduced. Therefore, a method for rendering a virtual object is needed to solve the problems of hard vision and lack of natural transition in the material switching process in the related art. Disclosure of Invention The disclosure provides a virtual object rendering method, device, equipment, medium and program product, which are used for solving the problems of hard vision and lack of natural transition in a material switching process in the related technology. In a first aspect, the present disclosure provides a method for rendering a virtual object, the method including: acquiring a plurality of groups of PBR mapping sets, wherein the PBR mapping sets comprise texture channel data with various physical properties; Determining a target PBR mapping set corresponding to the mapping switching trigger condition from a plurality of groups of PBR mapping sets in response to the mapping switching trigger condition for the target virtual object being met; synchronously interpolating the first texture channel data corresponding to the current PBR mapping set and the second texture channel data corresponding to the target PBR mapping set to obtain transition mapping data; and rendering the target virtual object according to the transition mapping data. According to the virtual object rendering method, the target PBR mapping set is determined by responding to the mapping switching triggering condition, and the texture channel data corresponding to the current PBR mapping set and the target PBR mapping set are subjected to synchronous interpolation to obtain transition mapping data for rendering. The method changes the problem of frame jump caused by the traditional direct replacement of materials, generates intermediate state texture data between a current state and a target state through interpolation calculation, realizes continuous and smooth transition of the appearance of the virtual object material, improves visual continuity and reality in the rendering process, synchronously processes all texture channel data, ensures logical consistency of different physical attributes such as albedo, normal and the like in the transition process, and avoids rendering flaws caused by asynchronous channel switching. In an alternative embodiment, before the step of responding to satisfaction of the map switch trigger condition for the target virtual object, the method further includes: Assigning a globally unique identifier to each of the plurality of sets of PBR maps; Establishing a mapping relation between the identifiers and texture channel data contained in the PBR mapping set, wherein the mapping relation is a corresponding relation between the pre-configured identifiers and the texture channel data contained in the PBR mapping set; The texture channel data includes at least one of an albedo map, a roughness map, a metallization map, a normal map, and an ambient light shading map. The method and the device also realize the resource and objectification management of the PBR mapping set, can index the complex data set containing multiple mapping such as albedo, roughness and the like through the unique identifier, reduce the complexity of resource management, and provide a high-efficiency data structure foundation for the subsequent quick calling and switching of the complete material data through the logic instruction. In an alternative embodiment, determining a target PBR map set corresponding to a map switch trigger condition from a plurality of sets of PBR maps sets includes: analyzing a target identifier from the mapping switching triggering condition; And determining a target PBR mapping set corresponding to the target identifier from the plurality of groups of PBR mapping sets through the mapping relation based on the target identifier. According to the method and the device, the index and the positioning of the whole complex PBR material can be completed b