WO2024255424A1 - 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 - Google Patents
虚拟对象的外装渲染方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2024255424A1 WO2024255424A1 PCT/CN2024/087803 CN2024087803W WO2024255424A1 WO 2024255424 A1 WO2024255424 A1 WO 2024255424A1 CN 2024087803 W CN2024087803 W CN 2024087803W WO 2024255424 A1 WO2024255424 A1 WO 2024255424A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- value
- varnish layer
- light source
- layer
- highlight
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
- A63F13/57—Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/60—Methods for processing data by generating or executing the game program
- A63F2300/66—Methods for processing data by generating or executing the game program for rendering three dimensional images
Definitions
- the present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for rendering an exterior of a virtual object.
- Outerwear is the external manifestation of virtual characters, virtual animals and virtual objects in online games. Outerwear can be used to dress up virtual characters, virtual animals and virtual objects to meet the needs of diversified display of virtual characters, virtual animals and virtual objects.
- the exterior is mostly made of cloth, silk and metal, and the diversity of the exterior is achieved through different colors, patterns and shapes.
- the existing method is difficult to reflect the real texture and visual effect of the exterior material, resulting in poor exterior rendering effect of virtual objects.
- a method, apparatus, computer device, computer-readable storage medium, and computer program product for rendering an exterior of a virtual object are provided.
- the present application provides a method for rendering an exterior of a virtual object, which is executed by a terminal and includes:
- the varnish layer is the varnish material covering the outer surface of the virtual object; obtain the original reflection value of the outer surface and the transmittance of the varnish layer; determine the reflection value and the second highlight value of the outer surface under the light source based on the original reflection value and the transmittance; determine the target illumination value based on the first highlight value, the reflection value and the second highlight value; and perform illumination rendering on the outer surface of the virtual object according to the target illumination value.
- the present application also provides a device for rendering an exterior of a virtual object.
- the device comprises:
- a varnish layer processing module used to determine the first highlight value of the varnish layer of the virtual object under the light source; the varnish layer is the varnish material covering the outer surface of the virtual object;
- An acquisition module used to acquire the original reflection value of the exterior surface layer and the transmittance of the varnish layer
- An exterior surface processing module used to determine the reflection value and the second highlight value of the exterior surface under the light source according to the original reflection value and the transmittance
- a target illumination value determination module configured to determine a target illumination value based on the first highlight value, the reflection value, and the second highlight value
- the rendering module is used to perform lighting rendering on the exterior of the virtual object according to the target lighting value.
- the present application further provides a computer device, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the one or more processors perform the following steps:
- the varnish layer is the varnish material covering the outer surface of the virtual object; obtain the original reflection value of the outer surface and the transmittance of the varnish layer; determine the reflection value and the second highlight value of the outer surface under the light source based on the original reflection value and the transmittance; determine the target illumination value based on the first highlight value, the reflection value and the second highlight value; and perform illumination rendering on the outer surface of the virtual object according to the target illumination value.
- one or more non-volatile readable storage media having computer-readable instructions stored thereon, the computer-readable When the read instruction is executed by the processor, one or more processors implement the following steps:
- the varnish layer is the varnish material covering the outer surface of the virtual object; obtain the original reflection value of the outer surface and the transmittance of the varnish layer; determine the reflection value and the second highlight value of the outer surface under the light source based on the original reflection value and the transmittance; determine the target illumination value based on the first highlight value, the reflection value and the second highlight value; and perform illumination rendering on the outer surface of the virtual object according to the target illumination value.
- the present application further provides a computer program product, comprising computer-readable instructions, which, when executed by a processor, implement the following steps:
- the varnish layer is the varnish material covering the outer surface of the virtual object; obtain the original reflection value of the outer surface and the transmittance of the varnish layer; determine the reflection value and the second highlight value of the outer surface under the light source based on the original reflection value and the transmittance; determine the target illumination value based on the first highlight value, the reflection value and the second highlight value; and perform illumination rendering on the outer surface of the virtual object according to the target illumination value.
- FIG1 is a diagram of an application environment of a method for rendering an exterior of a virtual object in one embodiment
- FIG2a is a schematic diagram of a method for rendering an exterior of a virtual object in one embodiment
- FIG2 b is a schematic diagram of a flow chart of a method for rendering an exterior of a virtual object in one embodiment
- FIG3 is a schematic diagram of a related art in which the material of the outer casing is a metal material
- FIG4 is a schematic diagram of a related art in which the outer material is a combination of metal material and silk material;
- FIG5 is a schematic diagram showing that the outer decoration of a virtual object has a varnish texture at one viewing angle in one embodiment
- FIG6 is a schematic diagram showing that the outer cover of a virtual object has a varnish texture from another viewing angle in one embodiment
- FIG7 is a schematic diagram of an exterior obtained by rendering when no edge adjustment coefficient is introduced in one embodiment
- FIG8 is a schematic diagram of an exterior rendered when an edge adjustment coefficient is introduced in one embodiment
- FIG9 is a schematic diagram showing abnormal stretching of an outer surface layer covered with a varnish layer in one embodiment
- FIG10 is a schematic diagram of improving abnormal stretching of an exterior surface layer covered with a varnish layer in one embodiment
- FIG11 is an overall schematic diagram of an exterior rendered when the ambient light map is not adjusted in one embodiment
- FIG12 is an overall schematic diagram of an exterior rendered when adjusting an ambient light map in one embodiment
- FIG13 is a schematic diagram of a flow chart of a method for rendering an exterior of a virtual object in another embodiment
- FIG14 is a block diagram of a device for rendering an exterior of a virtual object in one embodiment
- FIG. 15 is a diagram showing the internal structure of a computer device in one embodiment.
- the exterior rendering method of a virtual object provided in an embodiment of the present application can be applied in an application environment as shown in FIG. 1 .
- the terminal 102 communicates with the server 104 through a network.
- the data storage system can store data that the server 104 needs to process.
- the data storage system can be integrated on the server 104, or placed on a cloud or other network server; the outer decoration rendering method of the virtual object can be executed by the terminal 102, or by the server 104, or by the terminal 102 and the server 104 in collaboration.
- the terminal 102 can determine the first highlight value of the varnish layer of the virtual object under the light source, the terminal 102 can obtain the original reflection value of the exterior surface and the transmittance of the varnish layer, the terminal 102 can determine the reflection value and the second highlight value of the exterior surface under the light source based on the original reflection value and the transmittance, the terminal 102 can determine the target lighting value based on the first highlight value, the reflection value and the second highlight value, and the terminal 102 can also perform lighting rendering on the exterior of the virtual object according to the target lighting value.
- the terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an IoT device, and a portable wearable device.
- the IoT device may be a smart speaker, a smart TV, a smart air conditioner, and a smart vehicle-mounted device, etc.
- the portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc.
- the Server 104 can be an independent physical server or a service node in a blockchain system.
- the service nodes in the blockchain system form a peer-to-peer (P2P) network.
- P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).
- server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
- cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
- the terminal 102 and the server 104 can be connected via Bluetooth, USB (Universal Serial Bus) or network and other communication connection methods, which are not limited in this application.
- USB Universal Serial Bus
- a method for rendering an outer shell of a virtual object is provided.
- the method is executed by the terminal or the server in FIG. 1, or can be executed by the terminal and the server in FIG. 1 in collaboration.
- the method is described by taking the method executed by the terminal in FIG. 1 as an example, and includes the following steps:
- Step 202 determining a first highlight value of a varnish layer of the virtual object under a light source; the varnish layer is a varnish material covering the outer surface of the virtual object.
- Virtual objects are different from real objects.
- Virtual objects are virtual character images.
- the virtual character image can be a player character image used to represent the user in the virtual scene and controlled by the user, or it can be a non-player character image used to represent the user and interact with the user in the virtual scene.
- virtual objects can be virtual people, virtual animals, etc.; virtual objects can also be other virtual objects in the virtual scene, for example, virtual building components (such as tables, chairs, doors, windows), virtual transportation tools (such as vehicles, ships), etc.
- a virtual scene may be a scene that simulates a real environment.
- a virtual scene may include a virtual sky, rivers, mountains, plants, animals, buildings, etc.
- the virtual scene may be displayed in real time when a game application is running on a terminal.
- the outerwear refers to the external equipment of the virtual object, including but not limited to: clothing, props and decorations; in actual applications, the outerwear of the virtual object in the virtual scene can be obtained by purchasing or participating in activities, and changing the outerwear of the virtual object can change the image of the virtual object.
- the outerwear of the virtual object can be the clothing of the virtual object, and changing the clothing of the virtual object can change the image of the user's player character; when the virtual object is a virtual vehicle in a virtual scene, the decorations of the virtual vehicle can be replaced to change the image of the virtual vehicle.
- the outer surface layer is the surface layer of the outer clothing, and the display style of the outer clothing is related to the material of the outer surface layer;
- the material of the outer surface layer includes but is not limited to: metal material, leather material and cloth material, and can also be a material obtained by splicing at least two of metal material, leather material or cloth material;
- the outer clothing of the virtual object includes armor, and the surface material of the armor is obtained by splicing metal material and leather material, then the display style of the armor is related to the metal material and the leather material.
- the varnish layer is covered on the surface of the exterior.
- the varnish layer is added to the surface of the exterior so that the exterior has a varnish texture.
- Varnish is a coating that is applied on a material to form a transparent paint film that can show the original texture of the material, so that the exterior has a varnish texture.
- the varnish texture can refer to the exterior covered with varnish having a bright visual effect, and when the visual angle is moved, it can present a glittering effect.
- the light source may be a direct light source; the light emitted by the direct light source comes from a light source in the virtual scene.
- the direct light source is different from an indirect light source, and the light emitted by the indirect light source comes from an object in the virtual scene.
- the light sources in the virtual scene include but are not limited to parallel light sources and point light sources.
- the parallel light sources can be used to simulate the sun or the moon, and the position of the point light source in the virtual scene can be the position of the camera model.
- the camera model can automatically follow the virtual object in the virtual scene.
- the camera model changes simultaneously with the position of the virtual object in the virtual environment; the camera model can be behind the virtual object by default, and the virtual object in the virtual scene can be observed from different angles through the camera model. For example, by changing the viewing angle, the virtual object can be observed from the rear of the virtual object to the side of the virtual object.
- the first highlight value refers to the highlight value generated on the varnish layer by the light emitted by the light source, and can be used to reflect the degree of specular reflection of the light emitted by the light source by the varnish layer.
- the terminal obtains the roughness of the varnish layer, determines the reflective roughness and visibility of the varnish layer according to the roughness of the varnish layer, and determines the first highlight value of the varnish layer under the light source according to the reflective roughness and visibility of the varnish layer.
- the reflective roughness can reflect the reflective effect of the varnish layer on light, and the visibility can reflect the degree of light blocking by the varnish layer.
- the first highlight value is calculated in combination with the reflective roughness and visibility of the varnish layer, which can improve the accuracy of the first highlight value.
- the light source is a direct light source
- the terminal can determine the first highlight value of the varnish layer under the direct light source according to the reflective roughness and visibility of the varnish layer.
- the first highlight value is the first highlight value of the virtual object's to-be-rendered position on the varnish layer
- the to-be-rendered position is a position on the exterior of the virtual object, which can be described by the coordinate system of the virtual scene; different to-be-rendered positions may have different first highlight values on the varnish layer, so that different to-be-rendered positions of the varnish layer have different degrees of specular reflection of light, and the rendered varnish layer has an uneven display effect.
- Step 204 obtaining the original reflection value of the exterior surface layer and the transmittance of the varnish layer.
- the original reflection value is the reflection value of the outer surface, that is, the reflection value of the outer surface when the outer surface is not covered with a varnish layer; when the material of the outer surface is a mirror material, the original reflection value may be the original reflection value generated by mirror reflection; when the material of the outer surface is not a mirror material, the original reflection value may be the original reflection value generated by diffuse reflection.
- the original reflection value of the outer surface is the original reflection value of the position to be rendered on the outer surface
- the original reflection values of different positions to be rendered on the outer surface may be different; for example, when the material of the outer surface includes texture, the texture is an effect presented due to different roughness, and the roughness of different positions to be rendered is different, resulting in different reflections of light on the outer surface at different positions to be rendered, and thus the original reflection values of different positions to be rendered on the outer surface are different; for example, when the material of the outer surface is a combination of mirror material and non-mirror material, the reflections of light on the outer surface at different positions to be rendered may also be different, and thus the original reflection values of different positions to be rendered on the outer surface are different.
- the transmittance of the varnish layer is the transmittance of the position to be rendered on the varnish layer.
- the transmittance of the varnish layer is used to describe the attenuation degree of light penetrating the varnish layer.
- the transmittance can be used to simulate the optical effect of light penetrating the varnish layer.
- the terminal obtains the original reflection value of the outer surface layer, which can be determined based on the material of the outer surface layer.
- the embodiment of the present application does not limit the specific value of the original reflection value of the outer surface layer; the terminal obtains the transmittance of the varnish layer, which can be determined based on the thickness, metallicity and color pixel value of the varnish layer; the terminal obtains the outer surface layer.
- the original reflection value of the layer and the transmittance of the varnish layer are used to facilitate the subsequent determination of the reflection value and the second highlight value of the exterior surface layer covered with the varnish layer, so that the reflection value and the second highlight value are related to the attenuation degree of light penetrating the varnish layer, thereby improving the accuracy of the reflection value and the second highlight value of the exterior surface layer.
- the obtained original reflection value and transmittance correspond to the same position to be rendered, that is, the terminal obtains the original reflection value of the position to be rendered on the outer surface layer, and obtains the transmittance of the position to be rendered on the varnish layer.
- Step 206 determining the reflection value and the second highlight value of the outer surface layer under the light source according to the original reflection value and the transmittance.
- the reflection value of the outer surface under the light source is the reflection value of the outer surface when the outer surface is covered with a varnish layer.
- the second highlight value is the highlight value generated on the outer surface after the light emitted by the light source penetrates the varnish layer.
- the determined reflection value is the reflection value of the position to be rendered on the outer surface layer
- the determined second highlight value is also the second highlight value of the position to be rendered on the outer surface layer
- the terminal determines the reflection value of the outer surface layer based on the original reflection value, the reflection intensity and the transmittance of the varnish layer, the terminal determines the second Fresnel coefficient of the outer surface layer, and determines the second highlight value according to the second Fresnel coefficient and the transmittance.
- the second Fresnel coefficient is used to reflect the ratio of the reflected and transmitted light intensities when the light passes through the interface of two media.
- the light intensity of the light emitted by the light source after penetrating the varnish layer can be determined according to the second Fresnel coefficient and the transmittance, and then the second highlight value of the outer surface layer can be determined according to the light intensity of the light emitted by the light source after penetrating the varnish layer, so that the second highlight value is related to the light intensity after the light penetrates the varnish layer and the attenuation degree of the light penetrating the varnish layer, thereby improving the accuracy of the second highlight value.
- the light source is a direct light source
- the terminal can determine the reflection value and the second highlight value of the original outer layer under the light emitted by the direct light source and penetrating the varnish layer based on the original reflection value and the transmittance, so that the reflection value can be used to represent the reflection value of the outer surface layer to the light emitted by the direct light source and penetrating the varnish layer, and the second highlight value can be used to represent the highlight value generated on the outer surface layer by the light emitted by the direct light source and penetrating the varnish layer, so as to facilitate the subsequent rendering of the display effect of the outer surface layer under the direct light source based on the reflection value and the second highlight value.
- Step 208 determining a target illumination value based on the first highlight value, the reflection value, and the second highlight value.
- the target illumination value is a target illumination value of a position to be rendered in the exterior of the virtual object.
- the first highlight value is the illumination value of the varnish layer
- the terminal performs linear processing on the reflection value and the second highlight value to obtain the illumination value of the outer surface layer, and linearly processes the illumination value of the varnish layer and the illumination value of the outer surface layer to obtain the target illumination value.
- the first highlight value, the reflection value, and the second highlight value correspond to the same position to be rendered on the outer surface of the virtual object;
- the target illumination value is determined in combination with the illumination value of the varnish layer and the outer surface layer, so that the target illumination value can reflect the illumination value obtained by combining the varnish layer and the outer surface layer, and then rendering based on the target illumination value can obtain the visual effect produced by the superposition of the varnish layer and the outer surface layer, so that the outer decoration has a varnish texture.
- the reflection value and the second highlight value are linearly processed to obtain the illumination value of the outer surface layer, which can be obtained by adding the reflection value and the second highlight value; or the terminal obtains the reflection weight and the highlight weight, and performs weighted summation of the reflection value and the second highlight value according to the reflection weight and the highlight weight to obtain the illumination value of the outer surface layer.
- Adding the reflection value and the second highlight value can reduce the hardware resources required to determine the illumination value of the outer surface layer and improve rendering efficiency; performing weighted summation of the reflection value and the second highlight value can make the illumination value of the outer surface layer biased towards the one with a higher weight between the reflection value and the second highlight value, highlighting the illumination effect brought by the reflection value or the second highlight value with a higher weight.
- the illumination value of the varnish layer and the illumination value of the outer surface layer are linearly processed to obtain the target illumination value, which can be the illumination value of the varnish layer and the illumination value of the outer surface layer added to obtain the target illumination value; or the terminal obtains the illumination weight of the varnish layer and the illumination weight of the outer surface layer, and performs weighted summation of the illumination value of the varnish layer and the illumination value of the outer surface layer according to the illumination weight of the varnish layer and the illumination weight of the outer surface layer to obtain the illumination value of the outer surface layer and the target illumination value.
- Adding the illumination value of the varnish layer and the illumination value of the outer surface layer can reduce the hardware resources required to determine the target illumination value and improve rendering efficiency; weighted summation of the illumination value of the varnish layer and the illumination value of the outer surface layer can make the target illumination value biased towards the one with a higher weight between the illumination value of the varnish layer and the illumination value of the outer surface layer, thereby highlighting the illumination effect of the varnish layer or the outer surface layer with a higher weight.
- the first highlight value of the position to be rendered in the varnish layer, the reflection value in the outer surface layer, and the second highlight value are added to obtain the target illumination value of the position to be rendered.
- Step 210 performing lighting rendering on the exterior of the virtual object according to the target lighting value.
- the terminal can render in a high-definition rendering pipeline through a lighting shader according to a target lighting value;
- the target lighting value is a target lighting value of a position to be rendered on the exterior of the virtual object, and the lighting shader can calculate a color pixel value according to the target lighting value, and display the color pixel value to achieve rendering.
- the highlight effect on the varnish layer, the reflection effect on the exterior surface layer, and the highlight effect can be superimposed to obtain a visual effect of covering the exterior surface layer with a varnish layer, so that the exterior surface layer has a varnish texture, thereby improving the visual effect.
- the terminal can render the target exterior surface layer in the high-definition rendering pipeline through the illumination shader based on the target illumination value of each position to be rendered on the exterior, and the target exterior surface layer is obtained by covering the varnish layer on the exterior surface layer.
- the target illumination value is determined based on the first highlight value, the reflection value, and the second highlight value.
- the display style of the outerwear of the virtual object is only related to the surface layer of the outerwear.
- the display style of the armor in Figure 3 is only related to the metal material.
- the display style of the clothing in Figure 4 is only related to the metal and silk materials.
- Figure 5 is a display effect at one viewing angle when a varnish layer is covered on the surface of the outer garment in an embodiment of the present application
- Figure 6 is a display effect at another viewing angle when a varnish layer is covered on the surface of the outer garment in an embodiment of the present application.
- the armor including breastplate and arm armor
- the outer garment rendered in the embodiment of the present application can better reflect the real texture of the outer garment material and enhance the visual effect.
- the first highlight value of the varnish layer under the light source is determined
- the reflection value and the second highlight value of the exterior surface under the light source are determined according to the original reflection value and the transmittance
- the target illumination value is determined according to the first highlight value
- the exterior of the virtual object is illuminated and rendered according to the target illumination value.
- the varnish layer roughness is the roughness of the position to be rendered on the varnish layer; when the varnish layer roughness of different positions to be rendered is different, the reflection effect of light at different positions to be rendered is also different, which in turn affects the first highlight value of the position to be rendered; the rougher the varnish layer (the greater the varnish layer roughness), the darker the highlight effect (the smaller the first highlight value), and the smoother the varnish layer (the smaller the varnish layer roughness), the brighter the highlight effect (the larger the first highlight value).
- the first normal vector of the varnish layer is the first normal vector of the position to be rendered on the varnish layer; the first normal vector of the position to be rendered will affect the first highlight value of the position to be rendered.
- the first highlight values of different positions to be rendered are also different, thereby making the varnish layer have a concave-convex feeling.
- the varnish layer can have the effect of scratches, dents or bulges.
- the first half-angle vector of the varnish layer is the intermediate vector between the light source direction vector of the varnish layer and the first sight direction vector.
- the light source direction vector of the varnish layer is the vector pointing to the direct light source at the position to be rendered on the varnish layer;
- the first sight direction vector is the vector pointing to the camera model at the position to be rendered on the varnish layer.
- the varnish layer is uneven, which can be understood as the varnish layer includes many microsurfaces, and light is specularly reflected or refracted on each microsurface; the light is reflected or refracted on the varnish layer, which is actually specularly reflected or refracted on the microsurface corresponding to the first normal vector, and the probability distribution of the first normal vector obeys the microsurface distribution function; the reflection roughness of the varnish layer can reflect the distribution of the first normal vector of the microsurface on the varnish layer, and then reflect the reflection effect of the varnish layer on light. The lower the reflection roughness, the closer the reflection effect of the varnish layer is to specular reflection, and the higher the reflection roughness, the stronger the diffuse reflection effect of the varnish layer.
- the micro-surface of the varnish layer may block the incident light and the outgoing light.
- the visibility of the varnish layer can reflect the degree of light blocking by the micro-surface on the varnish layer. The higher the visibility, the higher the degree of light blocking by the micro-surface on the varnish layer, and the lower the visibility, the lower the degree of light blocking by the micro-surface on the varnish layer.
- the degree of light blocking by the micro-surface on the varnish layer can also affect the degree of light reflection in the varnish layer. The lower the visibility, the lower the degree of light reflection in the varnish layer, and the higher the visibility, the lower the degree of light reflection in the varnish layer.
- the reflection intensity of the varnish layer is used to reflect the mirror reflection effect of the varnish layer.
- the terminal obtains the roughness of the varnish layer, the first normal vector and the first half-angle vector of the varnish layer at the position to be rendered on the varnish layer, and determines the normal distribution of the micro-surface corresponding to the position to be rendered in the varnish layer according to the roughness of the varnish layer, the first normal vector and the first half-angle vector of the position to be rendered on the varnish layer, so as to obtain the reflection roughness of the position to be rendered in the varnish layer; determines the visibility of the position to be rendered on the varnish layer according to the roughness of the varnish layer, the first normal vector, the first sight direction vector and the light source direction vector of the varnish layer at the position to be rendered; determines the reflectivity of the position to be rendered on the varnish layer based on the reverse roughness and visibility of the position to be rendered on the varnish layer, and determines the first highlight value of the varnish layer under the direct light source according to the reflectivity and the reflection intensity of the position to be rendered on the varnish layer.
- the first normal vector and the first half-angle vector of the varnish layer before determining the reflection roughness of the varnish layer based on the roughness of the varnish layer of the virtual object, the first normal vector and the first half-angle vector of the varnish layer, it also includes: obtaining the roughness map of the varnish layer, and obtaining the roughness of the varnish layer from the roughness map; obtaining the first normal map of the varnish layer, and obtaining the first normal vector from the first normal map.
- the roughness map stores the roughness of the varnish layer at each position to be rendered on the varnish layer.
- the roughness of the varnish layer at each position to be rendered on the varnish layer can be obtained from the roughness map;
- the first normal map stores the first normal vector of each position to be rendered on the varnish layer.
- the first normal vector of each position to be rendered on the varnish layer can be obtained from the first normal map;
- the display effect of the varnish layer can be achieved by custom designing the roughness map and the first normal map.
- the roughness map and the first normal map can be designed according to the display requirements of the varnish layer to produce reflection effects, scratches, and dents of the varnish layer.
- the reflective roughness of the varnish layer by determining the reflective roughness of the varnish layer, the mirror reflection effect of light in the varnish layer can be obtained, and by determining the visibility of the varnish layer, the degree to which light is blocked in the varnish layer can be obtained.
- the reflective roughness and visibility of the varnish layer By combining the reflective roughness and visibility of the varnish layer to determine the first highlight value of the varnish layer, the accuracy of the first highlight value can be improved.
- the reflective roughness of the varnish layer is determined, including: determining a roughness coefficient based on the roughness of the varnish layer of the virtual object; fusing the first normal vector and the first half-angle vector of the varnish layer to obtain a first fusion result; and determining the reflective roughness of the varnish layer based on the roughness coefficient and the first fusion result.
- the reflective roughness of the varnish layer is determined according to the roughness of the varnish layer, and the reflective roughness can reflect the reflection effect of light on the varnish layer, so that the reflection effect of the varnish layer conforms to the real texture of the varnish layer.
- the terminal calculates the square of the reflection roughness to obtain a candidate roughness coefficient, and calculates the square of the candidate roughness coefficient to obtain the roughness coefficient.
- the roughness coefficient may be a value between 0 and 1.
- the terminal determines a first product of the roughness coefficient and a first fusion result, determines a first difference between the first product and the first fusion result, determines a second product between the first difference and the first fusion result, and then determines a candidate roughness coefficient through the second product; the terminal calculates the square of the candidate roughness coefficient, determines the ratio between the roughness coefficient and the square of the candidate roughness coefficient, and obtains the reflective roughness of the varnish layer.
- the roughness coefficient is the roughness coefficient of the position to be rendered on the varnish layer
- the first normal vector and the first half-angle vector are both the first normal vector and the first half-angle vector of the position to be rendered on the varnish layer
- the first fusion result is the first fusion result corresponding to the position to be rendered on the varnish layer
- the reflection roughness of the varnish layer is also the reflection roughness of the position to be rendered on the varnish layer; in the same way as above, the reflection roughness of each position to be rendered on the exterior of the virtual object on the varnish layer can be determined. Determining the reflection roughness based on the first normal vector and the first half-angle vector of the position to be rendered refines the rendering scale to the pixel scale of the position to be rendered, which can bring a varnish texture closer to reality.
- the terminal can process the roughness coefficient and the first fusion result through the GGX distribution function in the PBR lighting model to determine the reflection roughness of the varnish layer.
- PBR Physicallly-Based Rendering
- the GGX distribution is the Trowbridge-Reitz distribution, which can be used to render specular reflections.
- the reflection roughness of the varnish layer is determined on the micro surface of the varnish layer through the GGX distribution function, so that the reflection roughness can reflect the reflection effect of the micro surface of the varnish layer on light.
- the reflection roughness is directly determined through the GGX distribution function, which can save the time required to determine the reflection roughness and improve rendering efficiency.
- the first normal vector and the first half-angle vector of the varnish layer are fused, and the reflection roughness of the varnish layer is determined based on the first fusion result and the roughness coefficient obtained by the fusion.
- the reflection roughness can reflect the reflection effect of light on the varnish layer, so that the reflection effect of the varnish layer conforms to the real texture of the varnish layer.
- the first highlight value is determined based on the reflection roughness of the varnish layer, so that the first highlight value can reflect the degree of specular reflection of light by the varnish layer.
- the visibility of the varnish layer is determined based on the roughness of the varnish layer, the first normal vector, the first sight direction vector of the varnish layer, and the light source direction vector of the direct light source, including: determining the roughness coefficient based on the roughness of the varnish layer of the virtual object; fusing the first normal vector and the first sight direction vector of the varnish layer to obtain a second fusion result; fusing the first normal vector and the light source direction vector of the direct light source to obtain a third fusion result; determining the visibility of the varnish layer in the sight direction and the visibility in the light source direction based on the roughness coefficient, the second fusion result, and the third fusion result; determining the visibility of the varnish layer based on the visibility in the sight direction and the visibility in the light source direction.
- the visibility of the varnish layer is determined according to the roughness of the varnish layer, so that the visibility can reflect the degree of light blocking by the varnish layer, and further reflect the reflection effect of light on the varnish layer, so that the reflection effect of the varnish layer on light conforms to the real texture of the varnish layer.
- the terminal calculates the square of the reflective roughness to obtain a candidate roughness coefficient, and calculates the square of the candidate roughness coefficient to obtain the roughness coefficient.
- the roughness coefficient can be a value between 0 and 1.
- the terminal can use the first fusion method to process the roughness coefficient, the second fusion result and the third fusion result to obtain the visibility of the varnish layer in the direction of sight; use the second fusion method to process the roughness coefficient, the second fusion result and the third fusion result to obtain the visibility of the varnish layer in the direction of the light source.
- the first fusion method is different from the second fusion method.
- the first intermediate result can be determined based on the roughness coefficient and the second fusion result, and then the first intermediate result is fused with the third fusion to obtain the visibility of the varnish layer in the line of sight direction; in the second fusion method, the first intermediate result can be determined based on the roughness coefficient and the third fusion result.
- the result determines a second intermediate result, and then the second intermediate result is fused with the second fusion result to obtain the visibility of the varnish layer in the direction of the light source.
- the terminal determines the sum of the visibility in the sight direction and the visibility in the light source direction to obtain a candidate visibility, determines the ratio between the reference coefficient and the candidate visibility, and obtains the visibility of the varnish layer.
- the reference coefficient may be 0.5.
- the roughness coefficient, the second fusion result, and the third fusion result are all the reflective roughness of the position to be rendered on the varnish layer, and thus the visibility of the varnish layer is also the visibility of the position to be rendered on the varnish layer.
- the visibility of each position to be rendered on the exterior of the virtual object on the varnish layer can be determined. Determining visibility based on the roughness coefficient of the position to be rendered, the second fusion result, and the third fusion result refines the rendering scale to the pixel scale of the position to be rendered, which can bring a varnish texture that is closer to reality.
- the visibility of the varnish layer in the sight direction and the visibility in the light source direction are determined, including: determining the second difference between the initial coefficient and the roughness coefficient; determining the third product between the second difference and the second fusion result, and determining the fourth product between the third product and the roughness coefficient; determining the product between the fourth product and the third fusion result to obtain the visibility of the varnish layer in the sight direction; and determining the visibility of the varnish layer in the light source direction based on the roughness coefficient, the second difference, the second fusion result, and the third fusion result.
- the accuracy of the degree of light blocking of the varnish layer in the sight direction is improved, so that the reflection effect of the varnish layer on light is consistent with the real texture of the varnish layer.
- the terminal calculates the second difference obtained by subtracting the roughness from the initial coefficient, multiplies the second difference and the second fusion result to obtain a third product, multiplies the third product and the roughness coefficient to obtain a fourth product, and multiplies the fourth product and the third fusion result to obtain the visibility of the varnish layer in the line of sight.
- the initial coefficient can be set according to needs, for example, the initial coefficient can be 1.
- the visibility of the varnish layer in the direction of the light source is determined, including: determining the fifth product between the second difference and the third fusion result; determining the sixth product between the roughness coefficient and the fifth product; and determining the product between the sixth product and the second fusion result, to obtain the visibility of the varnish layer in the direction of the light source.
- the accuracy of the degree of light blocking of the varnish layer in the direction of the light source is improved, so that the reflection effect of the varnish layer on light is consistent with the real texture of the varnish layer.
- the terminal can process the roughness coefficient, the second fusion result, and the third fusion result through the Smith function in the PBR lighting model to obtain the visibility of the varnish layer, wherein the Smith function is a shielding function that can be used to determine the degree of shielding of the microsurface on the varnish layer to the incident light and the outgoing light, and then determine the visibility.
- the Smith function is a shielding function that can be used to determine the degree of shielding of the microsurface on the varnish layer to the incident light and the outgoing light, and then determine the visibility.
- the Smith function is a shielding function that can be used to determine the degree of shielding of the microsurface on the varnish layer to the incident light and the outgoing light, and then determine the visibility.
- the Smith function is a shielding function that can be used to determine the degree of shielding of the microsurface on the varnish layer to the incident light and the outgoing light, and then determine the visibility.
- the Smith function is a shielding function that can be used to determine the degree of shielding of the microsurface on the varnish layer
- the first normal vector of the varnish layer and the first sight direction vector are fused to obtain a second fusion result
- the first normal vector and the light source direction vector of the varnish layer are fused to obtain a third fusion result.
- the visibility of the varnish layer is determined according to the roughness coefficient, the second fusion result and the second fusion result, so that the visibility can reflect the degree of light blocking by the varnish layer, and then reflect the reflection effect of light on the varnish layer, so that the reflection effect of the varnish layer on light conforms to the real texture of the varnish layer.
- the first highlight value is determined according to the visibility of the varnish layer, so that the first highlight value can reflect the degree of specular reflection of light by the varnish layer.
- the first highlight value of the varnish layer under a direct light source is determined based on the reflective roughness, visibility, and reflective intensity of the varnish layer, including: determining the reflectivity of the varnish layer based on the reflective roughness, visibility, and the first Fresnel coefficient of the varnish layer; determining the first highlight value of the varnish layer under a direct light source based on the reflectivity of the varnish layer and the reflective intensity of the varnish layer.
- the incident angle of light affects the reflectivity, thereby improving the accuracy of the first highlight value determined based on the reflectivity.
- the first Fresnel coefficient is the Fresnel coefficient of the position to be rendered on the varnish layer; the first Fresnel coefficient is used to reflect the reflection intensity of light at different incident angles.
- the varnish layer performs specular reflection on the light, and when the incident angle is small, the varnish layer scatters the light. In actual rendering, the varnish layer scatters the light to show a rough effect.
- the terminal fuses the first normal vector and the light source direction vector of the varnish layer to obtain a third fusion result; determines the product between the reflection roughness, visibility and the first Fresnel coefficient of the varnish layer to obtain the reflectivity of the varnish layer, determines the reflection intensity of the varnish layer, the product between the third fusion result and the reflectivity, and obtains the first highlight value of the varnish layer under direct light source.
- the first Fresnel coefficient is the Fresnel coefficient of the position to be rendered on the varnish layer
- the reflectivity of the varnish layer determined based on the first Fresnel coefficient is the Fresnel coefficient of the position to be rendered on the varnish layer
- the first highlight value is also the first highlight value of the position to be rendered on the varnish layer.
- the reflectivity of the varnish layer is determined based on the reflective roughness, visibility and the first Fresnel coefficient of the varnish layer, and the first highlight value is determined based on the reflectivity of the varnish layer.
- the incident angle of light affects the reflectivity, thereby improving the accuracy of the first highlight value determined based on the reflectivity.
- the light source includes a direct light source; according to the original reflection value and the transmittance, the reflection value and the second highlight value of the outer surface layer under the light source are determined, including: based on the original reflection value, the transmittance and the reflection intensity of the varnish layer, the reflection value of the outer surface layer reflecting the direct transmitted light is determined; the direct transmitted light is the light emitted by the direct light source and transmitted through the varnish layer; based on the reflectivity corresponding to the second sight direction vector, the second half-angle vector and the second normal vector of the outer surface layer, the second Fresnel coefficient of the outer surface layer is determined; based on the transmittance and the second Fresnel coefficient, the second highlight value generated by the direct transmitted light on the outer surface layer is determined.
- the reflection value of the outer surface layer covered with the varnish layer is determined in combination with the original reflection value, the transmittance and the reflection intensity, thereby improving the accuracy of the reflection value;
- the second Fresnel coefficient can be used to reflect the ratio of the reflected and transmitted light intensity when the light passes through the interface of two media, and the second Fresnel coefficient is introduced so that the second highlight value is related to the light intensity ratio (the ratio of the reflected and transmitted light intensity when the light passes through the interface of two media), thereby improving the accuracy of the second highlight value.
- the original reflection value is the original reflection value of the position to be rendered on the outer surface layer, and different positions to be rendered may have different original reflection values on the outer surface layer; in practical applications, the original reflection value of the outer surface layer may be a diffuse reflection value.
- the light emitted by the direct light source passes through the varnish layer and illuminates the exterior surface.
- the light emitted by the direct light source after passing through the varnish layer is taken as the direct transmitted light.
- the direct transmitted light affects the original reflection value of the exterior surface to obtain the reflection value.
- the second sight line direction vector is a vector pointing to the camera model at the position to be rendered on the outer surface;
- the second half-angle vector is an intermediate vector between the light source direction vector of the outer surface and the second sight line direction vector.
- the light source direction vector of the outer surface is used to indicate the direction in which the direct transmitted light shines on the position to be rendered on the outer surface.
- the light source direction vector of the outer surface can also be understood as the direction vector of the direct transmitted light.
- the second normal vector of the outer surface is the second normal vector of the position to be rendered on the outer surface.
- the second normal vector of the position to be rendered will affect the second highlight value of the position to be rendered.
- the second highlight values of different positions to be rendered are also different, which can render the rough effect of the outer surface.
- the reflectivity corresponding to the second normal vector is the reflectivity in the second normal direction of the position to be rendered; and the second Fresnel coefficient is the Fresnel coefficient of the position to be rendered on the outer surface.
- the terminal can obtain a diffuse reflection map of the outer surface, and obtain the original reflection value of the position to be rendered on the outer surface from the diffuse reflection map; based on the original reflection value of the position to be rendered on the outer surface, the transmittance of the position to be rendered on the varnish layer, and the reflection intensity of the position to be rendered on the varnish layer, determine the reflection value of the position to be rendered on the outer surface under direct transmitted light.
- the terminal obtains the light source direction vector and the second sight line direction vector of the position to be rendered on the outer surface, determines the second half-angle vector according to the light source direction vector and the second sight line direction vector of the outer surface, and obtains the reflectivity corresponding to the second normal vector.
- the terminal may determine the second Fresnel coefficient of the position to be rendered on the outer surface layer according to the reflectivity corresponding to the second sight direction vector, the second half-angle vector and the second normal vector of the position to be rendered on the outer surface layer.
- the terminal obtains an initial Fresnel value of the position to be rendered on the outer surface, where the initial Fresnel value is used to represent the Fresnel coefficient when the light is vertically incident; the terminal determines the product of the initial Fresnel value of the position to be rendered on the outer surface, the second Fresnel coefficient and the reflectivity in the second normal direction of the position to be rendered, and obtains the second highlight value of the position to be rendered on the outer surface.
- the second highlight value of each position to be rendered on the outer casing of the virtual object on the outer casing surface layer may be determined.
- the reflection value of the outer surface layer to directly transmitted light is determined in combination with the original reflection value of the original outer layer, the transmittance and the reflection intensity of the varnish layer, thereby improving the accuracy of the determined reflection value of the outer surface layer after being covered with the varnish layer;
- the second Fresnel coefficient is introduced so that the second highlight value is related to the ratio of the reflected light intensity and the transmitted light intensity when the light passes through the interface of two media, thereby improving the accuracy of the second highlight value;
- the illumination result of the outer surface layer under the direct light source is determined by the reflection value and the second highlight value, thereby making the rendering effect of the outer surface layer after being covered with the varnish layer more realistic.
- determining the reflection value of the outer surface layer reflecting the directly transmitted light includes: determining a candidate reflection value of the outer surface layer based on the original reflection value, transmittance, and initial Fresnel value; interpolating the original reflection value and the candidate reflection value according to the reflection intensity of the varnish layer to obtain the reflection value of the outer surface layer reflecting the directly transmitted light. Interpolating according to the reflection intensity of the varnish layer makes the reflection value related to the reflection intensity of the varnish layer, thereby improving the accuracy of the reflection value.
- the terminal determines the product of the reflection value, transmittance and initial Fresnel value of the position to be rendered on the outer surface to obtain a candidate reflection value; the terminal determines the reflection intensity of the position to be rendered on the outer surface, interpolates the original reflection value and the candidate reflection value, and obtains the reflection value of the outer surface reflecting the direct transmitted light; that is, the reflection value is determined according to the transmittance of the varnish layer and the reflection intensity of the outer surface, so that the reflection value can better reflect the reflection effect of the outer surface on the light emitted by the direct light source and penetrating the varnish layer.
- the original reflection value of the exterior surface layer and the transmittance of the varnish layer before obtaining the original reflection value of the exterior surface layer and the transmittance of the varnish layer, it also includes: obtaining the color pixel value, metallicity and thickness of the varnish layer, determining the path distance of the light emitted by the direct light source penetrating the varnish layer according to the thickness, the first normal vector of the varnish layer, the first sight direction vector and the light source direction vector of the direct light source, determining the extinction coefficient based on the color pixel value, determining the light depth based on the extinction coefficient, thickness and path distance; and determining the transmittance of the varnish layer based on the light depth and the extinction coefficient.
- the terminal obtains a color map of the varnish layer, and obtains the color pixel value of the position to be rendered in the varnish layer from the color map; the terminal obtains a metalness map of the varnish layer, and obtains the metalness of the position to be rendered in the varnish layer from the metalness map; the thickness is the thickness of the varnish layer, which can be set according to the exterior display effect of the virtual object.
- the metallic degree of the position to be rendered in the varnish layer is used as the initial extinction coefficient of the position to be rendered in the varnish layer.
- the thickness of the position to be rendered in the varnish layer is normalized to obtain the normalized thickness; the normalized thickness is normalized again according to the first normal vector, the first sight direction vector and the light source direction vector to obtain the path distance of the light emitted by the direct light source penetrating the varnish layer; the terminal processes the color pixel value based on the function corresponding to the Beer-Lambert law to obtain the transmission pixel value of the position to be rendered in the outer surface layer, determines the extinction coefficient based on the transmission pixel value and the normalized thickness, and determines the light depth according to the extinction coefficient, the path distance and the normalized thickness; the terminal obtains the initial transmittance of the varnish layer at the position to be rendered; the initial transmittance and the candidate transmittance are interpolated based on the initial extinction coefficient to obtain the transmittance of the varnish layer.
- the normalized thickness is normalized again according to the first normal vector, the first sight direction vector and the light source direction vector to obtain the path distance of the light emitted by the direct light source penetrating the varnish layer, including the first normal vector and the first sight direction vector.
- Vector fusion is performed to obtain a second fusion result, and the first normal vector and the light source direction vector of the varnish layer are fused to obtain a third fusion result; based on the second fusion result, the third fusion result and the normalized thickness, the path distance of the light emitted by the direct light source penetrating the varnish layer is determined.
- Beer-Lambert law describes the attenuation law of light when it propagates in a medium, that is, the intensity of light decreases exponentially with the increase of propagation distance.
- the path distance of the light emitted by the direct light source penetrating the varnish layer is determined according to the color pixel value, metallicity and thickness of the varnish layer, the light depth is determined according to the extinction coefficient, the thickness of the varnish layer and the path distance, and the transmittance of the varnish layer is determined based on the light depth and the extinction coefficient.
- the transmittance of the varnish layer is used to describe the attenuation degree of light penetrating the varnish layer, and further based on the transmittance, the light emitted by the direct light source and penetrating the varnish layer can be determined, thereby improving the reflection value of the exterior surface reflecting the directly transmitted light and the accuracy of the highlight value generated by the directly projected light on the exterior surface.
- the terminal may also process the second fusion result, the third fusion result, the color pixel value and the metalness of the position to be rendered in the varnish layer through the CalcThinTransmission function in the PBR lighting model to obtain the transmittance of the position to be rendered in the varnish layer.
- the CalcThinTransmission function is a function for calculating inter-layer transmission; directly determining the transmittance of the varnish layer through the CalcThinTransmission function can save the time required to determine the transmittance and improve rendering efficiency.
- the candidate reflection value is determined by the initial Fresnel value, the original reflection value and the transmittance of the varnish layer, and the original reflection value and the candidate reflection value are interpolated according to the reflection intensity of the varnish layer to obtain the reflection value, so that the reflection value is affected by the reflection intensity of the varnish layer, thereby improving the accuracy of the reflection value, and rendering the exterior surface layer covered with the varnish layer based on the reflection value, so that the exterior surface layer covered with the varnish layer can obtain a more realistic reflection effect under direct light source.
- determining the second Fresnel coefficient of the outer surface layer includes: fusing the second sight direction vector and the second half-angle vector of the outer surface layer to obtain a fourth fusion result; and determining the second Fresnel coefficient of the outer surface layer based on the fourth fusion result and the reflectivity corresponding to the second normal vector. The accuracy of the second highlight value is improved, thereby improving the highlight effect of the outer surface layer covered with the varnish layer under direct light source.
- the terminal can determine the second Fresnel coefficient based on the reflectivity corresponding to the fourth fusion vector and the second normal vector by a simplified Fresnel equation, as shown in formula (1).
- BottomF is the second Fresnel coefficient of the position to be rendered on the outer surface layer
- f0 is the reflectivity corresponding to the second normal vector of the position to be rendered on the outer surface layer
- BottomVdH is the fourth fusion result of the position to be rendered on the outer surface layer.
- the second Fresnel coefficient is determined according to the reflectivity corresponding to the fourth fusion result and the second normal vector, so as to facilitate the subsequent determination of the second highlight value based on the second Fresnel coefficient, so that the second highlight value is related to the ratio of the reflected light intensity and the transmitted light intensity when the light passes through the varnish layer and the exterior surface layer, thereby improving the accuracy of the second highlight value, and further improving the highlight effect of the exterior surface layer covered with the varnish layer under direct light source.
- the exterior rendering method of a virtual object includes: determining the third highlight value of the varnish layer under an indirect light source based on the roughness of the varnish layer and the ambient light map of the environment in which the virtual object is located; determining the fourth highlight value generated by indirect transmitted light on the exterior surface based on the roughness of the exterior surface of the virtual object and the ambient light map; the indirect transmitted light is light emitted by the indirect light source and transmitted through the varnish layer; determining the target illumination value based on the first highlight value, the reflection value, the second highlight value, the third highlight value, and the fourth highlight value.
- the highlight effects and reflection effects generated by the varnish layer and the exterior surface under direct light sources and indirect light sources are superimposed, so that the varnish layer of the exterior surface has a higher brightness than the exterior surface.
- the paint texture is more realistic, improving the visual effect.
- the light source of the virtual environment also includes indirect light source.
- the light emitted by the indirect light source comes from objects in the virtual scene.
- the light emitted by the indirect light source can be the light reflected by the object when the light emitted by the direct light source shines on the object.
- the light emitted by the indirect light source can be simulated by an ambient light map.
- the first highlight value, the reflection value, and the second highlight value are determined based on the light emitted by the direct light source, and the third highlight value and the fourth highlight value are determined based on the light emitted by the indirect light source.
- the outer decoration surface roughness is the roughness of the position to be rendered on the outer decoration surface, and the outer decoration surface roughness of different positions to be rendered is different.
- the varnish layer performs specular reflection on the light emitted by the indirect light source
- the third highlight value can be used to indicate the degree of specular reflection of the light emitted by the indirect light source by the varnish layer.
- the light emitted by the indirect light source passes through the varnish layer and illuminates the exterior surface, and the light emitted by the indirect light source after passing through the varnish layer is taken as indirect transmitted light; the exterior surface performs specular reflection on the indirect transmitted light
- the fourth highlight value can be used to indicate the degree of specular reflection of the indirect transmitted light by the exterior surface.
- the terminal determines the first color pixel value of the position to be rendered in the varnish layer based on the roughness of the varnish layer and the ambient light map of the position to be rendered, and determines the third highlight value of the position to be rendered in the varnish layer under the indirect light source based on the first color pixel value and the first Fresnel coefficient of the position to be rendered.
- the terminal determines the second color pixel value of the position to be rendered in the outer surface layer based on the roughness of the outer surface layer and the ambient light map of the position to be rendered, and determines the fourth highlight value of the position to be rendered in the outer surface layer under the indirect light source based on the second color pixel value and the second Fresnel coefficient of the position to be rendered.
- the highlight effect of the varnish layer under the indirect light source can be rendered by the third highlight value, and the highlight effect of the outer surface layer under the indirect light source can be rendered by the fourth highlight value.
- the terminal performs linear processing according to the first and third highlight values of the varnish layer to obtain the illumination value of the varnish layer, the terminal performs linear processing according to the reflection value, the second and fourth highlight values of the outer surface layer to obtain the illumination value of the outer surface layer, and the terminal determines the target illumination value according to the illumination value of the varnish layer and the illumination value of the outer surface layer; it should be noted that the first highlight value, the reflection value, the second highlight value, the third highlight value and the fourth highlight value correspond to the same position to be rendered on the outer surface of the virtual object.
- the target illumination value is determined according to the illumination value of the varnish layer and the illumination value of the outer surface layer, and rendering is performed according to the target illumination value, so that the display effect of the varnish layer and the display effect of the outer surface layer can be superimposed to obtain the visual effect of covering the varnish layer on the outer surface layer, so that the outer surface layer has a varnish texture.
- the terminal determines the illumination value under the direct light source according to the first highlight value of the varnish layer, the reflection value and the second highlight value of the outer surface layer, determines the illumination value under the indirect light source according to the third highlight value of the varnish layer and the fourth highlight value of the outer surface layer, and determines the target illumination value according to the illumination value under the direct light source and the illumination value under the indirect light source; similarly, the first highlight value, the reflection value, the second highlight value, the third highlight value and the fourth highlight value correspond to the same position to be rendered on the outer surface of the virtual object.
- the target illumination value is determined according to the illumination value under the direct light source and the illumination value under the indirect light source, and rendering is performed according to the target illumination value, so that the display effect of the outer surface layer covered with the varnish layer under the direct light source can be superimposed with the display effect of the outer surface layer covered with the varnish layer under the indirect light source, so that the rendered outer surface layer covered with the varnish layer has richer illumination performance and improves the visual effect.
- an indirect light source is introduced through the ambient light map, and a third highlight value obtained by specularly reflecting the light emitted by the indirect light source in the varnish layer is determined, as is a fourth highlight value obtained by specularly reflecting the indirect transmitted light on the exterior surface.
- the target lighting value is determined by the first highlight value, the reflection value, the second highlight value, the third highlight value and the fourth highlight value.
- the highlight effects and reflection effects produced by the varnish layer and the exterior surface under the direct light source and the indirect light source can be superimposed.
- the exterior of the virtual object is rendered by the target lighting value, and a visual effect of a varnish layer covering the exterior surface can be obtained.
- the texture of the varnish on the exterior surface is more realistic, thereby improving the visual effect.
- determining the third highlight value of the varnish layer under the indirect light source includes: determining the third highlight value of the varnish layer under the indirect light source based on the roughness of the varnish layer, the first normal vector of the varnish layer, and the first sight line vector.
- the first color pixel value of the varnish layer is determined in the ambient light map of the environment where the virtual object is located; based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source and the first Fresnel coefficient of the varnish layer, the third highlight value of the varnish layer under the indirect light source is determined.
- the highlight effect of the varnish layer under the indirect light source can be rendered through the third highlight value.
- the ambient light map is used to represent the ambient light conditions of the exterior of the virtual object.
- the ambient light map can be formed into a cubic ambient light map through six two-dimensional texture images of the virtual environment.
- the indirect light source reflectivity of the varnish layer is used to represent the contribution of the indirect light source to the reflectivity of the varnish layer.
- the indirect light source reflectivity of the varnish layer can be determined by the pre-calculated values of diffuse reflection and specular reflection of the environment bidirectional reflection distribution.
- the terminal obtains a predicted diffuse reflection value and a pre-calculated value of specular reflection of an environmental bidirectional reflection distribution, obtains a reflectivity corresponding to a first normal vector of the varnish layer, and determines an indirect light source reflectivity of the varnish layer according to the reflectivity corresponding to the first normal vector, the predicted diffuse reflection value and the pre-calculated value of specular reflection of the environmental bidirectional reflection distribution;
- the indirect light source reflectivity is: f0*dfg.x+dfg.y, wherein f0 is the reflectivity corresponding to the first normal vector of the varnish layer, dfg.x is the weighted sum of the predicted diffuse reflection value of the environmental bidirectional reflection distribution, and dfg.y is the weighted sum of the predicted specular reflection value of the environmental bidirectional reflection distribution.
- the terminal samples the first color pixel value of the position to be rendered in the varnish layer in the ambient light map according to the roughness of the varnish layer and the first reflected reverse vector; the terminal obtains the light intensity of the indirect light source and the first Fresnel coefficient of the position to be rendered in the varnish layer; the product of the first color pixel value, the reflectivity of the indirect light source of the varnish layer, the light intensity of the indirect light source and the first Fresnel coefficient of the varnish layer is determined to obtain the third highlight value of the position to be rendered in the varnish layer.
- the third highlight value of each position to be rendered of the exterior of the virtual object in the varnish layer can be obtained.
- the introduction of indirect light sources through the ambient light map increases the reflection effect of the varnish layer on the light emitted by the indirect light source.
- the varnish effect of the central area of the exterior surface covering the varnish layer can be improved.
- the exterior rendering method of a virtual object also includes: determining an edge adjustment coefficient based on a first Fresnel coefficient; determining a third highlight value of the varnish layer under an indirect light source based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source and the first Fresnel coefficient of the varnish layer, and also includes: determining the third highlight value of the varnish layer under an indirect light source based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source, the first Fresnel coefficient of the varnish layer and the edge adjustment coefficient.
- the edge adjustment coefficient may be the difference between 1 and the first Fresnel coefficient.
- the terminal determines the product of the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source, the first Fresnel coefficient of the varnish layer and the edge adjustment coefficient to obtain a third highlight value.
- an edge adjustment coefficient can be introduced, that is, the third highlight value is determined according to the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source, the first Fresnel coefficient of the varnish layer and the edge adjustment coefficient, and the target illumination value is determined based on the third highlight value for rendering, so as to reduce the varnish effect in the edge area.
- Figure 7 shows the armor (including breastplate and arm armor) of the virtual object rendered when the edge adjustment coefficient is not introduced
- Figure 8 shows the armor of the virtual object rendered when the edge adjustment coefficient is introduced.
- the ambient light map may be adjusted to reduce the brightness of the ground map in the virtual scene to reduce the mirror reflection effect of the varnish layer on the ambient light, thereby improving the abnormal stretching of the rendered exterior surface covered with the varnish layer.
- the rendered exterior surface covered with the varnish layer is shown in FIG. 10 .
- the abnormal stretching of the rendered exterior surface covered with the varnish layer is improved, as shown by 1001 in FIG. 10 .
- the rendering effect of the exterior is shown in Figure 11.
- the rendering effect of the exterior is shown in Figure 12.
- the brightness of the exterior shown in Figure 11 is brighter than that of the exterior shown in Figure 12.
- the armor in Figure 11 has abnormal stretching, while the armor in Figure 12 does not have abnormal stretching. After lowering the brightness of the ground map in the virtual scene, the abnormal stretching of the exterior surface covered with the varnish layer obtained by rendering is improved.
- the first color pixel value is sampled in the ambient light map, and the third highlight value of the varnish layer under the indirect light source is determined based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source and the first Fresnel coefficient of the varnish layer.
- the incident angle of the light emitted by the indirect light source affects the reflection effect of the varnish layer, thereby improving the accuracy of the third highlight value and improving the highlight effect of the varnish layer under the indirect light source.
- determining a fourth highlight value generated by indirect transmission light on the outer surface layer based on the outer surface roughness of the virtual object and the ambient light map includes: obtaining a second color pixel value of the outer surface layer in the ambient light map based on the outer surface roughness of the virtual object, the second sight direction vector and the second normal vector of the outer surface layer; determining a fourth highlight value generated by indirect transmission light on the outer surface layer based on the second color pixel value, the indirect light source reflectivity of the outer surface layer, the light intensity of the indirect light source and the second Fresnel coefficient of the outer surface layer.
- the fourth highlight value can be used to render a highlight effect of the outer surface layer under the indirect light source.
- the indirect light source reflectivity of the exterior surface is used to represent the contribution of the indirect light source to the reflectivity of the exterior surface.
- the indirect light source reflectivity of the exterior surface can be determined by the pre-calculated values of diffuse reflection and specular reflection of the environmental bidirectional reflection distribution.
- the terminal obtains a predicted diffuse reflection value and a pre-calculated value of mirror reflection of the environmental bidirectional reflection distribution, obtains a reflectivity corresponding to a second normal vector of the external surface, and determines the reflectivity of an indirect light source of the external surface according to the reflectivity corresponding to the second normal vector, the predicted diffuse reflection value and the pre-calculated value of mirror reflection of the environmental bidirectional reflection distribution.
- the terminal obtains the second normal vector and the second sight direction vector of the position to be rendered on the outer surface layer, and determines the second reflection direction vector of the position to be rendered on the outer surface layer.
- the second normal vector and the second sight direction vector of the position to be rendered on the outer surface layer can be processed by the reflection function of the PBR model to obtain the second reflection direction vector of the position to be rendered on the outer surface layer.
- the terminal samples the second color pixel value of the position to be rendered on the outer surface layer in the ambient light map according to the roughness of the outer surface layer and the second reflection direction vector; the terminal obtains the light intensity of the indirect light source and the second Fresnel coefficient of the position to be rendered on the outer surface layer; the terminal determines the Fresnel transmission coefficient according to the second Fresnel coefficient, determines the product of the second color pixel value, the reflectivity of the indirect light source of the outer surface layer, the light intensity of the indirect light source and the Fresnel transmission coefficient, and obtains the fourth highlight value of the position to be rendered on the outer surface layer.
- the fourth highlight value of each position to be rendered on the outer surface layer of the virtual object's outer wear can be obtained.
- a second color pixel value is sampled in the ambient light map, and a fourth highlight value generated by the indirect transmitted light on the outer surface is determined based on the second color pixel value, the reflectivity of the indirect light source of the outer surface, the light intensity of the indirect light source and the second Fresnel coefficient of the outer surface, thereby improving the highlight effect of the outer surface under the indirect light source.
- the terminal performs linear processing on the first highlight value and the third highlight value of the position to be rendered to obtain the illumination value of the position to be rendered on the varnish layer; the terminal performs linear processing on the reflection value, the second highlight value and the fourth highlight value of the position to be rendered to obtain the illumination value of the position to be rendered on the exterior surface layer; the terminal performs linear processing on the illumination value of the position to be rendered on the varnish layer and the illumination value on the exterior surface layer to obtain the target illumination value of the position to be rendered.
- the target illumination value is determined by combining the illumination values of the varnish layer and the exterior surface layer under direct light source and indirect light source, so that the target illumination value can reflect the illumination value obtained by combining the varnish layer and the exterior surface layer under direct light source and indirect light source, and then rendering based on the target illumination value can combine the illumination effects of the varnish layer and the exterior surface layer to enhance the visual effect of the exterior.
- the terminal performs linear processing on the first highlight value and the third highlight value of the position to be rendered to obtain the illumination value of the position to be rendered on the varnish layer.
- the terminal obtains the direct light source and the indirect light source and the weights, and performs weighted summation on the first highlight value and the third highlight value according to the direct light source and the indirect light source and the weights to obtain the illumination value of the position to be rendered on the varnish layer; the first highlight value and the third highlight value are weightedly summed so that the illumination value on the varnish layer can be biased towards the one with a higher weight between the first highlight value and the third highlight value, thereby highlighting the illumination effect of the varnish layer under the direct light source or the indirect light source.
- the terminal performs linear processing on the reflection value, the second highlight value, and the fourth highlight value of the position to be rendered to obtain the illumination value of the position to be rendered on the outer surface layer.
- the reflection value, the second highlight value, and the fourth highlight value of the position to be rendered may be added to obtain the illumination value of the position to be rendered on the outer surface layer.
- the terminal may add the reflection value and the second value to obtain a first addition result, and weightedly sum the first addition result and the fourth highlight value according to the direct light source and the indirect light source and the weight to obtain the illumination value of the position to be rendered on the outer surface layer.
- Adding the reflection value, the second highlight value, and the fourth highlight value may reduce the hardware resources required to determine the illumination value of the outer surface layer and improve rendering efficiency. Weighted summing the first addition result and the fourth highlight value may allow the illumination value of the outer surface layer to be biased toward the one with a higher weight between the first addition result and the fourth highlight value, thereby highlighting the illumination effect of the outer surface layer under the direct light source or the indirect light source.
- the terminal performs linear processing on the reflection value, the second highlight value, and the fourth highlight value of the position to be rendered to obtain the illumination value of the position to be rendered on the outer surface layer.
- the terminal adds the second highlight value and the fourth highlight value to obtain a second addition result, obtains a reflection weight and a highlight weight, and performs weighted summation of the reflection value and the second addition result according to the reflection weight and the highlight weight to obtain the illumination value of the position to be rendered on the outer surface layer.
- the reflection value and the second addition result are weightedly summed so that the illumination value on the outer surface layer can be biased toward the one with a higher weight between the reflection value and the second addition result, thereby highlighting the reflection effect or highlight effect of the outer surface layer.
- the terminal linearly processes the illumination value of the position to be rendered on the varnish layer and the illumination value on the outer surface layer to obtain a target illumination value of the position to be rendered.
- the illumination value of the position to be rendered on the varnish layer and the illumination value on the outer surface layer can be added to obtain the target illumination value of the position to be rendered; or the illumination value of the position to be rendered on the varnish layer and the illumination value on the outer surface layer are weightedly summed according to the weights of the varnish layer and the outer surface layer to obtain the target illumination value of the position to be rendered.
- the target illumination value is determined by the first highlight value, the reflection value, the second highlight value, the third highlight value and the fourth highlight value, and the highlight effect and the reflection effect generated by the varnish layer and the outer surface layer under the direct light source and the indirect light source can be superimposed, and the outer surface of the virtual object is rendered by the target illumination value, so that the varnish layer covering the outer surface layer can be obtained.
- the visual effect is more realistic, and the varnish texture on the exterior surface is more realistic, which enhances the visual effect.
- the exterior rendering of a virtual object can be applied to a scene in which the exterior of a virtual object in a virtual scene is rendered; illustratively, the exterior surface of the virtual object is made of silk, and a varnish layer is covered on the silk to simulate the texture of the silk material in a real environment and enhance the display effect of the silk material.
- the terminal determines the reflection roughness of the varnish layer according to the roughness of the varnish layer of the virtual object, the first normal vector and the first half-angle vector of the varnish layer.
- the terminal determines the visibility of the varnish layer based on the roughness of the varnish layer, the first normal vector, the first sight direction vector and the light source direction vector of the direct light source. According to the reflection roughness, visibility and reflection intensity of the varnish layer, the terminal determines the first highlight value of the varnish layer under the direct light source.
- the terminal determines the reflection value of the outer surface of the silk material to the direct light according to the original reflection value of the outer surface of the silk material, the transmittance and the reflection intensity of the varnish layer; determines the second Fresnel coefficient of the outer surface of the silk material based on the reflectivity corresponding to the second sight direction vector, the second half-angle vector and the second normal vector of the outer surface of the silk material, and determines the second highlight value generated by the direct transmitted light on the outer surface of the silk material according to the transmittance and the second Fresnel coefficient;
- the terminal determines the third high light value of the varnish layer under the indirect light source based on the roughness of the varnish layer and the ambient light map of the environment in which the virtual object is located; and determines the fourth high light value generated by the indirect transmitted light on the outer surface of the silk material based on the roughness of the outer surface of the silk material and the ambient light map;
- the terminal determines a target illumination value based on the first highlight value, the reflection value, the second highlight value, the third highlight value, and the fourth highlight value.
- the effect of covering the outer surface of the silk material with a varnish layer can be rendered with less hardware resources occupied, so that the outer surface of the silk material has a varnish texture.
- Step 1301 determining a roughness coefficient based on the roughness of the varnish layer of the virtual object; fusing a first normal vector and a first half-angle vector of the varnish layer to obtain a first fusion result; determining the reflection roughness of the varnish layer based on the roughness coefficient and the first fusion result;
- Step 1302 fuse the first normal vector and the first sight direction vector of the varnish layer to obtain a second fusion result; fuse the first normal vector and the light source direction vector of the varnish layer to obtain a third fusion result; determine the second difference between the initial coefficient and the roughness coefficient; determine the third product between the second difference and the second fusion result, and determine the fourth product between the third product and the roughness coefficient; determine the product between the fourth product and the third fusion result to obtain the visibility of the varnish layer in the sight direction; determine the fifth product between the second difference and the third fusion result; determine the sixth product between the roughness coefficient and the fifth product; determine the product between the sixth product and the second fusion result to obtain the visibility of the varnish layer in the light source direction; determine the visibility of the varnish layer based on the visibility in the sight direction and the visibility in the light source direction;
- Step 1303 determining the reflectivity of the varnish layer based on the reflection roughness, visibility and the first Fresnel coefficient of the varnish layer; determining the first highlight value of the varnish layer under the direct light source based on the reflectivity of the varnish layer and the reflection intensity of the varnish layer;
- Step 1304 obtaining the color pixel value, metalness and thickness of the varnish layer; determining the path distance of the light emitted by the direct light source penetrating the varnish layer according to the thickness, the first normal vector of the varnish layer, the first sight direction vector and the light source direction vector of the direct light source; determining the extinction coefficient based on the color pixel value; determining the optical depth based on the extinction coefficient, the thickness and the path distance; and determining the transmittance of the varnish layer based on the optical depth and the extinction coefficient;
- Step 1305 determining a candidate reflection value of the outer surface layer based on the original reflection value of the outer surface layer, the transmittance of the varnish layer, and the initial Fresnel value; interpolating the original reflection value and the candidate reflection value according to the reflection intensity of the varnish layer to obtain a reflection value of the outer surface layer reflecting the direct transmitted light; the direct transmitted light is light emitted by the direct light source and transmitted through the varnish layer;
- Step 1306 fusing the second sight direction vector and the second half-angle vector of the outer surface layer to obtain a fourth fusion result; determining a second Fresnel coefficient of the outer surface layer based on the fourth fusion result and the reflectivity corresponding to the second normal vector; determining a second highlight value generated by the direct transmitted light on the outer surface layer based on the transmittance and the second Fresnel coefficient;
- Step 1307 based on the roughness of the varnish layer, the first normal vector of the varnish layer, and the first sight direction vector, determine the first color pixel value of the varnish layer in the ambient light map of the environment where the virtual object is located; determine the edge adjustment coefficient according to the first Fresnel coefficient, and determine the third highlight value of the varnish layer under the indirect light source based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source, the first Fresnel coefficient of the varnish layer, and the edge adjustment coefficient;
- Step 1308 based on the roughness of the outer surface of the virtual object, the second sight line direction vector and the second normal vector of the outer surface, obtain a second color pixel value of the outer surface in the ambient light map; based on the second color pixel value, the indirect light source reflectivity of the outer surface, the light intensity of the indirect light source and the second Fresnel coefficient of the outer surface, determine a fourth highlight value generated on the outer surface by the indirect transmitted light; the indirect transmitted light is light emitted by the indirect light source and transmitted through the varnish layer;
- Step 1309 based on the first highlight value and the third highlight value, determine the illumination value on the varnish layer and at the position to be rendered; based on the reflection value, the second highlight value and the fourth highlight value, determine the illumination value on the exterior surface layer and at the position to be rendered; based on the illumination value on the varnish layer and at the position to be rendered and the illumination value on the exterior surface layer and at the position to be rendered, determine the target illumination value of the position to be rendered.
- steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
- the first highlight value of the varnish layer under the light source is determined
- the reflection value and the second highlight value of the exterior surface under the light source are determined according to the original reflection value and the transmittance
- the target illumination value is determined according to the first highlight value
- the exterior of the virtual object is illuminated and rendered according to the target illumination value.
- the embodiment of the present application also provides a virtual object exterior rendering device for implementing the virtual object exterior rendering method involved above.
- the implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the exterior rendering device for one or more virtual objects provided below can refer to the limitations of the virtual object exterior rendering method above.
- a virtual object exterior rendering device including: a varnish layer processing module 1401, an acquisition module 1402, an exterior surface layer processing module 1403, a target illumination value determination module 1404, and a rendering module 1405, wherein:
- the varnish layer processing module 1401 is used to determine the first highlight value of the varnish layer of the virtual object under the light source; the varnish layer is the varnish material covering the outer surface of the virtual object;
- An acquisition module 1402 is used to acquire the original reflection value of the exterior surface layer and the transmittance of the varnish layer;
- the outer surface processing module 1403 is used to determine the reflection value and the second highlight value of the outer surface under the light source according to the original reflection value and the transmittance;
- a target illumination value determination module 1404 configured to determine a target illumination value based on the first highlight value, the reflection value, and the second highlight value;
- the rendering module 1405 is used to perform lighting rendering on the exterior of the virtual object according to the target lighting value.
- the light source is a direct light source
- the varnish layer processing module 1401 includes:
- a reflection roughness determination unit for determining the reflection roughness of the varnish layer based on the varnish layer roughness of the virtual object, a first normal vector and a first half-angle vector of the varnish layer;
- a visibility determination unit for determining the visibility of the varnish layer based on the roughness of the varnish layer, the first normal vector, and the first sight direction vector of the varnish layer. and the light source direction vector of the direct light source, determining the visibility of the varnish layer;
- the first highlight value determination unit is used to determine the first highlight value of the varnish layer under the direct light source based on the reflection roughness, visibility and reflection intensity of the varnish layer.
- the reflection roughness determination unit is also used to determine the roughness coefficient based on the roughness of the varnish layer of the virtual object; fuse the first normal vector and the first half-angle vector of the varnish layer to obtain a first fusion result; and determine the reflection roughness of the varnish layer based on the roughness coefficient and the first fusion result.
- the visibility determination unit is also used to determine the roughness coefficient based on the roughness of the varnish layer of the virtual object; fuse the first normal vector and the first sight direction vector of the varnish layer to obtain a second fusion result; fuse the first normal vector and the light source direction vector of the varnish layer to obtain a third fusion result; determine the visibility of the varnish layer in the sight direction and the visibility in the light source direction based on the roughness coefficient, the second fusion result and the third fusion result; determine the visibility of the varnish layer based on the visibility in the sight direction and the visibility in the light source direction.
- the visibility determination unit is also used to determine a second difference between the initial coefficient and the roughness coefficient; determine a third product between the second difference and the second fusion result, and determine a fourth product between the third product and the roughness coefficient; determine the product between the fourth product and the third fusion result to obtain the visibility of the varnish layer in the line of sight direction; and determine the visibility of the varnish layer in the direction of the light source based on the roughness coefficient, the second difference, the second fusion result and the third fusion result.
- the visibility determination unit is also used to determine the fifth product between the second difference and the third fusion result; determine the sixth product between the roughness coefficient and the fifth product; and determine the product between the sixth product and the second fusion result to obtain the visibility of the varnish layer in the direction of the light source.
- the first highlight value determination unit is also used to determine the reflectivity of the varnish layer based on the reflection roughness, visibility and the first Fresnel coefficient of the varnish layer; and determine the first highlight value of the varnish layer under direct light source based on the reflectivity of the varnish layer and the reflection intensity of the varnish layer.
- the light source includes a direct light source
- the exterior surface processing module 1403 includes a reflection value determination unit, a second Fresnel coefficient determination unit, and a second highlight value determination unit;
- a reflection value determination unit for determining a reflection value of the outer surface layer reflecting the direct transmission light based on the original reflection value, the transmittance and the reflection intensity of the varnish layer; the direct transmission light is light emitted by the direct light source and transmitted through the varnish layer;
- a second Fresnel coefficient determining unit configured to determine a second Fresnel coefficient of the outer surface layer based on a reflectivity corresponding to a second sight line direction vector, a second half-angle vector and a second normal vector of the outer surface layer;
- the second highlight value determining unit is used to determine the second highlight value generated by the direct transmitted light on the outer surface layer based on the transmittance and the second Fresnel coefficient.
- the reflection value determination unit is also used to determine a candidate reflection value of the exterior surface based on the original reflection value, transmittance and initial Fresnel value; and interpolate the original reflection value and the candidate reflection value according to the reflection intensity of the varnish layer to obtain the reflection value of the exterior surface reflecting the directly transmitted light.
- the second Fresnel coefficient determination unit is also used to fuse the second sight direction vector and the second half-angle vector of the exterior surface to obtain a fourth fusion result; based on the fourth fusion result and the reflectivity corresponding to the second normal vector, determine the second Fresnel coefficient of the exterior surface.
- the indirect light source processing module also includes: an edge adjustment coefficient determination module, used to determine the edge adjustment coefficient based on the first Fresnel coefficient; a third highlight value determination unit, also used to determine the third highlight value of the varnish layer under the indirect light source based on the first color pixel value, the indirect light source reflectivity of the varnish layer, the light intensity of the indirect light source, the first Fresnel coefficient of the varnish layer and the edge adjustment coefficient.
- the indirect light source processing module includes: a fourth highlight value determination unit, which is used to obtain a second color pixel value of the exterior surface in the ambient light map based on the roughness of the exterior surface of the virtual object, the second sight direction vector and the second normal vector of the exterior surface; based on the second color pixel value, the indirect light source reflectivity of the exterior surface, the light intensity of the indirect light source and the second Fresnel coefficient of the exterior surface, determine the fourth highlight value generated by the indirect transmitted light on the exterior surface.
- a fourth highlight value determination unit which is used to obtain a second color pixel value of the exterior surface in the ambient light map based on the roughness of the exterior surface of the virtual object, the second sight direction vector and the second normal vector of the exterior surface.
- the target illumination value determination module 1404 is further used to determine the illumination value on the varnish layer and at the position to be rendered based on the first highlight value and the third highlight value; determine the illumination value on the exterior surface layer and at the position to be rendered based on the reflection value, the second highlight value and the fourth highlight value; and determine the target illumination value at the position to be rendered based on the illumination value on the varnish layer and at the position to be rendered and the illumination value on the exterior surface layer and at the position to be rendered.
- Each module in the above-mentioned virtual object exterior rendering device can be implemented in whole or in part by software, hardware, or a combination thereof.
- Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
- a computer device which may be a terminal, and its internal structure diagram may be shown in FIG15.
- the computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device.
- the processor, the memory, and the input/output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input/output interface.
- the processor of the computer device is used to provide computing and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system and a computer program.
- the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.
- the input/output interface of the computer device is used to exchange information between the processor and an external device.
- the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies.
- WIFI wireless a mobile cellular network
- NFC near field communication
- the display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device.
- the display screen can be a liquid crystal display screen or an electronic ink display screen.
- the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
- FIG. 15 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied.
- the specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
- a computer device including a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processors, the one or more processors implement the above-mentioned method for rendering the exterior of a virtual object.
- one or more non-volatile readable storage media are provided, on which computer-readable instructions are stored.
- the one or more processors implement the external packaging of the virtual object. Rendering method.
- a computer program product including a computer program and computer-readable instructions, wherein the computer-readable instructions implement the above-mentioned method for rendering the exterior of a virtual object when executed by a processor.
- any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory.
- Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this.
- the processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Image Generation (AREA)
Abstract
本申请涉及一种虚拟对象的外装渲染方法、装置、计算机设备、存储介质和计算机程序产品。所述方法可以应用于人工智能、图像处理和游戏等领域,所述方法包括:确定虚拟对象的清漆层在光源下的第一高光值,清漆层是覆盖于虚拟对象的外装表层上的清漆材质(步骤202);获取外装表层的原始反射值和清漆层的透射率(步骤204);依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值(步骤206);基于第一高光值、反射值和第二高光值,确定目标光照值(步骤208);根据目标光照值对虚拟对象的外装进行光照渲染(步骤210)。
Description
本申请要求于2023年06月12日提交中国专利局,申请号为2023106877514,发明名称为“虚拟对象的外装渲染方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,特别是涉及一种虚拟对象的外装渲染方法、装置、计算机设备、存储介质和计算机程序产品。
随着计算机技术的发展,用户对网络游戏中虚拟对象的外观要求越来越高。外装是网络游戏中的虚拟人物、虚拟动物和虚拟物体的外部表现形式,外装可以用于对虚拟人物、虚拟动物和虚拟物体进行装扮,满足多样化展示虚拟人物、虚拟动物和虚拟物体的需求。
在相关技术中,外装多为布料、丝绸和金属材质,通过不同的颜色、花纹和造型实现外装的多样性,但是现有方式难以体现外装材质真实的质感和视觉效果,导致虚拟对象的外装渲染效果较差。
发明内容
根据本申请提供的各种实施例,提供一种虚拟对象的外装渲染方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。
第一方面,本申请提供了一种虚拟对象的外装渲染方法,由终端执行,包括:
确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;获取外装表层的原始反射值和清漆层的透射率;依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;基于第一高光值、反射值和第二高光值,确定目标光照值;及根据目标光照值对虚拟对象的外装进行光照渲染。
第二方面,本申请还提供了一种虚拟对象的外装渲染装置。所述装置包括:
清漆层处理模块,用于确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;
获取模块,用于获取外装表层的原始反射值和清漆层的透射率;
外装表层处理模块,用于依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;
目标光照值确定模块,用于基于第一高光值、反射值和第二高光值,确定目标光照值;及
渲染模块,用于根据目标光照值对虚拟对象的外装进行光照渲染。
第三方面,本申请还提供了一种计算机设备。包括存储器和一个或多个处理器,存储器存储有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:
确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;获取外装表层的原始反射值和清漆层的透射率;依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;基于第一高光值、反射值和第二高光值,确定目标光照值;及根据目标光照值对虚拟对象的外装进行光照渲染。
第四方面,一个或多个非易失性可读存储介质,其上存储有计算机可读指令,计算机可
读指令被所述处理器执行时,使得一个或多个处理器实现以下步骤:
确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;获取外装表层的原始反射值和清漆层的透射率;依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;基于第一高光值、反射值和第二高光值,确定目标光照值;及根据目标光照值对虚拟对象的外装进行光照渲染。
第五方面,本申请还提供了一种计算机程序产品,包括计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:
确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;获取外装表层的原始反射值和清漆层的透射率;依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;基于第一高光值、反射值和第二高光值,确定目标光照值;及根据目标光照值对虚拟对象的外装进行光照渲染。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其他特征、目的和优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请实施例的技术方案,下面将对实施例的描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本申请的示例性实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中虚拟对象的外装渲染方法的应用环境图;
图2a为一个实施例中虚拟对象的外装渲染方法的示意图;
图2b为一个实施例中虚拟对象的外装渲染方法的流程示意图;
图3为相关技术中,外装的材质是金属材质的示意图;
图4为相关技术中,外装的材质是金属材质和丝绸材质拼接的示意图;
图5为一个实施例中,一个视角下虚拟对象的外装具有清漆质感的示意图;
图6为一个实施例中,另一个视角下虚拟对象的外装具有清漆质感的示意图;
图7为一个实施例中,未引入边缘调整系数时,渲染得到的外装的示意图;
图8为一个实施例中,引入边缘调整系数时,渲染得到的外装的示意图;
图9为一个实施例中,覆盖了清漆层的外装表层出现异常拉伸的示意图;
图10为一个实施例中,改善覆盖了清漆层的外装表层的异常拉伸的示意图;
图11为一个实施例中,未调整环境光贴图时,渲染得到的外装的整体示意图;
图12为一个实施例中,调整环境光贴图时,渲染得到的外装的整体示意图;
图13为另一个实施例中虚拟对象的外装渲染方法的流程示意图;
图14为一个实施例中虚拟对象的外装渲染装置的结构框图;
图15为一个实施例中计算机设备的内部结构图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
在本说明书和附图中,具有基本上相同或相似步骤和元素用相同或相似的附图标记来表示,且对这些步骤和元素的重复描述将被省略。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性或排序。
本申请实施例提供的虚拟对象的外装渲染方法,可以应用于如图1所示的应用环境中。
其中,终端102通过网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上;虚拟对象的外装渲染方法可以通过终端102执行,也可以通过服务器104执行,还可以通过终端102和服务器104协同执行。
以虚拟对象的外装渲染方法通过终端102执行为例,终端102可以确定虚拟对象的清漆层在光源下的第一高光值,终端102可以获取外装表层的原始反射值和清漆层的透射率,终端102可以依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值,终端102可以基于第一高光值、反射值和第二高光值,确定目标光照值,终端102还可以根据目标光照值对虚拟对象的外装进行光照渲染。
其中,终端102可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、物联网设备和便携式可穿戴设备,物联网设备可为智能音箱、智能电视、智能空调和智能车载设备等。便携式可穿戴设备可为智能手表、智能手环、头戴设备等。
服务器104可以是独立的物理服务器,也可以是区块链系统中的服务节点,该区块链系统中的各服务节点之间形成组成点对点(P2P,Peer To Peer)网络,P2P协议是一个运行在传输控制协议(TCP,Transmission Control Protocol)协议之上的应用层协议。
此外,服务器104还可以是多个物理服务器构成的服务器集群,可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。
终端102与服务器104之间可以通过蓝牙、USB(Universal Serial Bus,通用串行总线)或者网络等通讯连接方式进行连接,本申请在此不做限制。
在一个实施例中,参考图2a和图2b所示,提供了一种虚拟对象的外装渲染方法,该方法由图1中的终端或服务器执行,也可以由图1中的终端和服务器协同执行,以该方法由图1中的终端执行为例进行说明,包括以下步骤:
步骤202,确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质。
其中,虚拟对象不同于真实对象,虚拟对象是虚拟出的角色形象,比如,虚拟出的角色形象可以是虚拟场景中用于表示用户、且受用户控制的玩家角色形象,也可以是虚拟场景中用于表示可与用户交互的非玩家角色形象,比如虚拟对象可以是虚拟人物,虚拟动物等;虚拟对象还可以是虚拟场景中的其他虚拟物体,比如虚拟对象可以是虚拟建筑部件(比如桌、椅、门、窗),虚拟交通工具(比如车辆、船只)等。
虚拟场景可以是模拟真实环境虚拟出的场景,比如,虚拟场景可以包括虚拟的天空、河流、山川、动植物、建筑等;虚拟场景可以在终端运行游戏应用时实时显示。
其中,外装指的是虚拟对象的外部装备,包括但不限于:服装、道具和装饰物;在实际应用中,虚拟对象在虚拟场景中的外装可以通过购买或参与活动获取,更换虚拟对象的外装,可以改变虚拟对象的形象。比如,当虚拟对象是用于表示用户的玩家角色形象时,虚拟对象的外装可以是虚拟对象的服装,更换虚拟对象的服装,可以改变用户的玩家角色形象;当虚拟对象是虚拟场景中的虚拟交通工具时,可以更换虚拟交通工具的装饰物,以改变虚拟交通工具的形象。
其中,外装表层是外装的表面层,外装的显示样式与外装表层的材质相关;外装表层的材质包括但不限于:金属材质、皮革材质和布料材质,也可以是金属材质、皮革材质或布料材质中至少两种材质拼接所得的材质;比如虚拟对象的外装包括盔甲,盔甲的表面材质是通过金属材质和皮革材质拼接所得,则盔甲的显示样式与金属材质和皮革材质相关。
其中,清漆层覆盖于外装表层上,在视觉效果上,在外装表层上增加清漆层,使得外装具有清漆质感;清漆是一种涂料,在材质上涂覆清漆,以在材质上形成可以显示材质原有纹理透明漆膜,从而使外装具有清漆质感。而清漆质感可以指覆盖清漆的外装具有光亮的视觉效果,此外在移动视觉角度时,可以呈现出闪闪发光的效果。
其中,光源可以是直接光源;直接光源发出的光来自虚拟场景中的光源,直接光源与间接光源不同,间接光源发出的光来自虚拟场景中的物体。
其中,虚拟场景中的光源包括但不限于平行光光源和点光源,平行光光源可以用于模拟太阳或月亮,点光源在虚拟场景中所处的位置可以是相机模型所处的位置。
其中,相机模型在虚拟场景中可以对虚拟对象进行自动跟随,当虚拟对象在虚拟场景中的位置发生改变时,相机模型跟随虚拟对象在虚拟环境中的位置同时发生改变;相机模型可以默认处于虚拟对象的后方,通过相机模型可以从不同角度对虚拟场景中的虚拟对象进行观察,比如,可以通过改变视角,将从虚拟对象的后方观察虚拟对象,改变为从虚拟对象的侧方观察虚拟对象。
其中,第一高光值指的是光源发出的光在清漆层上产生的高光值,可以用于反映清漆层对光源发出的光进行镜面反射的程度。
在一些实施例中,对于覆盖在虚拟对象的外装表层上的清漆层,终端获取清漆层粗糙度,依据清漆层粗糙度确定清漆层的反射粗糙度和能见度,终端根据清漆层的反射粗糙度和能见度,确定清漆层在光源下的第一高光值。反射粗糙度可以反映清漆层对光的反射效果,能见度可以反映清漆层对光的遮挡程度,结合清漆层的反射粗糙度和能见度计算第一高光值,可以提高第一高光值的准确度。
在一些实施例中,光源为直接光源,终端可以根据清漆层的反射粗糙度和能见度,确定清漆层在直接光源下的第一高光值。需要说明的是,第一高光值,是虚拟对象的待渲染位置在清漆层上的第一高光值,待渲染位置是虚拟对象的外装上的位置,可以通过虚拟场景的坐标系描述该待渲染位置;不同的待渲染位置在清漆层上的第一高光值可能不同,使得清漆层的不同的待渲染位置对光进行镜面反射的程度不同,进而渲染得到的清漆层具有凹凸不平的展示效果。
步骤204,获取外装表层的原始反射值和清漆层的透射率。
其中,原始反射值是外装表层的反射值,即未在外装表层上覆盖清漆层的情况下,外装表层的反射值;当外装表层的材质是镜面材质时,原始反射值可以是镜面反射产生的原始反射值,当外装表层的材质不是镜面材质时,原始反射值可以是漫反射产生的原始反射值。
需要说明的是,外装表层的原始反射值是待渲染位置在外装表层上的原始反射值,不同待渲染位置在外装表层上的原始反射值可能不同;比如,当外装表层的材质包括纹理时,由于纹理是粗糙度不同而呈现出的效果,而不同待渲染位置的粗糙度不同,导致不同待渲染位置在外装表层上对光的反射情况不同,进而不同待渲染位置各自在外装表层上的原始反射值不同;比如当外装表层的材质是镜面材质和非镜面材质拼接得到时,不同待渲染位置在外装表层上对光的反射情况也可能不同,进而不同待渲染位置各自在外装表层上的原始反射值不同。
其中,清漆层的透射率是待渲染位置在清漆层上的透射率;光源发出的光在穿透清漆层时,会被清漆层介质吸收导致光线衰减,清漆层的透射率用于描述光穿透清漆层的衰减程度,通过透射率可以模拟光穿透清漆层的光学效果。
在一些实施例中,终端获取外装表层的原始反射值,外装表层的原始反射值可以基于外装表层的材质确定,本申请实施例对外装表层的原始反射值的具体数值不进行限定;终端获取清漆层的透射率,透射率可以根据清漆层的厚度、金属度和色彩像素值确定;获取外装表
层的原始反射值和清漆层的透射率,以便于后续确定覆盖了清漆层的外装表层的反射值和第二高光值,使得反射值和第二高光值与光穿透清漆层的衰减程度相关,提升了外装表层的反射值和第二高光值的准确度。
需要说明的是,获取的原始反射值和透射率对应同一待渲染位置,也就是说,终端获取待渲染位置在外装表层的原始反射值,以及获取该待渲染位置在清漆层的透射率。
步骤206,依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值。
其中,外装表层在光源下的反射值,是在外装表层上覆盖清漆层的情况下,外装表层的反射值。第二高光值是光源发出的光在穿透清漆层后,在外装表层上产生的高光值。
由于原始反射值和透射率对应同一待渲染位置,因此确定的反射值是该待渲染位置在外装表层上的反射值,确定的第二高光值也是该待渲染位置在外装表层上的第二高光值。
在一些实施例中,终端基于原始反射值、清漆层的反射强度和透射率,确定外装表层的反射值,终端确定外装表层的第二菲涅尔系数,根据第二菲涅尔系数和透射率确定第二高光值。第二菲涅尔系数用于反映光经过两个介质的界面时,反射和透射的光强比例,根据第二菲涅尔系数和透射率可以确定光源发出的光在穿透清漆层后的光强,进而可以根据光源发出的光在穿透清漆层后的光强确定外装表层的第二高光值,使得第二高光值与光穿透清漆层后的光强、以及光穿透清漆层的衰减程度相关,提升了第二高光值的准确度。
在一些实施例中,光源为直接光源,终端可以基于原始反射值和透射率,确定在直接光源发出的且穿透清漆层的光下,原始外装层的反射值和第二高光值,使得反射值可以用于表示外装表层对直接光源发出的且穿透清漆层的光的反射值,第二高光值可以用于表示直接光源发出的且穿透清漆层的光在外装表层上产生的高光值,以便于后续基于反射值和第二高光值渲染外装表层在直接光源下的显示效果。
步骤208,基于第一高光值、反射值和第二高光值,确定目标光照值。
其中,目标光照值是虚拟对象的外装中待渲染位置的目标光照值。
在一些实施例中,第一高光值是清漆层的光照值,终端对反射值和第二高光值进行线性处理,得到外装表层的光照值,对清漆层的光照值和外装表层的光照值线性处理,得到目标光照值。需要说明的是,第一高光值、反射值和第二高光值对应虚拟对象的外装上的同一待渲染位置;目标光照值是结合清漆层和外装表层的光照值确定的,使得目标光照值可以反映清漆层和外装表层综合所得的光照值,进而基于目标光照值进行渲染,可以得到清漆层和外装表层叠加所产生的视觉效果,使得外装具有清漆质感。
在一些实施例中,对反射值和第二高光值进行线性处理,得到外装表层的光照值,可以是将反射值和第二高光值相加,得到外装表层的光照值;也可以是终端获取反射权重和高光权重,依据反射权重和高光权重,对反射值和第二高光值进行加权求和,得到外装表层的光照值。将反射值和第二高光值相加,可以减少确定外装表层的光照值所需的硬件资源,提升渲染效率;对反射值和第二高光值进行加权求和,使得外装表层的光照值可以偏向反射值和第二高光值中权重更高的一项,突出权重更高的反射值或第二高光值所带来的光照效果。
在一些实施例中,对清漆层的光照值和外装表层的光照值进行线性处理,得到目标光照值,可以是将清漆层的光照值和外装表层的光照值相加,得到目标光照值;也可以是终端获取清漆层的光照权重和外装表层的光照权重,依据清漆层的光照权重和外装表层的光照权重,对清漆层的光照值和外装表层的光照值进行加权求和,得到外装表层的光照值,得到目标光照值。将清漆层的光照值和外装表层的光照值相加,可以减少确定目标光照值所需的硬件资源,提升渲染效率;对清漆层的光照值和外装表层的光照值加权求和,使得目标光照值,可以偏向清漆层的光照值和外装表层的光照值中权重更高的一项,突出权重更高的清漆层或外装表层的光照效果。
示例性地,将待渲染位置在清漆层的第一高光值、在外装表层的反射值和第二高光值相加,得到待渲染位置的目标光照值。
步骤210,根据目标光照值对虚拟对象的外装进行光照渲染。
在一些实施例中,终端可以依据目标光照值,通过光照着色器在高清渲染管线中进行渲染;目标光照值是虚拟对象的外装上待渲染位置的目标光照值,光照着色器可以根据目标光照值计算出色彩像素值,显示色彩像素值以实现渲染。根据目标光照值对虚拟对象的外装进行光照渲染,可以将清漆层上的高光效果、外装表层上的反射效果和高光效果叠加,得到在外装表层上覆盖清漆层的视觉效果,使得外装表层具有清漆质感,提升了视觉效果。
由于目标光照值是虚拟对象的外装上待渲染位置的目标光照值,终端可以基于外装上各待渲染位置的目标光照值,通过光照着色器在高清渲染管线中渲染得到目标外装表层,目标外装表层是在外装表层上覆盖清漆层所得。目标光照值是根据第一高光值、反射值和第二高光值确定的,基于目标光照值进行渲染,可以将清漆层上的高光效果、外装表层上的反射效果和高光效果叠加,得到在外装表层上覆盖清漆层的效果。
示例性地,参见图3和图4,相关技术中,虚拟对象的外装的显示样式仅与外装表层有关,比如图3中虚拟对象的外装(盔甲)的表面材质是金属材质,则图3中盔甲的显示样式仅与金属材质相关,图4中虚拟对象的外装(服装)的表面材质是金属材质和丝绸材质拼接所得,则图4中服装的显示样式仅与金属材质和丝绸材质相关。
参见图5和图6,图5是本申请实施例中,在外装表层上覆盖清漆层的一个视角下的显示效果,图6是在本申请实施例中,在外装表层上覆盖清漆层的另一个视角下的显示效果,可见图5和图6中,虚拟对象的盔甲(包括胸甲和臂甲)和面具均具有清漆质感;相较于相关技术中外装的显示效果,本申请实施例渲染的外装更能体现外装材质的真实质感,提升了视觉效果。
上述虚拟对象的外装渲染方法中,对于覆盖在外装表层上的清漆层,确定清漆层在光源下的第一高光值,根据原始反射值和透射率确定外装表层在光源下的反射值和第二高光值,根据第一高光值、反射值和第二高光值确定目标光照值,根据目标光照值对虚拟对象的外装进行光照渲染,可以将清漆层上的高光效果、外装表层上的反射效果和高光效果叠加,得到在外装表层上覆盖清漆层的视觉效果,使得外装表层具有清漆质感,提升了视觉效果。
在一些实施例中,光源为直接光源;确定虚拟对象的清漆层在光源下的第一高光值,包括:基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定清漆层的反射粗糙度;基于清漆层粗糙度、第一法线向量、清漆层的第一视线方向向量和直接光源的光源方向向量,确定清漆层的能见度;基于反射粗糙度、能见度和清漆层的反射强度,确定清漆层在直接光源下的第一高光值。结合清漆层的反射粗糙度和能见度确定清漆层的第一高光值,可以提高第一高光值的准确度。
其中,清漆层粗糙度是待渲染位置在清漆层上的粗糙度;当不同的待渲染位置的清漆层粗糙度不同时,不同的待渲染位置对光的反射效果也不同,进而影响待渲染位置的第一高光值;清漆层越粗糙(清漆层粗糙度越大),高光效果越暗(第一高光值越小),清漆层越光滑(清漆层粗糙度越小),高光效果越亮(第一高光值越大)。
其中,清漆层的第一法线向量,是待渲染位置在清漆层上的第一法线向量;待渲染位置的第一法线向量会影响待渲染位置的第一高光值,当不同待选位置的第一法线向量不同时,不同待渲染位置各自的第一高光值也不同,进而使得清漆层具有凹凸感,比如可以通过设置第一法线向量,使得清漆层具有划痕、凹痕或凸起的效果。
其中,直接光源的光源方向向量,用于直接光源发出的光照射在清漆层上的方向向量,也可以称为清漆层的光源方向向量。
其中,清漆层的第一半角向量,是清漆层的光源方向向量和第一视线方向向量的中间向量,清漆层的光源方向向量是待渲染位置在清漆层上指向直接光源的向量;第一视线方向向量,是待渲染位置在清漆层上指向相机模型的向量。
在清漆层粗糙度的影响下,清漆层凹凸不平,可以理解为清漆层包括许多微表面,光在每个微表面上发生镜面反射或折射;光线在清漆层上发生反射或折射,实际上是在第一法线向量对应的微表面上发生镜面反射或折射,第一法线向量的概率分布服从为微表面分布函数;清漆层的反射粗糙度可以反映清漆层上微表面的第一法线向量分布情况,进而可以反映清漆层对光的反射效果,反射粗糙度越低,则清漆层的反射效果越接近镜面反射,反射粗糙度越高,则清漆层的漫反射效果越强。
光线在清漆层上发生反射时,清漆层的微表面对入射光和出射光可能存在遮挡,清漆层的能见度可以反映清漆层上微表面对光的遮挡程度,能见度越高,则清漆层上微表面对光的遮挡程度越高,能见度越低,则清漆层上微表面对光的遮挡程度越低;清漆层上微表面对光的遮挡程度也可以影响光在清漆层的反射程度,能见度越低,则光在清漆层的反射程度越低,能见度越高,则光在清漆层的反射程度越低。
其中,清漆层的反射强度用于反映清漆层的镜面反射效果,清漆层的反射强度越大,则清漆层的镜面反射效果越强,清漆层的反射强度越小,则清漆层的镜面反射效果越弱。
在一些实施例中,终端获取待渲染位置在清漆层上的清漆层粗糙度、第一法线向量和第一半角向量,根据待渲染位置在清漆层上的清漆层粗糙度、第一法线向量和第一半角向量,确定待渲染位置在清漆层中对应微表面的法线分布情况,以得到待渲染位置在清漆层的反射粗糙度;根据待渲染位置在清漆层上的清漆层粗糙度、第一法线向量、第一视线方向向量和清漆层的光源方向向量,确定待渲染位置在清漆层上的能见度;基于待渲染位置在清漆层的反粗糙度和能见度,确定待渲染位置在清漆层上的反射率,根据反射率和待渲染位置在清漆层上的反射强度,确定清漆层在直接光源下的第一高光值。
在一些实施例中,基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定清漆层的反射粗糙度之前,还包括:获取清漆层的粗糙度贴图,从粗糙度贴图中获取清漆层粗糙度;获取清漆层的第一法线贴图,从第一法线贴图中获取第一法线向量。
具体地,粗糙度贴图存储了各待渲染位置在清漆层上的清漆层粗糙度,终端获取清漆层的粗糙度贴图之后,可以从粗糙度贴图中获取各待渲染位置在清漆层上的清漆层粗糙度;第一法线贴图存储了各待渲染位置在清漆层上的第一法线向量,终端获取第一法线贴图之后,可以从第一法线贴图中获取各待渲染位置在清漆层上的第一法线向量;可以通过对粗糙度贴图和第一法线贴图进行自定义设计,以实现清漆层的显示效果,比如可以根据清漆层的显示需求设计粗糙度贴图和第一法线贴图,以制作清漆层的反射效果、划痕、凹痕效果。
在上述实施例中,确定清漆层的反射粗糙度,可以得到光在清漆层的镜面反射效果,确定清漆层的能见度,可以得到光在清漆层被遮挡的程度,结合清漆层的反射粗糙度和能见度确定清漆层的第一高光值,可以提高第一高光值的准确度。
在一些实施例中,基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定清漆层的反射粗糙度,包括:基于虚拟对象的清漆层粗糙度确定粗糙度系数;融合清漆层的第一法线向量和第一半角向量,得到第一融合结果;基于粗糙度系数和第一融合结果,确定清漆层的反射粗糙度。根据清漆层粗糙度确定清漆层的反射粗糙度,反射粗糙度可以反映光在清漆层上的反射效果,使得清漆层的反射效果符合清漆层的真实质感。
在一些实施例中,终端计算反射粗糙度的平方,得到候选粗糙度系数,计算候选粗糙度系数的平方,得到粗糙度系数。在实际应用中,粗糙度系数可以是0至1之间的值。终端融合清漆层的第一法线向量和第一半角向量,可以是将第一法线向量和第一半角向量进行点乘;
比如第一融合结果为TopNdH,TopNdH=dot(N1,H1),其中,N1是第一法线向量,H1是第一半角向量。
终端确定粗糙度系数和第一融合结果的第一乘积,确定该第一乘积和第一融合结果的第一差值,确定该第一差值与该第一融合结果之间的第二乘积,进而通过第二乘积确定候选粗糙度系数;终端计算候选粗糙度系数的平方,确定粗糙度系数与候选粗糙度系数的平方之间的比值,得到清漆层的反射粗糙度。
需要说明的是,粗糙度系数是待渲染位置在清漆层上的粗糙度系数,第一法线向量和第一半角向量均是待渲染位置在清漆层上的第一法线向量和第一半角向量,进而第一融合结果是待渲染位置在清漆层上对应第一融合结果,清漆层的反射粗糙度,也是待渲染位置在清漆层上的反射粗糙度;通过与上述同样的方式,可以确定虚拟对象的外装上各待渲染位置在清漆层上的反射粗糙度。基于待渲染位置的第一法线向量和第一半角向量确定反射粗糙度,使得渲染的尺度细化到待渲染位置的像素尺度,可以带来更加接近真实的清漆质感。
在一些实施例中,终端可以在PBR光照模型中,通过GGX分布函数,对粗糙度系数和第一融合结果进行处理,确定清漆层的反射粗糙度,PBR(Physicallly-BasedRendering,物理渲染)是一种物理渲染技术,GGX分布即Trowbridge-Reitz分布,可以用于渲染镜面反射;通过GGX分布函数,在清漆层的微表面上确定清漆层的反射粗糙度,使得反射粗糙度可以反映清漆层的微表面对光的反射效果,通过GGX分布函数直接确定反射粗糙度,可以节省确定反射粗糙度所需时长,提升渲染效率。
在上述实施例中,将清漆层的第一法线向量和第一半角向量融合,根据融合得到的第一融合结果和粗糙度系数,确定清漆层的反射粗糙度,反射粗糙度可以反映光在清漆层上的反射效果,使得清漆层的反射效果符合清漆层的真实质感,后续根据清漆层的反射粗糙度确定第一高光值,使得第一高光值可以体现清漆层对光进行镜面反射的程度。
在一些实施例中,基于清漆层粗糙度、第一法线向量、清漆层的第一视线方向向量和直接光源的光源方向向量,确定清漆层的能见度,包括:基于虚拟对象的清漆层粗糙度确定粗糙度系数;对第一法线向量和清漆层的第一视线方向向量进行融合处理,得到第二融合结果;对第一法线向量和直接光源的光源方向向量进行融合处理,得到第三融合结果;基于粗糙度系数、第二融合结果和第三融合结果,确定清漆层在视线方向上的能见度和在光源方向上的能见度;基于在视线方向上的能见度和在光源方向上的能见度,确定清漆层的能见度。根据清漆层粗糙度确定清漆层的能见度,使得能见度可以反映清漆层对光的遮挡程度,进而可以反映光在清漆层上的反射效果,使得清漆层对光的反射效果符合清漆层的真实质感。
在一些实施例中,终端计算反射粗糙度的平方,得到候选粗糙度系数,计算候选粗糙度系数的平方,得到粗糙度系数。在实际应用中,粗糙度系数可以是0至1之间的值。
终端将第一法线向量和第一视线方向向量进行点乘,得到第二融合结果,比如第二融合结果为TopNdV,TopNdV=dot(N1,V1),其中,N1是第一法线向量,V1是第一视线方向向量。终端将第一法线向量和清漆层的光源方向向量进行点乘,得到第三融合结果,比如第三融合结果为TopNdL,TopNdL=dot(N1,L1),其中,N1是第一法线向量,L1是清漆层的光源方向向量。
在得到粗糙度系数之后,终端可以采用第一融合方式,对粗糙度系数、第二融合结果和第三融合结果进行处理,得到清漆层在视线方向上的能见度;采用第二融合方式,对粗糙度系数、第二融合结果和第三融合结果进行处理,得到清漆层在光源方向上的能见度。
需要说明的是,第一融合方式和第二融合方式不同,采用第一融合方式,可以是基于粗糙度系数和第二融合结果确定第一中间结果,再对第一中间结果与第三融合进行融合处理,得到清漆层在视线方向上的能见度;采用第二融合方式,可以是基于粗糙度系数和第三融合
结果确定第二中间结果,再对第二中间结果与第二融合结果进行融合处理,得到清漆层在光源方向上的能见度。
终端确定在视线方向上的能见度和在光源方向上的能见度之间的和值,得到候选能见度,确定参考系数和候选能见度之间的比值,得到清漆层的能见度。在实际应用中,参考系数可以是0.5。
需要说明的是,粗糙度系数、第二融合结果和第三融合结果均是待渲染位置在清漆层上的反射粗糙度,进而清漆层的能见度,也是待渲染位置在清漆层上的能见度,通过与上述同样的方式,可以确定虚拟对象的外装上各待渲染位置在清漆层上的能见度。基于待渲染位置的粗糙度系数、第二融合结果和第三融合结果确定能见度,使得渲染的尺度细化到待渲染位置的像素尺度,可以带来更加接近真实的清漆质感。
在一些实施例中,基于粗糙度系数、第二融合结果和第三融合结果,确定清漆层在视线方向上的能见度和在光源方向上的能见度,包括:确定初始系数和粗糙度系数之间的第二差值;确定第二差值和第二融合结果之间的第三乘积,确定第三乘积和粗糙度系数之间的第四乘积;确定第四乘积和第三融合结果之间的乘积,得到清漆层在视线方向上的能见度;及基于粗糙度系数、第二差值、第二融合结果和第三融合结果,确定清漆层在光源方向上的能见度。通过初始系数、粗糙度系数、第二融合结果和第三融合结果确定清漆层在在光源方向上的能见度,提升了清漆层在视线方向上对光的遮挡程度的准确度,使得清漆层对光的反射效果符合清漆层的真实质感。
终端计算初始系数减去粗糙度所得的第二差值,将第二差值和第二融合结果相乘,得到第三乘积,将第三乘积和粗糙度系数相乘,得到第四乘积,将第四乘积和第三融合结果相乘,得到清漆层在视线方向上的能见度;在实际应用中,初始系数可以根据需求设定,比如,初始系数可以是1。
在一些实施例中,基于粗糙度系数、第二差值、第二融合结果和第三融合结果,确定清漆层在光源方向上的能见度,包括:确定第二差值和第三融合结果之间的第五乘积;确定粗糙度系数和第五乘积之间的第六乘积;及确定第六乘积和第二融合结果之间的乘积,得到清漆层在光源方向上的能见度。通过初始系数、粗糙度系数、第二融合结果和第三融合结果确定清漆层在光源方向上的能见度,提升了清漆层在光源方向上对光的遮挡程度的准确度,使得清漆层对光的反射效果符合清漆层的真实质感。
在一些实施例中,终端可以在PBR光照模型中,通过Smith函数对于粗糙度系数、第二融合结果和第三融合结果进行处理,得到清漆层的能见度,其中,Smith函数是一种遮蔽函数,可以用于确定清漆层上微表面对入射光和出射光的遮挡程度,进而确定能见度。通过Smith函数,在清漆层的微表面上确定清漆层的能见度,使得能见度可以反映清漆层的微表面对光的遮挡程度,通过Smith函数直接确定能见度,可以节省确定能见度所需时长,提升渲染效率。
在上述实施例中,将清漆层的第一法线向量和第一视线方向向量融合,得到的第二融合结果,将第一法线向量和清漆层的光源方向向量融合,得到第三融合结果,根据粗糙度系数、第二融合结果和第二融合结果确定清漆层的能见度,使得能见度可以反映清漆层对光的遮挡程度,进而可以反映光在清漆层上的反射效果,使得清漆层对光的反射效果符合清漆层的真实质感,后续根据清漆层的能见度确定第一高光值,使得第一高光值可以体现清漆层对光进行镜面反射的程度。
在一些实施例中,基于反射粗糙度、能见度和清漆层的反射强度,确定清漆层在直接光源下的第一高光值,包括:基于反射粗糙度、能见度和清漆层的第一菲涅尔系数,确定清漆层反射率;基于清漆层反射率和清漆层的反射强度,确定清漆层在直接光源下的第一高光值。
通过引入第一菲涅尔系数,使得光线的入射角度影响反射率,进而提升了基于反射率确定的第一高光值的准确度。
其中,第一菲涅尔系数是待渲染位置在清漆层上的菲涅尔系数;第一菲涅尔系数用于反映光在不同入射角度下的反射强度,在入射角度较大时,清漆层对光线进行镜面反射,在入射角度较小时,清漆层对光线进行散射,在实际渲染中,清漆层对光线进行散射可以展示粗糙效果。
在一些实施例中,终端对第一法线向量和清漆层的光源方向向量进行融合,得到第三融合结果;确定清漆层的反射粗糙度、能见度和第一菲涅尔系数之间的乘积,得到清漆层的反射率,确定清漆层的反射强度、第三融合结果和反射率之间的乘积,得到清漆层在直接光源下的第一高光值。
需要说明的是,第一菲涅尔系数是待渲染位置在清漆层上的菲涅尔系数,基于第一菲涅尔系数确定的清漆层反射率,是待渲染位置在清漆层上的菲涅尔系数,进而第一高光值也是待渲染位置在清漆层上的第一高光值,通过与上述同样的方式,可以确定虚拟对象的外装上各待渲染位置在清漆层上的第一高光值。
在上述实施例中,基于反射粗糙度、能见度和清漆层的第一菲涅尔系数,确定清漆层的反射率,再基于清漆层反射率确定第一高光值,通过引入第一菲涅尔系数,使得光线的入射角度影响反射率,进而提升了基于反射率确定的第一高光值的准确度。
在一些实施例中,光源包括直接光源;依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值,包括:基于原始反射值、透射率和清漆层的反射强度,确定外装表层对直接透射光进行反射的反射值;直接透射光是直接光源发出的且透射清漆层的光;基于外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数;基于透射率和第二菲涅尔系数,确定直接透射光在外装表层上产生的第二高光值。结合原始反射值、透射率和反射强度确定覆盖清漆层后的外装表层的反射值,提升了反射值的准确度;第二菲涅尔系数可以用于反映光经过两个介质的界面时,反射和透射的光强比重,引入第二菲涅尔系数,使得第二高光值与该光强比重(光经过两个介质的界面时,反射和透射的光强比重)相关,提升了第二高光值的准确度。
其中,原始反射值是待渲染位置在外装表层上的原始反射值,不同的待渲染位置在外装表层上的原始反射值可能不同;在实际应用中,外装表层的原始反射值可以是漫反射值。
直接光源发出的光透射清漆层后照射在外装表层,将直接光源发出的光透射清漆层后的光作为直接透射光,直接透射光对外装表层的原始反射值产生影响,得到反射值。
其中,第二视线方向向量,是待渲染位置在外装表层上指向相机模型的向量;第二半角向量是外装表层的光源方向向量和第二视线方向向量的中间向量,外装表层的光源方向向量,用于表示直接透射光照射在外装表层的待渲染位置上的方向,外装表层的光源方向向量,也可以理解为直接透射光的方向向量。
其中,外装表层的第二法线向量,是待渲染位置在外装表层上的第二法线向量,待渲染位置的第二法线向量会影响待渲染位置的第二高光值,当不同待选位置的第二法线向量不同时,不同待渲染位置各自的第二高光值也不同,可以渲染出外装表层的粗糙效果。
其中,第二法线向量对应的反射率,是待渲染位置的第二法线方向上的反射率;第二菲涅尔系数是待渲染位置在外装表层上的菲涅尔系数。
在一些实施例中,终端可以获取外装表层的漫反射贴图,从漫反射贴图中获取待渲染位置在外装表层上的原始反射值;基于待渲染位置在外装表层上的原始反射值、待渲染位置在清漆层上的透射率和待渲染位置在清漆层上的反射强度,确定在直接透射光下,待渲染位置在外装表层上的反射值。
终端获取待渲染位置在外装表层的光源方向向量和第二视线方向向量,根据外装表层的光源方向向量和第二视线方向向量确定第二半角向量,并获取第二法线向量对应的反射率。
终端可以根据待渲染位置在外装表层上的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定待渲染位置在外装表层上的第二菲涅尔系数。
终端获取待渲染位置在外装表层上的初始菲涅尔值,初始菲涅尔值用于表示光线垂直入射时的菲涅尔系数;终端确定待渲染位置在外装表层上的初始菲涅尔值、第二菲涅尔系数以及待渲染位置的第二法线方向上的反射率的乘积,得到待渲染位置在外装表层上的第二高光值。
通过与上述同样的方式,可以确定虚拟对象的外装上各待渲染位置在外装表层的第二高光值。
在上述实施例中,结合原始外装层的原始反射值、清漆层的透射率和反射强度,确定外装表层对直接透射光的反射值,提升了确定的覆盖清漆层后的外装表层的反射值的准确度;引入第二菲涅尔系数,使得第二高光值与光经过两个介质的界面时的反射光强和透射光强的比重相关,提升了第二高光值的准确度,后续通过反射值和第二高光值确定外装表层在直接光源下的光照结果,使得覆盖清漆层后的外装表层的渲染效果更真实。
在一些实施例中,基于原始反射值、透射率和清漆层的反射强度,确定外装表层对直接透射光进行反射的反射值,包括:基于原始反射值、透射率和初始菲涅尔值,确定外装表层的候选反射值;依据清漆层的反射强度,对原始反射值和候选反射值进行插值处理,得到外装表层对直接透射光进行反射的反射值。依据清漆层的反射强度进行插值,使得反射值与清漆层的反射强度相关,提升了反射值的准确度。
在一些实施例中,终端确定待渲染位置在外装表层的反射值、透射率和初始菲涅尔值的乘积,得到候选反射值;终端待渲染位置在外装表层的反射强度,对原始反射值和候选反射值进行插值处理,得到外装表层对直接透射光进行反射的反射值;即根据清漆层的透射率和外装表层的反射强度确定反射值,使得反射值可以更好地反映外装表层对直接光源发出的且穿透清漆层的光的反射效果。
在一些实施例中,获取外装表层的原始反射值和清漆层的透射率之前,还包括:获取清漆层的色彩像素值、金属度和厚度,根据厚度、清漆层的第一法线向量、第一视线方向向量和直接光源的光源方向向量,确定直接光源发出的光穿透清漆层的路径距离,基于色彩像素值确定消光系数,基于消光系数、厚度和路径距离确定光深;基于光深和消光系数,确定清漆层的透射率。
终端获取清漆层的色彩贴图,在色彩贴图中获取待渲染位置在清漆层的色彩像素值;终端获取清漆层的金属度贴图,在金属度贴图中获取待渲染位置在清漆层的金属度;厚度是清漆层的厚度,可以根据虚拟对象的外装显示效果设置。
将待渲染位置在清漆层的金属度作为待渲染位置在清漆层的初始消光系数,当初始消光系数满足归一化条件时,对待渲染位置在清漆层的厚度进行归一化处理,得到归一化厚度;根据第一法线向量、第一视线方向向量和光源方向向量对归一化厚度进行再次归一化,得到直接光源发出的光穿透清漆层的路径距离;终端基于比尔-朗伯特定律对应的函数,对色彩像素值进行处理,得到待渲染位置在外装表层的透射像素值,基于透射像素值和归一化厚度,确定消光系数,根据消光系数、路径距离和归一化厚度,确定光深;终端获取待渲染位置清漆层的初始透射率;基于初始消光系数对初始透射率和候选透射率进行插值处理,得到清漆层的透射率。
其中,根据第一法线向量、第一视线方向向量和光源方向向量对归一化厚度进行再次归一化,得到直接光源发出的光穿透清漆层的路径距离,包括将第一法线向量和第一视线方向
向量融合,得到第二融合结果,将第一法线向量和清漆层的光源方向向量融合,得到第三融合结果;根据第二融合结果、第三融合结果和归一化厚度,确定直接光源发出的光穿透清漆层的路径距离。
其中,比尔-朗伯特定律描述了光在介质中传播时的衰减规律,即光的强度随着传播距离的增加而指数下降。
在上述实施例中,根据清漆层的色彩像素值、金属度和厚度确定直接光源发出的光穿透清漆层的路径距离,根据消光系数、清漆层的厚度和路径距离确定光深,基于光深和消光系数,确定清漆层的透射率,清漆层的透射率用于描述光穿透清漆层的衰减程度,进而基于透射率可以确定直接光源发出且穿透清漆层的光,提升了外装表层对直接透射光进行反射的反射值,以及直接投射光在外装表层上产生的高光值的准确度。
在一些实施例中,终端也可以在PBR光照模型中,通过CalcThinTransmission函数,对待渲染位置在清漆层的第二融合结果、第三融合结果、色彩像素值和金属度进行处理,得到待渲染位置在清漆层的透射率。CalcThinTransmission函数是用于计算层间透射的函数;通过CalcThinTransmission函数直接确定清漆层的透射率,可以节省确定透射率所需时长,提升渲染效率。
在上述实施例中,通过初始菲涅尔值、原始反射值和清漆层的透射率,确定候选反射值,依据清漆层的反射强度,对原始反射值和候选反射值进行插值处理,得到反射值,使得反射值受清漆层的反射强度的影响,提升了反射值的准确度,基于反射值渲染覆盖清漆层后的外装表层,使得覆盖清漆层后的外装表层可以得到更真实的,在直接光源下的反射效果。
在一些实施例中,基于外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数,包括:对外装表层的第二视线方向向量和第二半角向量进行融合处理,得到第四融合结果;基于第四融合结果和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数。提升了第二高光值的准确度,进而提升了覆盖清漆层后的外装表层,在直接光源下的高光效果。
在一些实施例中,终端对外装表层的第二视线方向向量和第二半角向量进行融合处理,可以是将第二视线方向向量和第二半角向量进行点乘;比如第四融合结果为BottomVdH,BottomVdH=dot(V2,H2),其中,V2是第二视线方向向量,H2是第二半角向量。终端可以通过简化的菲涅尔方程,基于第四融合向量和第二法线向量对应的反射率确定第二菲涅尔系数。如公式(1)所示。
公式(1):BottomF=f0+(1-f0)(1-BottomVdH)5;
其中,BottomF是待渲染位置在外装表层的第二菲涅尔系数,f0是待渲染位置在外装表层的第二法线向量对应的反射率,BottomVdH是待渲染位置在外装表层的第四融合结果。
在上述实施例中,根据第四融合结果和第二法线向量对应的反射率确定第二菲涅尔系数,以便于后续基于第二菲涅尔系数确定第二高光值,使得第二高光值与光经过清漆层和外装表层的时的反射光强和透射光强的比重相关,提升了第二高光值的准确度,进而提升了覆盖清漆层后的外装表层,在直接光源下的高光效果。
在一些实施例中,虚拟对象的外装渲染方法包括:基于清漆层粗糙度和虚拟对象所处环境的环境光贴图,确定清漆层在间接光源下的第三高光值;基于虚拟对象的外装表层粗糙度和环境光贴图,确定间接透射光在外装表层上产生的第四高光值;间接透射光是间接光源发出的且透射清漆层的光;基于第一高光值、反射值和第二高光值,确定目标光照值,包括:基于第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值。将清漆层和外装表层在直接光源和间接光源下产生的高光效果和反射效果叠加,使得外装表层的清
漆质感更真实,提升了视觉效果。
其中,虚拟环境的光源还包括间接光源,间接光源的发出的光来自于虚拟场景中的物体,比如间接光源的发出的光,可以是直接光源发出的光照射在物体上时,该物体反射的光;在实际应用中,可以通过环境光贴图模拟间接光源发出的光。
其中,第一高光值、反射值和第二高光值是基于直接光源发出的光所确定的,第三高光值和第四高光值是基于间接光源发出的光所确定的。
其中,外装表层粗糙度,是待渲染位置在外装表层上的粗糙度,不同的待渲染位置的外装表层粗糙度不同。
清漆层对间接光源发出的光进行镜面反射,第三高光值可以用于表示清漆层间接光源发出的光进行镜面反射的程度。间接光源发出的光透射清漆层后照射在外装表层,将间接光源发出的光透射清漆层后的光作为间接透射光;外装表层对间接透射光进行镜面反射,第四高光值可以用于表示外装表层对间接透射光进行镜面反射的程度。
在一些实施例中,终端基于待渲染位置的清漆层粗糙度和环境光贴图,确定待渲染位置在清漆层的第一色彩像素值,基于待渲染位置在清漆层的第一色彩像素值和第一菲涅尔系数,确定在间接光源下,待渲染位置在清漆层的第三高光值。终端基于待渲染位置的外装表层粗糙度和环境光贴图,确定待渲染位置在外装表层的第二色彩像素值,基于待渲染位置在外装表层的第二色彩像素值和第二菲涅尔系数,确定在间接光源下,待渲染位置在外装表层的第四高光值。通过第三高光值可以渲染得到清漆层在间接光源下的高光效果,通过第四高光值可以渲染得到外装表层在间接光源下的高光效果,综合清漆层和外装表层在直接光源和间接光源下的高光效果,可以得到更加接近真实的高光效果。
在一些实施例中,终端根据清漆层的第一高光值和第三高光值进行线性处理,得到清漆层的光照值,终端根据外装表层的反射值、第二高光值和第四高光值进行线性处理,得到外装表层的光照值,终端根据清漆层的光照值和外装表层的光照值,确定目标光照值;需要说明的是,第一高光值、反射值、第二高光值、第三高光值和第四高光值对应虚拟对象的外装上的同一待渲染位置。根据清漆层的光照值和外装表层的光照值确定目标光照值,根据该目标光照值进行渲染,可以将清漆层的显示效果和外装表层的显示效果进行叠加,得到在外装表层上覆盖清漆层的视觉效果,使得外装表层具有清漆质感。
在一些实施例中,终端根据清漆层的第一高光值、外装表层的反射值和第二高光值,确定在直接光源下的光照值,根据清漆层的第三高光值和外装表层的第四高光值,确定在间接光源下的光照值,根据直接光源下的光照值和间接光源下的光照值,确定目标光照值;同样地,第一高光值、反射值、第二高光值、第三高光值和第四高光值对应虚拟对象的外装上的同一待渲染位置。根据直接光源下的光照值和间接光源下的光照值确定目标光照值,根据该目标光照值进行渲染,可以将覆盖有清漆层的外装表层在直接光源下的显示效果,与覆盖有清漆层的外装表层在间接光源下的显示效果进行叠加,使得渲染的覆盖有清漆层的外装表层,具有更丰富的光照表现,提升了视觉效果。
在上述实施例中,通过环境光照贴图引入间接光源,并确定在清漆层对间接光源发出的光进行镜面反射所得的第三高光值,以及确定外装表层对间接透射光进行镜面反射所得的第四高光值;通过第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值,可以将清漆层和外装表层在直接光源和间接光源下产生的高光效果和反射效果叠加,通过目标光照值对虚拟对象的外装进行外装渲染,可以得到外装表层上覆盖清漆层的视觉效果,并且外装表层的清漆质感更真实,提升了视觉效果。
在一些实施例中,基于清漆层粗糙度和虚拟对象所处环境的环境光贴图,确定清漆层在间接光源下的第三高光值,包括:基于清漆层粗糙度、清漆层的第一法线向量和第一视线方
向向量,在虚拟对象所处环境的环境光贴图中确定清漆层的第一色彩像素值;基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度和清漆层的第一菲涅尔系数,确定清漆层在间接光源下的第三高光值。通过第三高光值可以渲染得到清漆层在间接光源下的高光效果。
其中,环境光贴图用于表示虚拟对象的外装受到的环境光照的情况,在实际应用中,环境光贴图可以通过虚拟环境的六个二维纹理图像,构成立方图的环境光照贴图。
其中,清漆层的间接光源反射率,用于表示间接光源对清漆层的反射率贡献,在实际应用中,清漆层的间接光源反射率可以通过环境双向反射分布的漫反射和镜面反射的预计算值确定。
在一些实施例中,终端获取环境双向反射分布的漫反射预计值和镜面反射的预计算值,获取清漆层的第一法线向量对应的反射率,根据第一法线向量对应的反射率、环境双向反射分布的漫反射预计值和镜面反射的预计算值,确定清漆层的间接光源反射率;示例性地,间接光源反射率为:f0*dfg.x+dfg.y,其中,f0是清漆层的第一法线向量对应的反射率,dfg.x是环境双向反射分布的漫反射预计值的加权和,dfg.y是环境双向反射分布的镜面反射预计值的加权和。
终端获取待渲染位置在清漆层的第一法线向量和第一视线方向向量,确定待渲染位置在清漆层的第一反射方向向量;在实际应用中,可以通过PBR模型的反射函数,对待渲染位置在清漆层的第一法线向量和第一视线方向向量进行处理,得到待渲染位置在清漆层的第一反射方向向量。
终端根据清漆层粗糙度和第一反射反向向量,在环境光贴图中采样得到待渲染位置在清漆层的第一色彩像素值;终端获取间接光源的光强度,待渲染位置在清漆层的第一菲涅尔系数;确定第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度和清漆层的第一菲涅尔系数之间的乘积,得到待渲染位置在清漆层的第三高光值。通过与上述同样的方式,可以得到虚拟对象的外装的各待渲染位置在清漆层的第三高光值。需要说明的是,通过环境光贴图引入间接光源,增加了清漆层对间接光源发出的光的反射效果,通过引入第一菲涅尔系数,可以提升覆盖了清漆层的外装表层的中心区域的清漆效果。
在一些实施例中,虚拟对象的外装渲染方法还包括:依据第一菲涅尔系数确定边缘调整系数;基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度和清漆层的第一菲涅尔系数,确定清漆层在间接光源下的第三高光值,还包括:基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度、清漆层的第一菲涅尔系数和边缘调整系数,确定清漆层在间接光源下的第三高光值。
具体地,边缘调整系数可以是1与第一菲涅尔系数的差值。终端确定第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度、清漆层的第一菲涅尔系数和边缘调整系数之间的乘积,得到第三高光值。
当覆盖了清漆层的外装表层的边缘区域的清漆效果较强,比如边缘区域的高光效果较强,需要降低中心区域的高光效果时,可以引入边缘调整系数,即根据第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度、清漆层的第一菲涅尔系数和边缘调整系数,确定第三高光值,基于该第三高光值确定目标光照值进行渲染,可以降低边缘区域的清漆效果。
示例性地,参考图7和图8,图7是在未引入边缘调整系数时,渲染得到的虚拟对象的盔甲(包括胸甲和臂甲),图8是引入边缘调整系数时,渲染得到的虚拟对象的盔甲,对比可知,在引入边缘调整系数后,渲染得到的胸甲和臂甲的边缘区域的高光效果有所下降。
在一些实施例中,可以通过提高环境光(间接光源发出)的强度和降低清漆层粗糙度,以提升清漆层对环境光的镜面反射效果。
当清漆层对环境光的镜面反射效果较强,可能会导致渲染得到的覆盖了清漆层的外装表层出现异常拉伸,如图9中的901所示;可以调整环境光贴图,以降低虚拟场景中地面贴图的亮度,以降低清漆层对环境光的镜面反射效果,进而改善渲染得到的覆盖了清漆层的外装表层出现异常拉伸的情况,降低虚拟场景中地面贴图的亮度后,渲染得到的覆盖了清漆层的外装表层如图10所示,对比可知,降低虚拟场景中地面贴图的亮度后,改善了渲染得到的覆盖了清漆层的外装表层的异常拉伸情况,如图10中的1001所示。
从整体来看,在没有调整环境光贴图的情况下,外装的渲染效果如图11所示,在调整环境光贴图的情况下,外装的渲染效果如图12所示,对比可知,图11所示的外装的亮度比图12所示的外装的亮度强,图11的盔甲存在异常拉伸,图12的盔甲不存在异常拉伸;降低虚拟场景中地面贴图的亮度后,改善了渲染得到的覆盖了清漆层的外装表层的异常拉伸情况。
在上述实施例中,在环境光贴图中采样得到第一色彩像素值,基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度和清漆层的第一菲涅尔系数,确定清漆层在间接光源下的第三高光值,通过引入第一菲涅尔系数,使得间接光源发出的光的入射角度影响清漆层的反射效果,提升了第三高光值的准确度,提升了清漆层在间接光源下的高光效果。
在一些实施例中,基于虚拟对象的外装表层粗糙度和环境光贴图,确定间接透射光在外装表层上产生的第四高光值,包括:基于虚拟对象的外装表层粗糙度、外装表层的第二视线方向向量和第二法线向量,在环境光贴图中获取外装表层的第二色彩像素值;基于第二色彩像素值、外装表层的间接光源反射率、间接光源的光强度和外装表层的第二菲涅尔系数,确定间接透射光在外装表层上产生的第四高光值。通过第四高光值可以渲染得到外装表层在间接光源下的高光效果。
其中,外装表层的间接光源反射率,用于表示间接光源对外装表层的反射率贡献,在实际应用中,外装表层的间接光源反射率可以通过环境双向反射分布的漫反射和镜面反射的预计算值确定。
在一些实施例中,终端获取环境双向反射分布的漫反射预计值和镜面反射的预计算值,获取外装表层的第二法线向量对应的反射率,根据第二法线向量对应的反射率、环境双向反射分布的漫反射预计值和镜面反射的预计算值,确定外装表层的间接光源反射率。
终端获取待渲染位置在外装表层的第二法线向量和第二视线方向向量,确定待渲染位置在外装表层的第二反射方向向量,在实际应用中,可以通过PBR模型的反射函数,对待渲染位置在外装表层的第二法线向量和第二视线方向向量进行处理,得到待渲染位置在外装表层的第二反射方向向量。
终端根据外装表层粗糙度和第二反射方向向量,在环境光贴图中采样得到待渲染位置在外装表层的第二色彩像素值;终端获取间接光源的光强度,待渲染位置在外装表层的第二菲涅尔系数;终端根据第二菲涅尔系数确定菲涅尔透射系数,确定第二色彩像素值、外装表层的间接光源反射率、间接光源的光强度和菲涅尔透射系数之间的乘积,得到待渲染位置在外装表层的第四高光值。通过与上述同样的方式,可以得到虚拟对象的外装的各待渲染位置在外装表层的第四高光值。
其中,终端根据第二菲涅尔系数确定菲涅尔透射系数,可以是确定1与第二菲涅尔系数的差值,得到菲涅尔透射系数。
在上述实施例中,在环境光贴图中采样得到第二色彩像素值,基于第二色彩像素值、外装表层的间接光源反射率、间接光源的光强度和外装表层的第二菲涅尔系数,确定间接透射光在外装表层上产生的第四高光值,提升了外装表层在间接光源下的高光效果。
在一些实施例中,基于第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值,包括:基于第一高光值和第三高光值,确定清漆层上的且为待渲染位置的光
照值;基于反射值、第二高光值和第四高光值,确定外装表层上的且为待渲染位置的光照值;基于清漆层上的且为待渲染位置的光照值和外装表层上的且为待渲染位置的光照值,确定待渲染位置的目标光照值。将清漆层和外装表层在直接光源和间接光源下产生的高光效果和反射效果叠加,通过目标光照值对虚拟对象的外装进行外装渲染,使得外装表层的清漆质感更真实,提升了视觉效果。
在一些实施例中,终端对待渲染位置的第一高光值和第三高光值进行线性处理,得到待渲染位置在清漆层上的光照值;终端对待渲染位置的反射值、第二高光值和第四高光值进行线性处理,得到待渲染位置在外装表层上的光照值;终端对待渲染位置在清漆层上的光照值和在外装表层上的光照值进行线性处理,得到待渲染位置的目标光照值。目标光照值是结合清漆层和外装表层在直接光源和间接光源下的光照值确定的,使得目标光照值可以反映清漆层和外装表层在直接光源和间接光源下综合所得的光照值,进而基于目标光照值进行渲染,可以综合清漆层和外装表层的光照效果,提升外装的视觉效果。
在一些实施例中,终端对待渲染位置的第一高光值和第三高光值进行线性处理,得到待渲染位置在清漆层上的光照值,可以是将第一高光值和第三高光值相加,得到待渲染位置在清漆层上的光照值;将第一高光值和第三高光值相加,可以减少确定清漆层上的光照值所需的硬件资源,提升渲染效率。
终端对待渲染位置的第一高光值和第三高光值进行线性处理,得到待渲染位置在清漆层上的光照值,也可以是终端获取直接光源和间接光源和权重,按照直接光源和间接光源和权重对第一高光值和第三高光值进行加权求和,得到待渲染位置在清漆层上的光照值;对第一高光值和第三高光值进行加权求和,使得清漆层上的光照值可以偏向第一高光值和第三高光值中权重更高的一项,突出清漆层在直接光源或间接光源下的光照效果。
在一些实施例中,终端对待渲染位置的反射值、第二高光值和第四高光值进行线性处理,得到待渲染位置在外装表层上的光照值,可以是将待渲染位置的反射值、第二高光值和第四高光值相加,得到待渲染位置在外装表层上的光照值;也可以是终端将反射值和第二相加,得到第一相加结果,按照直接光源和间接光源和权重对第一相加结果和第四高光值进行加权求和,得到待渲染位置在外装表层上的光照值;将反射值、第二高光值和第四高光值相加,可以减少确定外装表层的光照值所需的硬件资源,提升渲染效率;对第一相加结果和第四高光值进行加权求和,使得外装表层的光照值可以偏向第一相加结果和第四高光值中权重更高的一项,突出外装表层在直接光源或间接光源下的光照效果。
终端对待渲染位置的反射值、第二高光值和第四高光值进行线性处理,得到待渲染位置在外装表层上的光照值,还可以是终端将第二高光值和第四高光值相加,得到第二相加结果,获取反射权重和高光权重,依据反射权重和高光权重对反射值和第二相加结果进行加权求和,得到待渲染位置在外装表层上的光照值。对反射值和第二相加结果进行加权求和,使得外装表层上的光照值可以偏向反射值和第二相加结果中权重更高的一项,突出外装表层的反射效果或高光效果。
在一些实施例中,终端对待渲染位置在清漆层上的光照值和在外装表层上的光照值进行线性处理,得到待渲染位置的目标光照值,可以是将待渲染位置在清漆层上的光照值和在外装表层上的光照值相加,得到待渲染位置的目标光照值;也可以是按照清漆层和外装表层的权重,对待渲染位置在清漆层上的光照值和在外装表层上的光照值进行加权求和,得到待渲染位置的目标光照值。
在上述实施例中,通过第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值,可以将清漆层和外装表层在直接光源和间接光源下产生的高光效果和反射效果叠加,通过目标光照值对虚拟对象的外装进行外装渲染,可以得到外装表层上覆盖清漆层
的视觉效果,并且外装表层的清漆质感更真实,提升了视觉效果。
在一些实施例中,虚拟对象的外装渲染可以应用于对虚拟场景中虚拟对象的外装进行渲染的场景;示例性地,虚拟对象的外装表层为丝绸材质,在丝绸上覆盖清漆层,以模拟丝绸材质在真实环境下的质感,提升丝绸材质的显示效果。
终端根据虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定清漆层的反射粗糙度,终端基于清漆层粗糙、第一法线向量、第一视线方向向量和直接光源的光源方向向量,确定清漆层的能见度,根据反射粗糙度、能见度和清漆层的反射强度,确定清漆层在直接光源下的第一高光值;
终端根据丝绸材质的外装表层的原始反射值、清漆层的透射率和反射强度,确定丝绸材质的外装表层对直接透光进行反射的反射值;基于丝绸材质的外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定丝绸材质的外装表层的第二菲涅尔系数,根据透射率和第二菲涅尔系数,确定直接透射光在丝绸材质的外装表层上产生的第二高光值;
终端基于清漆层粗糙度和虚拟对象所处环境的环境光贴图,确定清漆层在间接光源下的第三高光值;基于丝绸材质的外装表层粗糙度和环境光贴图,确定间接透射光在丝绸材质的外装表层上产生的第四高光值;
终端基于第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值。
通过在丝绸材质的外装表层上覆盖清漆层,而没有增加额外的材质种类,可以在硬件资源的占用较小的情况下,渲染得到在丝绸材质的外装表层上覆盖清漆层的效果,使得丝绸材质的外装具备清漆质感。
在一些实施例中,如图13所示,虚拟对象的外装渲染方法,包括:
步骤1301,基于虚拟对象的清漆层粗糙度确定粗糙度系数;融合清漆层的第一法线向量和第一半角向量,得到第一融合结果;基于粗糙度系数和第一融合结果,确定清漆层的反射粗糙度;
步骤1302,对第一法线向量和清漆层的第一视线方向向量进行融合处理,得到第二融合结果;对第一法线向量和清漆层的光源方向向量进行融合处理,得到第三融合结果;确定初始系数和粗糙度系数之间的第二差值;确定第二差值和第二融合结果之间的第三乘积,确定第三乘积和粗糙度系数之间的第四乘积;确定第四乘积和第三融合结果之间的乘积,得到清漆层在视线方向上的能见度;确定第二差值和第三融合结果之间的第五乘积;确定粗糙度系数和第五乘积之间的第六乘积;确定第六乘积和第二融合结果之间的乘积,得到清漆层在光源方向上的能见度;基于在视线方向上的能见度和在光源方向上的能见度,确定清漆层的能见度;
步骤1303,基于反射粗糙度、能见度和清漆层的第一菲涅尔系数,确定清漆层反射率;基于清漆层反射率和清漆层的反射强度,确定清漆层在直接光源下的第一高光值;
步骤1304,获取清漆层的色彩像素值、金属度和厚度;根据厚度、清漆层的第一法线向量、第一视线方向向量和直接光源的光源方向向量,确定直接光源发出的光穿透清漆层的路径距离;基于色彩像素值确定消光系数;基于消光系数、厚度和路径距离确定光深;及基于光深和消光系数,确定清漆层的透射率;
步骤1305,基于外装表层的原始反射值、清漆层的透射率和初始菲涅尔值,确定外装表层的候选反射值;依据清漆层的反射强度,对原始反射值和候选反射值进行插值处理,得到外装表层对直接透射光进行反射的反射值;直接透射光是直接光源发出的且透射清漆层的光;
步骤1306,对外装表层的第二视线方向向量和第二半角向量进行融合处理,得到第四融合结果;基于第四融合结果和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数;基于透射率和第二菲涅尔系数,确定直接透射光在外装表层上产生的第二高光值;
步骤1307,基于清漆层粗糙度、清漆层的第一法线向量和第一视线方向向量,在虚拟对象所处环境的环境光贴图中确定清漆层的第一色彩像素值;依据第一菲涅尔系数确定边缘调整系数,基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度、清漆层的第一菲涅尔系数和边缘调整系数,确定清漆层在间接光源下的第三高光值;
步骤1308,基于虚拟对象的外装表层粗糙度、外装表层的第二视线方向向量和第二法线向量,在环境光贴图中获取外装表层的第二色彩像素值;基于第二色彩像素值、外装表层的间接光源反射率、间接光源的光强度和外装表层的第二菲涅尔系数,确定间接透射光在外装表层上产生的第四高光值;间接透射光是间接光源发出的且透射清漆层的光;
步骤1309,基于第一高光值和第三高光值,确定清漆层上的且为待渲染位置的光照值;基于反射值、第二高光值和第四高光值,确定外装表层上的且为待渲染位置的光照值;基于清漆层上的且为待渲染位置的光照值和外装表层上的且为待渲染位置的光照值,确定待渲染位置的目标光照值。
应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
上述虚拟对象的外装渲染方法中,对于覆盖在外装表层上的清漆层,确定清漆层在光源下的第一高光值,根据原始反射值和透射率确定外装表层在光源下的反射值和第二高光值,根据第一高光值、反射值和第二高光值确定目标光照值,根据目标光照值对虚拟对象的外装进行光照渲染,可以将清漆层上的高光效果、外装表层上的反射效果和高光效果叠加,得到在外装表层上覆盖清漆层的视觉效果,使得外装表层具有清漆质感,提升了视觉效果。
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的虚拟对象的外装渲染方法的虚拟对象的外装渲染装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个虚拟对象的外装渲染装置实施例中的具体限定可以参见上文中对虚拟对象的外装渲染方法的限定。
在一个实施例中,如图14所示,提供了一种虚拟对象的外装渲染装置,包括:清漆层处理模块1401、获取模块1402、外装表层处理模块1403、目标光照值确定模块1404和渲染模块1405,其中:
清漆层处理模块1401,用于确定虚拟对象的清漆层在光源下的第一高光值;清漆层是覆盖于虚拟对象的外装表层上的清漆材质;
获取模块1402,用于获取外装表层的原始反射值和清漆层的透射率;
外装表层处理模块1403,用于依据原始反射值和透射率,确定外装表层在光源下的反射值和第二高光值;
目标光照值确定模块1404,用于基于第一高光值、反射值和第二高光值,确定目标光照值;
渲染模块1405,用于根据目标光照值对虚拟对象的外装进行光照渲染。
在一些实施例中,光源为直接光源,清漆层处理模块1401包括:
反射粗糙度确定单元,用于基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定清漆层的反射粗糙度;
能见度确定单元,用于基于清漆层粗糙度、第一法线向量、清漆层的第一视线方向向量
和直接光源的光源方向向量,确定清漆层的能见度;
第一高光值确定单元,用于基于反射粗糙度、能见度和清漆层的反射强度,确定清漆层在直接光源下的第一高光值。
在一些实施例中,反射粗糙度确定单元,还用于基于虚拟对象的清漆层粗糙度确定粗糙度系数;融合清漆层的第一法线向量和第一半角向量,得到第一融合结果;基于粗糙度系数和第一融合结果,确定清漆层的反射粗糙度。
在一些实施例中,能见度确定单元,还用于基于虚拟对象的清漆层粗糙度确定粗糙度系数;对第一法线向量和清漆层的第一视线方向向量进行融合处理,得到第二融合结果;对第一法线向量和清漆层的光源方向向量进行融合处理,得到第三融合结果;基于粗糙度系数、第二融合结果和第三融合结果,确定清漆层在视线方向上的能见度和在光源方向上的能见度;基于在视线方向上的能见度和在光源方向上的能见度,确定清漆层的能见度。
在一些实施例中,能见度确定单元,还用于确定初始系数和粗糙度系数之间的第二差值;确定第二差值和第二融合结果之间的第三乘积,确定第三乘积和粗糙度系数之间的第四乘积;确定第四乘积和第三融合结果之间的乘积,得到清漆层在视线方向上的能见度;及基于粗糙度系数、第二差值、第二融合结果和第三融合结果,确定清漆层在光源方向上的能见度。
在一些实施例中,能见度确定单元,还用于确定第二差值和第三融合结果之间的第五乘积;确定粗糙度系数和第五乘积之间的第六乘积;及确定第六乘积和第二融合结果之间的乘积,得到清漆层在光源方向上的能见度。
在一些实施例中,第一高光值确定单元,还用于基于反射粗糙度、能见度和清漆层的第一菲涅尔系数,确定清漆层反射率;基于清漆层反射率和清漆层的反射强度,确定清漆层在直接光源下的第一高光值。
在一些实施例中,光源包括直接光源,外装表层处理模块1403,包括反射值确定单元、第二菲涅尔系数确定单元和第二高光值确定单元;
反射值确定单元,用于基于原始反射值、透射率和清漆层的反射强度,确定外装表层对直接透射光进行反射的反射值;直接透射光是直接光源发出的且透射清漆层的光;
第二菲涅尔系数确定单元,用于基于外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数;
第二高光值确定单元,用于基于透射率和第二菲涅尔系数,确定直接透射光在外装表层上产生的第二高光值。
在一些实施例中,反射值确定单元,还用于基于原始反射值、透射率和初始菲涅尔值,确定外装表层的候选反射值;依据清漆层的反射强度,对原始反射值和候选反射值进行插值处理,得到外装表层对直接透射光进行反射的反射值。
在一些实施例中,第二菲涅尔系数确定单元,还用于对外装表层的第二视线方向向量和第二半角向量进行融合处理,得到第四融合结果;基于第四融合结果和第二法线向量对应的反射率,确定外装表层的第二菲涅尔系数。
在一些实施例中,虚拟对象的外装渲染装置还包括:透射率确定模块,用于获取清漆层的色彩像素值、金属度和厚度;根据厚度、清漆层的第一法线向量、第一视线方向向量和直接光源的光源方向向量,确定直接光源发出的光穿透清漆层的路径距离;基于色彩像素值确定消光系数;基于消光系数、厚度和路径距离确定光深;及基于光深和消光系数,确定清漆层的透射率。
在一些实施例中,虚拟对象的外装渲染装置还包括:间接光源处理模块,用于基于清漆层粗糙度和虚拟对象所处环境的环境光贴图,确定清漆层在间接光源下的第三高光值;基于虚拟对象的外装表层粗糙度和环境光贴图,确定间接透射光在外装表层上产生的第四高光值;
间接透射光是间接光源发出的且透射清漆层的光;
相应地,目标光照值确定模块1404,用于基于第一高光值、反射值、第二高光值、第三高光值和第四高光值确定目标光照值。
在一些实施例中,间接光源处理模块包括:第三高光值确定单元,用于基于清漆层粗糙度、清漆层的第一法线向量和第一视线方向向量,在虚拟对象所处环境的环境光贴图中确定清漆层的第一色彩像素值;基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度和清漆层的第一菲涅尔系数,确定清漆层在间接光源下的第三高光值。
在一些实施例中,间接光源处理模块还包括:边缘调整系数确定模块,用于依据第一菲涅尔系数确定边缘调整系数;第三高光值确定单元,还用于基于第一色彩像素值、清漆层的间接光源反射率、间接光源的光强度、清漆层的第一菲涅尔系数和边缘调整系数,确定清漆层在间接光源下的第三高光值。
在一些实施例中,间接光源处理模块包括:第四高光值确定单元,用于基于虚拟对象的外装表层粗糙度、外装表层的第二视线方向向量和第二法线向量,在环境光贴图中获取外装表层的第二色彩像素值;基于第二色彩像素值、外装表层的间接光源反射率、间接光源的光强度和外装表层的第二菲涅尔系数,确定间接透射光在外装表层上产生的第四高光值。
在一些实施例中,目标光照值确定模块1404,还用于基于第一高光值和第三高光值,确定清漆层上的且为待渲染位置的光照值;基于反射值、第二高光值和第四高光值,确定外装表层上的且为待渲染位置的光照值;基于清漆层上的且为待渲染位置的光照值和外装表层上的且为待渲染位置的光照值,确定待渲染位置的目标光照值。
上述虚拟对象的外装渲染装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图15所示。该计算机设备包括处理器、存储器、输入/输出接口、通信接口、显示单元和输入装置。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口、显示单元和输入装置通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种虚拟对象的外装渲染方法。该计算机设备的显示单元用于形成视觉可见的画面,可以是显示屏、投影装置或虚拟现实成像装置,显示屏可以是液晶显示屏或电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图15中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,该计算机可读指令被处理器执行时,使得一个或多个处理器实现上述虚拟对象的外装渲染方法。
在一个实施例中,提供了一个或多个非易失性可读存储介质,其上存储有计算机可读指令,计算机可读指令被所述处理器执行时,使得一个或多个处理器实现上述虚拟对象的外装
渲染方法。
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,计算机可读指令,该计算机可读指令被处理器执行时实现上述虚拟对象的外装渲染方法。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。
Claims (20)
- 一种虚拟对象的外装渲染方法,其中,应用于终端,所述方法包括:确定虚拟对象的清漆层在光源下的第一高光值,所述清漆层是覆盖于所述虚拟对象的外装表层上的清漆材质;获取所述外装表层的原始反射值和所述清漆层的透射率;依据所述原始反射值和所述透射率,确定所述外装表层在所述光源下的反射值和第二高光值;基于所述第一高光值、所述反射值和所述第二高光值,确定目标光照值;及根据所述目标光照值对所述虚拟对象的外装进行光照渲染。
- 根据权利要求1所述的方法,其中,所述光源为直接光源,所述确定虚拟对象的清漆层在光源下的第一高光值,包括:基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定所述清漆层的反射粗糙度;基于所述清漆层粗糙度、所述第一法线向量、所述清漆层的第一视线方向向量和所述直接光源的光源方向向量,确定所述清漆层的能见度;及基于所述反射粗糙度、所述能见度和所述清漆层的反射强度,确定所述清漆层在所述直接光源下的第一高光值。
- 根据权利要求2所述的方法,其中,所述基于虚拟对象的清漆层粗糙度、清漆层的第一法线向量和第一半角向量,确定所述清漆层的反射粗糙度,包括:基于虚拟对象的清漆层粗糙度确定粗糙度系数;融合清漆层的第一法线向量和第一半角向量,得到第一融合结果;及基于所述粗糙度系数和所述第一融合结果,确定所述清漆层的反射粗糙度。
- 根据权利要求2或3所述的方法,其中,所述基于所述清漆层粗糙度、所述第一法线向量、所述清漆层的第一视线方向向量和所述直接光源的光源方向向量,确定所述清漆层的能见度,包括:基于所述虚拟对象的清漆层粗糙度确定粗糙度系数;对所述第一法线向量和所述清漆层的第一视线方向向量进行融合处理,得到第二融合结果;对所述第一法线向量和所述直接光源的光源方向向量进行融合处理,得到第三融合结果;基于所述粗糙度系数、所述第二融合结果和所述第三融合结果,确定所述清漆层在视线方向上的能见度和在光源方向上的能见度;及基于在所述视线方向上的能见度和在所述光源方向上的能见度,确定所述清漆层的能见度。
- 根据权利要求4所述的方法,其中,所述基于所述粗糙度系数、所述第二融合结果和所述第三融合结果,确定所述清漆层在视线方向上的能见度和在光源方向上的能见度,包括:确定初始系数和粗糙度系数之间的第二差值;确定所述第二差值和所述第二融合结果之间的第三乘积,确定所述第三乘积和所述粗糙度系数之间的第四乘积;确定所述第四乘积和所述第三融合结果之间的乘积,得到所述清漆层在视线方向上的能见度;及基于所述粗糙度系数、所述第二差值、所述第二融合结果和所述第三融合结果,确定所述清漆层在光源方向上的能见度。
- 根据权利要求5所述的方法,其中,所述基于所述粗糙度系数、所述第二差值、所述 第二融合结果和所述第三融合结果,确定所述清漆层在光源方向上的能见度,包括:确定所述第二差值和所述第三融合结果之间的第五乘积;确定所述粗糙度系数和所述第五乘积之间的第六乘积;及确定所述第六乘积和所述第二融合结果之间的乘积,得到所述清漆层在光源方向上的能见度。
- 根据权利要求2至6中任一项所述的方法,其中,所述基于所述反射粗糙度、所述能见度和所述清漆层的反射强度,确定所述清漆层在所述直接光源下的第一高光值,包括:基于所述反射粗糙度、所述能见度和所述清漆层的第一菲涅尔系数,确定清漆层反射率;及基于所述清漆层反射率和所述清漆层的反射强度,确定所述清漆层在所述直接光源下的第一高光值。
- 根据权利要求1至7中任一项所述的方法,其中,所述光源包括直接光源,所述依据所述原始反射值和所述透射率,确定所述外装表层在所述光源下的反射值和第二高光值,包括:基于所述原始反射值、所述透射率和所述清漆层的反射强度,确定所述外装表层对直接透射光进行反射的反射值,所述直接透射光是所述直接光源发出的且透射所述清漆层的光;基于所述外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定所述外装表层的第二菲涅尔系数;及基于所述透射率和所述第二菲涅尔系数,确定所述直接透射光在所述外装表层上产生的第二高光值。
- 根据权利要求8所述的方法,其中,所述基于所述原始反射值、所述透射率和所述清漆层的反射强度,确定所述外装表层对直接透射光进行反射的反射值,包括:基于所述原始反射值、所述透射率和初始菲涅尔值,确定所述外装表层的候选反射值;及依据所述清漆层的反射强度,对所述原始反射值和所述候选反射值进行插值处理,得到所述外装表层对直接透射光进行反射的反射值。
- 根据权利要求8或9所述的方法,其中,所述基于所述外装表层的第二视线方向向量、第二半角向量和第二法线向量对应的反射率,确定所述外装表层的第二菲涅尔系数,包括:对所述外装表层的第二视线方向向量和第二半角向量进行融合处理,得到第四融合结果;及基于所述第四融合结果和第二法线向量对应的反射率,确定所述外装表层的第二菲涅尔系数。
- 根据权利要求1至10中任一项所述的方法,其中,所述获取所述外装表层的原始反射值和所述清漆层的透射率之前,还包括:获取所述清漆层的色彩像素值、金属度和厚度;根据所述厚度、所述清漆层的第一法线向量、第一视线方向向量和直接光源的光源方向向量,确定所述直接光源发出的光穿透所述清漆层的路径距离;基于所述色彩像素值确定消光系数;基于所述消光系数、所述厚度和所述路径距离确定光深;及基于所述光深和所述消光系数,确定所述清漆层的透射率。
- 根据权利要求1至11中任一项所述的方法,其中,所述方法还包括:基于清漆层粗糙度和所述虚拟对象所处环境的环境光贴图,确定所述清漆层在间接光源 下的第三高光值;基于所述虚拟对象的外装表层粗糙度和所述环境光贴图,确定间接透射光在所述外装表层上产生的第四高光值,所述间接透射光是所述间接光源发出的且透射所述清漆层的光;所述基于所述第一高光值、所述反射值和所述第二高光值,确定目标光照值,包括:基于所述第一高光值、所述反射值、所述第二高光值、所述第三高光值和所述第四高光值确定目标光照值。
- 根据权利要求12所述的方法,其中,所述基于清漆层粗糙度和所述虚拟对象所处环境的环境光贴图,确定所述清漆层在间接光源下的第三高光值,包括:基于清漆层粗糙度、所述清漆层的第一法线向量和第一视线方向向量,在所述虚拟对象所处环境的环境光贴图中确定所述清漆层的第一色彩像素值;及基于所述第一色彩像素值、所述清漆层的间接光源反射率、所述间接光源的光强度和所述清漆层的第一菲涅尔系数,确定所述清漆层在所述间接光源下的第三高光值。
- 根据权利要求13所述的方法,其中,所述方法还包括:依据第一菲涅尔系数确定边缘调整系数;所述基于所述第一色彩像素值、所述清漆层的间接光源反射率、所述间接光源的光强度和所述清漆层的第一菲涅尔系数,确定所述清漆层在所述间接光源下的第三高光值,还包括:基于所述第一色彩像素值、所述清漆层的间接光源反射率、所述间接光源的光强度、所述清漆层的第一菲涅尔系数和所述边缘调整系数,确定所述清漆层在所述间接光源下的第三高光值。
- 根据权利要求12至14中任一项所述的方法,其中,所述基于所述虚拟对象的外装表层粗糙度和所述环境光贴图,确定间接透射光在所述外装表层上产生的第四高光值,包括:基于所述虚拟对象的外装表层粗糙度、所述外装表层的第二视线方向向量和第二法线向量,在所述环境光贴图中获取所述外装表层的第二色彩像素值;及基于所述第二色彩像素值、所述外装表层的间接光源反射率、所述间接光源的光强度和所述外装表层的第二菲涅尔系数,确定间接透射光在所述外装表层上产生的第四高光值。
- 根据权利要求12至15中任一项所述的方法,其中,所述基于所述第一高光值、所述反射值、所述第二高光值、所述第三高光值和所述第四高光值确定目标光照值,包括:基于所述第一高光值和所述第三高光值,确定所述清漆层上的且为待渲染位置的光照值;基于所述反射值、所述第二高光值和所述第四高光值,确定所述外装表层上的且为所述待渲染位置的光照值;及基于所述清漆层上的且为待渲染位置的光照值和所述外装表层上的且为所述待渲染位置的光照值,确定所述待渲染位置的目标光照值。
- 一种虚拟对象的外装渲染装置,其中,所述装置包括:清漆层处理模块,用于确定虚拟对象的清漆层在光源下的第一高光值,所述清漆层是覆盖于所述虚拟对象的外装表层上的清漆材质;获取模块,用于获取所述外装表层的原始反射值和所述清漆层的透射率;外装表层处理模块,用于依据所述原始反射值和所述透射率,确定所述外装表层在所述光源下的反射值和第二高光值;目标光照值确定模块,用于基于所述第一高光值、所述反射值和所述第二高光值,确定目标光照值;及渲染模块,用于根据所述目标光照值对所述虚拟对象的外装进行光照渲染。
- 一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得一个或多个处理器执行权利要求1至 16中任一项所述的方法的步骤。
- 一个或多个非易失性可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得一个或多个处理器实现权利要求1至16中任一项所述的方法的步骤。
- 一种计算机程序产品,包括计算机可读指令,该计算机可读指令被处理器执行时实现权利要求1至16中任一项所述的方法的步骤。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US19/313,393 US20250387708A1 (en) | 2023-06-12 | 2025-08-28 | Exterior rendering |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310687751.4A CN116421970B (zh) | 2023-06-12 | 2023-06-12 | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 |
| CN202310687751.4 | 2023-06-12 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/313,393 Continuation US20250387708A1 (en) | 2023-06-12 | 2025-08-28 | Exterior rendering |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024255424A1 true WO2024255424A1 (zh) | 2024-12-19 |
Family
ID=87081797
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/087803 Ceased WO2024255424A1 (zh) | 2023-06-12 | 2024-04-15 | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20250387708A1 (zh) |
| CN (1) | CN116421970B (zh) |
| WO (1) | WO2024255424A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119963711A (zh) * | 2025-01-11 | 2025-05-09 | 杭州电子科技大学 | 一种基于隐式可微渲染的高质量半透明物体重建方法 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116421970B (zh) * | 2023-06-12 | 2023-12-05 | 腾讯科技(深圳)有限公司 | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110751714A (zh) * | 2019-10-18 | 2020-02-04 | 长春理工大学 | 三维场景渲染中基于对象判别的间接光照复用方法 |
| CN111899325A (zh) * | 2020-08-13 | 2020-11-06 | 网易(杭州)网络有限公司 | 晶石模型的渲染方法、装置、电子设备及存储介质 |
| CN112927341A (zh) * | 2021-04-02 | 2021-06-08 | 腾讯科技(深圳)有限公司 | 光照渲染方法、装置、计算机设备和存储介质 |
| CN113648652A (zh) * | 2021-08-20 | 2021-11-16 | 腾讯科技(深圳)有限公司 | 对象渲染方法和装置、存储介质及电子设备 |
| CN114155338A (zh) * | 2021-11-30 | 2022-03-08 | 北京达佳互联信息技术有限公司 | 图像渲染方法、装置及电子设备 |
| CN114307133A (zh) * | 2021-12-22 | 2022-04-12 | 网易(杭州)网络有限公司 | 一种游戏中的显示控制方法和装置 |
| CN115082608A (zh) * | 2022-05-26 | 2022-09-20 | 网易(杭州)网络有限公司 | 虚拟角色服装渲染方法、装置、电子设备和存储介质 |
| WO2022252924A1 (zh) * | 2021-05-31 | 2022-12-08 | 华为技术有限公司 | 图像传输与显示方法、相关设备及系统 |
| CN116421970A (zh) * | 2023-06-12 | 2023-07-14 | 腾讯科技(深圳)有限公司 | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7589723B2 (en) * | 2005-07-25 | 2009-09-15 | Microsoft Corporation | Real-time rendering of partially translucent objects |
| JP2007310682A (ja) * | 2006-05-18 | 2007-11-29 | Sega Corp | 透過オブジェクト描画方法 |
| KR20120078070A (ko) * | 2010-12-31 | 2012-07-10 | 삼성전자주식회사 | 영상 처리 장치 및 방법 |
| US9076247B2 (en) * | 2012-08-10 | 2015-07-07 | Ppg Industries Ohio, Inc. | System and method for visualizing an object in a simulated environment |
| CN110223589A (zh) * | 2019-05-17 | 2019-09-10 | 上海蜂雀网络科技有限公司 | 一种基于3d绘画协议的汽车模型展示方法 |
| CN111145330B (zh) * | 2019-12-31 | 2023-06-30 | 广州方硅信息技术有限公司 | 人体模型渲染方法、装置、电子设备及存储介质 |
| GB2605158B (en) * | 2021-03-24 | 2023-05-17 | Sony Interactive Entertainment Inc | Image rendering method and apparatus |
| CN115965727A (zh) * | 2021-10-13 | 2023-04-14 | 北京字节跳动网络技术有限公司 | 图像渲染方法、装置、设备及介质 |
| CN115738255A (zh) * | 2022-12-06 | 2023-03-07 | 网易(杭州)网络有限公司 | 抗锯齿渲染方法及装置、电子设备、存储介质 |
| CN115861522B (zh) * | 2023-03-02 | 2023-05-30 | 杭州片段网络科技有限公司 | 图像渲染方法及装置 |
-
2023
- 2023-06-12 CN CN202310687751.4A patent/CN116421970B/zh active Active
-
2024
- 2024-04-15 WO PCT/CN2024/087803 patent/WO2024255424A1/zh not_active Ceased
-
2025
- 2025-08-28 US US19/313,393 patent/US20250387708A1/en active Pending
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110751714A (zh) * | 2019-10-18 | 2020-02-04 | 长春理工大学 | 三维场景渲染中基于对象判别的间接光照复用方法 |
| CN111899325A (zh) * | 2020-08-13 | 2020-11-06 | 网易(杭州)网络有限公司 | 晶石模型的渲染方法、装置、电子设备及存储介质 |
| CN112927341A (zh) * | 2021-04-02 | 2021-06-08 | 腾讯科技(深圳)有限公司 | 光照渲染方法、装置、计算机设备和存储介质 |
| WO2022252924A1 (zh) * | 2021-05-31 | 2022-12-08 | 华为技术有限公司 | 图像传输与显示方法、相关设备及系统 |
| CN113648652A (zh) * | 2021-08-20 | 2021-11-16 | 腾讯科技(深圳)有限公司 | 对象渲染方法和装置、存储介质及电子设备 |
| CN114155338A (zh) * | 2021-11-30 | 2022-03-08 | 北京达佳互联信息技术有限公司 | 图像渲染方法、装置及电子设备 |
| CN114307133A (zh) * | 2021-12-22 | 2022-04-12 | 网易(杭州)网络有限公司 | 一种游戏中的显示控制方法和装置 |
| CN115082608A (zh) * | 2022-05-26 | 2022-09-20 | 网易(杭州)网络有限公司 | 虚拟角色服装渲染方法、装置、电子设备和存储介质 |
| CN116421970A (zh) * | 2023-06-12 | 2023-07-14 | 腾讯科技(深圳)有限公司 | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119963711A (zh) * | 2025-01-11 | 2025-05-09 | 杭州电子科技大学 | 一种基于隐式可微渲染的高质量半透明物体重建方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116421970A (zh) | 2023-07-14 |
| CN116421970B (zh) | 2023-12-05 |
| US20250387708A1 (en) | 2025-12-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Li et al. | Physically-based editing of indoor scene lighting from a single image | |
| US11694392B2 (en) | Environment synthesis for lighting an object | |
| WO2024255424A1 (zh) | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 | |
| US20180075658A1 (en) | Attribute detection tools for mixed reality | |
| CN114155335B (zh) | 三维模型的渲染方法、装置、电子设备和存储介质 | |
| CN107644453B (zh) | 一种基于物理着色的渲染方法及系统 | |
| Peddie | Ray tracing: a tool for all | |
| CN112396684A (zh) | 光线追踪方法、装置及机器可读存储介质 | |
| WO2023098358A1 (zh) | 一种模型渲染方法、装置、计算机设备及存储介质 | |
| US12354211B2 (en) | Ray tracing between AR and real objects | |
| CN117649478B (zh) | 模型训练方法、图像处理方法及电子设备 | |
| CN114307133B (zh) | 一种游戏中的显示控制方法和装置 | |
| CN114155338A (zh) | 图像渲染方法、装置及电子设备 | |
| CN116758208A (zh) | 全局光照渲染方法、装置、存储介质及电子设备 | |
| CN114299212B (zh) | 冰块模型渲染方法及装置 | |
| Nagashree et al. | Markerless augmented reality application for interior designing | |
| US20250252652A1 (en) | Neural shading of reflective surfaces | |
| HK40089293B (zh) | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 | |
| HK40089293A (zh) | 虚拟对象的外装渲染方法、装置、计算机设备和存储介质 | |
| WO2022042003A1 (zh) | 三维着色的方法、装置、计算设备和存储介质 | |
| Apodaca | Photosurrealism | |
| Elazab | Overlapping Shadow Rendering for Outdoor Augmented Reality | |
| CN117011438A (zh) | 头发渲染方法、装置、设备、存储介质和计算机程序产品 | |
| CN119850820B (zh) | 面向环境艺术设计的图像渲染方法、系统及设备 | |
| HK40098414A (zh) | 头发渲染方法、装置、设备、存储介质和计算机程序产品 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24822379 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |