CN111494945B - Virtual object processing method and device, storage medium and electronic equipment - Google Patents

Virtual object processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111494945B
CN111494945B CN202010322728.1A CN202010322728A CN111494945B CN 111494945 B CN111494945 B CN 111494945B CN 202010322728 A CN202010322728 A CN 202010322728A CN 111494945 B CN111494945 B CN 111494945B
Authority
CN
China
Prior art keywords
virtual object
normal direction
transparency
determining
included angle
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.)
Active
Application number
CN202010322728.1A
Other languages
Chinese (zh)
Other versions
CN111494945A (en
Inventor
张宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010322728.1A priority Critical patent/CN111494945B/en
Publication of CN111494945A publication Critical patent/CN111494945A/en
Application granted granted Critical
Publication of CN111494945B publication Critical patent/CN111494945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Geometry (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure provides a virtual object processing method, a virtual object processing device, a computer readable storage medium and electronic equipment, and relates to the technical field of image processing. The virtual object processing method comprises the following steps: acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches; determining the normal direction of each dough sheet; determining a reference normal direction of a scene where the first virtual object is located; and respectively calculating the included angles between the normal direction of each surface piece and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angles. The present disclosure may improve the sense of volume and realism of virtual objects.

Description

Virtual object processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technology, and in particular, to a virtual object processing method, a virtual object processing apparatus, a computer-readable storage medium, and an electronic device.
Background
In some games or animation works, virtual objects included in a scene need to be rendered, for example, a cloud model in a Virtual Reality (VR) game is rendered, so as to improve the Reality and rationality of the cloud model.
At present, when a cloud model in a VR game is rendered, the adopted technical scheme comprises the following steps: firstly, creating a plurality of facing camera surface patch particles, and then combining texture maps corresponding to cloud models in game scenes with the surface patch particles to obtain rendered cloud models. However, when the player rotates the angle of view, the face sheet facing the camera has a rotation effect in a direction perpendicular to the angle of view, which reduces the sense of realism of the cloud model and causes a problem of a flaky feel of the cloud model.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a virtual object processing method, a virtual object processing apparatus, a computer-readable storage medium, and an electronic device, which further overcome, at least to some extent, the problems of no sense of volume and poor sense of realism of a virtual object due to limitations and drawbacks of the related art.
According to a first aspect of the present disclosure, there is provided a virtual object processing method, including: acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches; determining the normal direction of each dough sheet; determining a reference normal direction of a scene where the first virtual object is located; and respectively calculating the included angles between the normal direction of each surface piece and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angles.
According to a second aspect of the present disclosure, there is provided a virtual object processing apparatus including: the object acquisition module is used for acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches; the surface patch normal determining module is used for determining the normal direction of each surface patch; the reference normal determining module is used for determining a reference normal direction of a scene where the first virtual object is located; and the transparency adjusting module is used for respectively calculating the included angles between the normal direction of each surface piece and the reference normal direction and adjusting the transparency of the corresponding surface piece according to the calculated included angles.
Alternatively, the transparency adjustment module may be configured to perform: normalizing the normal direction of each surface piece and the reference normal direction; and respectively calculating the included angles between the normal direction of each surface piece after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angles.
Optionally, the transparency adjustment module may be further configured to perform: respectively carrying out dot product operation on the normal direction of each surface piece after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface piece and the reference normal direction; and carrying out nonlinear fitting treatment on the calculated included angle through a preset power function, and determining the transparency of the surface patch corresponding to the calculated included angle.
Optionally, the transparency adjustment module may be further configured to perform: if the calculated included angle is larger than the included angle threshold value, adjusting the transparency of the corresponding dough sheet according to the calculated included angle; wherein, the transparency of the dough sheet and the included angle form a negative correlation.
Optionally, the virtual object processing apparatus further includes: the center coordinate determining module is used for determining the center coordinate of the first virtual object; the reference coordinate determining module is used for determining the reference position coordinates of the scene where the first virtual object is located; the distance calculation module is used for calculating the distance between the reference position coordinate and the center coordinate of the first virtual object; and the distance comparison module is used for adjusting the transparency of the first virtual object according to the distance if the distance is within the preset distance range.
Optionally, the scene where the first virtual object is located includes a second virtual object, and the virtual object processing apparatus further includes: the depth value comparison module is used for determining a first depth difference value between the first virtual object and the second virtual object if the pixel depth value of the second virtual object in the scene is smaller than the pixel depth value of the first virtual object; and the depth value adjusting module is used for adjusting the pixel depth value of the second virtual object based on the first depth difference value if the first virtual object and the second virtual object have an overlapping area so that the second virtual object covers the overlapping area.
Optionally, the virtual object processing apparatus further includes: the difference determination module may be configured to perform: if the first virtual object and the second virtual object have an overlapping area, determining a second depth difference value of the first virtual object and the second virtual object in the overlapping area; the contour determination module may be configured to perform: determining a contour line of the second virtual object in the overlapping area; the depth value generation module may be configured to perform: and adjusting the pixel depth value of the second virtual object according to the contour line and the second depth difference value so that the second virtual object covers the overlapping area.
Optionally, the first virtual object includes a surface color feature of the first virtual object, and the virtual object processing apparatus further includes: the information acquisition module may be configured to perform: acquiring illumination information; the intensity determination module may be configured to perform: determining the illumination influence intensity of the first virtual object; a color adjustment module may be configured to perform: and adjusting the surface color characteristics of the first virtual object according to the illumination information and the illumination influence intensity so as to obtain an adjusted first virtual object.
Optionally, before the first virtual object is acquired, the virtual object processing apparatus further includes: the map acquisition module may be configured to perform: obtaining a mapping corresponding to a first virtual object; the model construction module may be configured to perform: constructing a three-dimensional model using a plurality of intersecting patches; the object determination module may be configured to perform: a first virtual object is determined based on the map and the three-dimensional model.
Optionally, the model of the first virtual object is a virtual model for simulating cloud fog.
Optionally, the virtual object processing apparatus is applied to a virtual reality game.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the virtual object processing method as described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; and a storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the virtual object processing method as described above.
Exemplary embodiments of the present disclosure have the following advantageous effects:
In the technical solutions provided in some embodiments of the present disclosure, first, a first virtual object is acquired, where the first virtual object includes a plurality of patches that intersect with each other; then, determining the normal direction of each dough sheet; then, determining a reference normal direction of a scene where the first virtual object is located; and then, respectively calculating the included angle between the normal direction of each surface piece and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angle. On the one hand, in the present disclosure, the first virtual object includes a plurality of intersecting patches, and the transparency of the corresponding patches is adjusted according to the calculated included angle, so that the problem of penetration between objects in the rendering scene is avoided, the volume sense of the virtual object is improved, and the rendering effect is more realistic. On one hand, the transparency of the corresponding dough sheet is adjusted according to the calculated included angle, so that the transparency adjusting process of the first virtual object is simpler, and the resource consumption is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort. In the drawings:
FIG. 1 schematically illustrates a flow chart of a virtual object processing method according to an exemplary embodiment of the present disclosure;
FIG. 2 schematically illustrates a schematic diagram of a process of determining virtual objects according to an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of a game play effect according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a rendering effect schematic before and after adjusting transparency of a virtual object according to an exemplary embodiment of the present disclosure;
FIG. 5 schematically illustrates an effect schematic before and after a two virtual object interspersed fusion rendering according to an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of a virtual object processing apparatus according to an exemplary embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of a virtual object processing apparatus according to another exemplary embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of a virtual object processing apparatus according to another exemplary embodiment of the present disclosure;
fig. 9 schematically shows a block diagram of an electronic device in an exemplary embodiment according to the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. However, those skilled in the art will recognize that the aspects of the present disclosure may be practiced with one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
In this disclosure, the terms "comprising," "including," and "containing" are used to indicate an open-ended meaning and are intended to mean that additional elements/components/etc. may be present in addition to the listed elements/components/etc. In addition, the terms "first," "second," and "first," "second," are used herein for distinguishing purposes only, and should not be taken as a limitation of the present disclosure.
The flow diagrams depicted in the figures are exemplary only and not necessarily all steps are included. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
With the development and popularization of game entertainment devices, players have increasingly demanded reality and immersion of game scenes. For example, cloud models are rendered in VR game scenes to create immersion for players.
At present, under the condition of rendering a cloud model in a VR game, the adopted technical scheme comprises two types: the first technical solution adopts a ray stepping+noise technology (RAY MARCHING +noise) to perform texture volume rendering processing on the cloud model, but the technical solution can generate high consumption. The second technical scheme comprises the following steps: firstly, creating a plurality of facing camera surface patch particles, and then combining texture maps corresponding to cloud models in game scenes with the surface patch particles to obtain rendered cloud models. However, when the player rotates the view angle in the left-right direction, the face sheet facing the camera has a rotation effect in the direction perpendicular to the view angle, which reduces the sense of realism of the cloud model and causes a problem that the cloud model has no sense of volume.
In response to the problem, the present disclosure proposes a virtual object processing method.
It should be noted that, in the exemplary embodiments of the present disclosure, the virtual object processing method described below may be generally implemented by a server, that is, each step of the virtual object processing method may be performed by a server, in which case the virtual object processing apparatus may be configured in the server.
In addition, the virtual object processing method may be implemented by a terminal device (e.g., a cellular phone, a tablet, a personal computer, etc.), that is, the respective steps of the virtual object processing method may be performed by the terminal device, in which case the virtual object processing apparatus may be configured in the terminal device.
Hereinafter, each step of the virtual object processing method in the present exemplary embodiment will be described in more detail with reference to the accompanying drawings and examples.
Fig. 1 schematically illustrates a flowchart of a virtual object processing method of an exemplary embodiment of the present disclosure. In the following description, an example is described in which a server is an execution subject. Referring to fig. 1, the virtual object processing method may specifically include the steps of:
S102, acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches.
In an exemplary embodiment of the present disclosure, the first virtual object may be, but is not limited to, various objects simulating real clouds, fog, dust, etc. in a virtual scene, and a model of the first virtual object may be used to simulate a virtual model of the cloud fog.
The number of patches included in the first virtual object may be, but is not limited to, obtained according to the size of the three-dimensional model and the preset consumption number; the number of patches may also be adjusted during construction of the three-dimensional model according to the rendering effect of the game scene.
Before the server obtains the first virtual object, according to an exemplary embodiment of the present disclosure, the server may first obtain a map corresponding to the first virtual object; then, constructing a three-dimensional model by using a plurality of mutually intersected patches; then, a first virtual object is determined based on the map and the three-dimensional model.
The map may be a picture containing the object that the first virtual object needs to simulate.
Taking fig. 2 as an example, the server first obtains a map 201 of the cloud, then constructs a three-dimensional model 203 using two crisscross patches, and then combines the map 201 of the cloud and the three-dimensional model 203 to determine a virtual object: cloud 205.
S104, determining the normal direction of each patch.
In an exemplary embodiment of the present disclosure, the normal line of the panel may refer to a straight line passing through the center position of the panel and perpendicular to the panel, and the normal line direction may be the direction in which the panel is outward.
After the server acquires the first virtual object, a straight line passing through the center position of the patch and perpendicular to the patch may be determined as a normal line of the patch, and an outward direction of the straight line vertical patch may be determined as a normal line direction.
The server may set a direction passing through the center of the patch and oriented vertically to the patch as a normal direction.
S106, determining a reference normal direction of a scene where the first virtual object is located.
The scene where the first virtual object is located is a three-dimensional virtual scene, for example, may be a virtual game scene or a virtual animation scene. A scenario in which the first virtual object may be constructed may be regarded as a scenario protected by the present disclosure.
The reference normal line of the scene may be any line of sight for observing the outer periphery of the first virtual object, and the reference normal line direction may be a direction along any line of sight toward the first virtual object. The reference normal direction may also be referred to as the viewing angle direction. The reference normal direction may be the same as or opposite to the normal direction of the patch.
S108, respectively calculating the included angles between the normal direction of each surface piece and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angles.
In exemplary embodiments of the present disclosure, the transparency of a dough sheet may refer to the degree to which the dough sheet is visible. When the transparency of the dough sheet is 1, it may indicate that the dough sheet is completely visible; when the transparency of the dough sheet is 0, it may indicate that the dough sheet is completely invisible; when the transparency of the dough sheet is a number between 0 and 1, the transparency degree of the dough sheet can be expressed.
After determining the normal direction of each patch and the reference normal direction of the scene where the first virtual object is located, the server may perform normalization processing on the normal direction of each patch and the reference normal direction of the scene where the first virtual object is located first, and then calculate the included angle between the normal direction of each patch and the reference normal direction after the normalization processing.
It should be noted that, the value of the included angle between the normal direction of each of the patches and the reference normal direction after normalization processing may be any value between 0 and 1.
According to the method and the device, the included angle between the normal direction of each surface patch and the reference normal direction is calculated, and the transparency of the corresponding surface patch is adjusted according to the calculated included angle, so that the problems of obvious interpenetration between objects and flaky sensation of the objects in a rendering scene are avoided, the volume sensation of the virtual object is improved, and the rendering effect is enabled to have more realism.
In an exemplary embodiment of the present disclosure, the virtual object processing method may be applied to a virtual reality game. Fig. 3 illustrates a game running effect after running the virtual object processing method in the virtual reality game.
And after calculating the included angles between the normal direction of each surface piece and the reference normal direction after normalization processing, the server compares the calculated included angles with an included angle threshold value. And if the calculated included angle is larger than the included angle threshold value, adjusting the transparency of the corresponding dough sheet according to the calculated included angle.
Wherein, the transparency of the dough sheet and the included angle form a negative correlation, namely, the larger the angle is, the lower the transparency of the dough sheet is.
Referring to fig. 4, the left side of the arrow indicates that the angle between the normal direction of a panel in the virtual object and the reference normal direction is 90, the transparency is low, and the flaky effect is generated. The right side of the arrow shows the rendering effect that the transparency of each patch of the virtual object becomes high after the angle is adjusted, and the virtual object has no flaky feel.
According to the method and the device, the calculated included angle is used for adjusting the transparency of the corresponding dough piece, and the included angle threshold value is set, so that the range of the included angle is more accurate, the transparency adjusting process of the first virtual object is further simpler, and the resource consumption is reduced.
According to an exemplary embodiment of the disclosure, the server may also perform dot product operation on the normal direction of each patch after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each patch and the reference normal direction, and then perform nonlinear fitting processing on the calculated included angle through a preset power function to determine transparency of the patch corresponding to the calculated included angle.
According to another exemplary embodiment of the present disclosure, the server determines center coordinates of the first virtual object; determining reference position coordinates of a scene where the first virtual object is located; calculating a distance between the reference position coordinates and the center coordinates of the first virtual object; and if the distance is within the preset distance range, adjusting the transparency of the first virtual object according to the distance.
The center coordinates of the first virtual object may be center position coordinates of a plurality of intersecting patches included in the first virtual object. The reference position coordinates of the scene in which the first virtual object is located may be position coordinates for viewing the first virtual object. The preset distance range may be a distance determined according to a position coordinate corresponding to a completely visible condition of the transparency of the first virtual object and a position coordinate corresponding to a completely invisible condition of the transparency of the first virtual object.
The server may compare whether the distance between the reference position coordinate and the center coordinate of the first virtual object is within a preset distance range after calculating the distance between the reference position coordinate and the center coordinate of the first virtual object, and if the result is that the distance between the reference position coordinate and the center coordinate of the first virtual object is within the preset distance range, the server may adjust the transparency of the first virtual object according to the distance between the reference position coordinate and the center coordinate of the first virtual object.
It should be noted that, when the distance between the reference position coordinate and the center coordinate of the first virtual object falls within the preset distance range, the distance between the reference position coordinate and the center coordinate of the first virtual object has a positive correlation with the transparency of the first virtual object. For example, in a case where the distance between the reference position coordinate and the center coordinate of the first virtual object falls within a preset distance range, the smaller the distance between the reference position coordinate and the center coordinate of the first virtual object, the smaller the transparency of the first virtual object until the first virtual object is invisible. Conversely, the greater the distance between the reference position coordinates and the center coordinates of the first virtual object, the greater the transparency of the first virtual object until the first virtual object is fully visible.
According to the method and the device for adjusting the transparency of the first virtual object, the transparency of the first virtual object is adjusted according to the distance between the reference position coordinate and the center coordinate of the first virtual object within the preset distance range, so that the transparency of the first virtual object is adjusted more flexibly, and the display process of the transparency of the virtual object is facilitated for workers to understand.
According to an exemplary embodiment of the present disclosure, a scene in which a first virtual object is located includes a second virtual object, and if a pixel depth value of the second virtual object in the scene is smaller than a pixel depth value of the first virtual object, the server may determine a first depth difference value between the first virtual object and the second virtual object; and if the first virtual object and the second virtual object have an overlapping area, adjusting the pixel depth value of the second virtual object based on the first depth difference value so that the second virtual object covers the overlapping area.
The second virtual object may be, for example, a mountain, a tree, etc. in the virtual game scene. The first depth difference value may refer to a portion of the first virtual object having a pixel depth value that is greater than a pixel depth value of the second virtual object. The overlapping region may refer to a region in which the first virtual object is displayed in the second virtual object. The first depth difference value may be greater than a pixel depth value of the overlap region.
It should be noted that, the server may also increase the pixel depth value of the second virtual object to infinity so as to completely cover the overlapping area of the first virtual object and the second virtual object.
After determining the first depth difference, the server may increase the first depth difference to the pixel depth value of the second virtual object, to obtain the adjusted pixel depth value of the second virtual object, so as to completely cover the overlapping area of the first virtual object and the second virtual object.
According to an exemplary embodiment of the present disclosure, if there is an overlapping region between the first virtual object and the second virtual object, the server may determine a second depth difference value between the first virtual object and the second virtual object in the overlapping region; determining a contour line of the second virtual object in the overlapping area; and adjusting the pixel depth value of the second virtual object according to the contour line and the second depth difference value so that the second virtual object covers the overlapping area.
The second depth difference value may be a pixel depth value of an area where the first virtual object is displayed in the second virtual object model, that is, a pixel depth value of an overlapping area between the first virtual object and the second virtual object.
According to the method and the device, the pixel depth value of the second virtual object is regulated, so that the second virtual object covers the overlapping area, the obvious problem of interpenetration between the first virtual object and the second virtual object is reduced, and the rendering effect of the virtual scene is improved.
Fig. 5 illustrates the effect of the two virtual objects in the virtual scene before and after the interpenetration and fusion rendering, wherein the first virtual object 502 and the second virtual object 504 interpenetrate each other with an overlapping region therebetween.
The left side of the arrow illustrates that the overlapping area of the first virtual object 502 and the second virtual object 504 shows a distinct interpenetration rendering effect and has a flaky feel before adjusting the pixel depth value of the second virtual object 504. The right side of the arrow illustrates that after the pixel depth value of the second virtual object 504 is adjusted, the overlapping area of the first virtual object 502 and the second virtual object 504 overcomes the problem of obvious interpenetration, and improves the interpenetration fusion rendering effect of the two virtual objects in the virtual scene.
According to an exemplary embodiment of the present disclosure, a first virtual object includes a surface color feature of the first virtual object, and a server may first acquire illumination information; then, determining the illumination influence intensity of the first virtual object; and then, adjusting the surface color characteristics of the first virtual object according to the illumination information and the illumination influence intensity so as to obtain an adjusted first virtual object.
Wherein the surface color feature of the first virtual object may refer to a color feature overlaid on the surface of the first virtual object. The illumination information may refer to color information of a surface color feature overlaid on the first virtual object, and the illumination information may be, for example, illumination of a yellow color, for example, illumination of a red color.
The illumination influence intensity may be represented by a value of 0-1. 0 may indicate that the surface color features of the first virtual object are unaffected by the illumination; 1 can represent that the surface color characteristics of the first virtual object are affected by illumination and have high intensity; a value between 0 and 1 may represent an intensity value of the surface color feature of the first virtual object affected by the illumination. In addition, 1 may also indicate that the surface color characteristics of the first virtual object are not affected by the illumination; 0 may also indicate that the surface color features of the first virtual object are affected by the illumination and are intense.
It should be noted that although the steps of the methods in the present disclosure are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Further, in an exemplary embodiment of the present disclosure, a virtual object processing apparatus is also provided.
Fig. 6 schematically illustrates a block diagram of a virtual object processing apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 6, a virtual object processing apparatus 600 according to an exemplary embodiment of the present disclosure may include: an object acquisition module 601, a patch normal determination module 603, a reference normal determination module 605, and a transparency adjustment module 607.
The object obtaining module 601 is configured to obtain a first virtual object, where the first virtual object includes a plurality of patches that intersect with each other; a patch normal determination module 603, configured to determine a normal direction of each patch; the reference normal determining module 605 is configured to determine a reference normal direction of a scene where the first virtual object is located; the transparency adjustment module 607 is configured to calculate an included angle between the normal direction of each patch and the reference normal direction, and adjust the transparency of the corresponding patch according to the calculated included angle.
According to another embodiment of the present disclosure, transparency adjustment module 607 may be configured to perform: normalizing the normal direction of each surface piece and the reference normal direction; and respectively calculating the included angles between the normal direction of each surface piece after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angles.
According to another embodiment of the present disclosure, transparency adjustment module 607 may be further configured to perform: respectively carrying out dot product operation on the normal direction of each surface piece after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface piece and the reference normal direction; and carrying out nonlinear fitting treatment on the calculated included angle through a preset power function, and determining the transparency of the surface patch corresponding to the calculated included angle.
According to another embodiment of the present disclosure, transparency adjustment module 607 may be further configured to perform: if the calculated included angle is larger than the included angle threshold value, adjusting the transparency of the corresponding dough sheet according to the calculated included angle; wherein, the transparency of the dough sheet and the included angle form a negative correlation.
According to another embodiment of the present disclosure, referring to fig. 7, in comparison to the virtual object processing apparatus 600, the virtual object processing apparatus 700 further includes: a center coordinate determination module 702, a reference coordinate determination module 704, a distance calculation module 706, and a distance comparison module 708.
Wherein, the center coordinate determining module 702 is configured to determine a center coordinate of the first virtual object; a reference coordinate determining module 704, configured to determine a reference position coordinate of a scene where the first virtual object is located; a distance calculation module 706, configured to calculate a distance between the reference position coordinate and the center coordinate of the first virtual object; the distance comparing module 708 is configured to adjust the transparency of the first virtual object according to the distance if the distance is within the preset distance range.
According to another embodiment of the present disclosure, referring to fig. 8, compared to the virtual object processing apparatus 600, the first virtual object is located in a scene including a second virtual object, and the virtual object processing apparatus 800 further includes: a depth value comparison module 801 and a depth value adjustment module 803.
The depth value comparison module 801 is configured to determine a first depth difference between the first virtual object and the second virtual object if a pixel depth value of the second virtual object in the scene is smaller than a pixel depth value of the first virtual object; the depth value adjusting module 803 is configured to adjust, if there is an overlapping area between the first virtual object and the second virtual object, a pixel depth value of the second virtual object based on the first depth difference value, so that the second virtual object covers the overlapping area.
According to another embodiment of the present disclosure, the virtual object processing apparatus 800 further includes: the difference determination module may be configured to perform: if the first virtual object and the second virtual object have an overlapping area, determining a second depth difference value of the first virtual object and the second virtual object in the overlapping area; the contour determination module may be configured to perform: determining a contour line of the second virtual object in the overlapping area; the depth value generation module may be configured to perform: and adjusting the pixel depth value of the second virtual object according to the contour line and the second depth difference value so that the second virtual object covers the overlapping area.
According to another embodiment of the present disclosure, the first virtual object includes a surface color feature of the first virtual object, and the virtual object processing apparatus 600 further includes: the information acquisition module may be configured to perform: acquiring illumination information; the intensity determination module may be configured to perform: determining the illumination influence intensity of the first virtual object; a color adjustment module may be configured to perform: and adjusting the surface color characteristics of the first virtual object according to the illumination information and the illumination influence intensity so as to obtain an adjusted first virtual object.
According to another embodiment of the present disclosure, before the first virtual object is acquired, the virtual object processing apparatus 600 further includes: the map acquisition module may be configured to perform: obtaining a mapping corresponding to a first virtual object; the model construction module may be configured to perform: constructing a three-dimensional model using a plurality of intersecting patches; the object determination module may be configured to perform: a first virtual object is determined based on the map and the three-dimensional model.
According to another embodiment of the present disclosure, the model of the first virtual object is a virtual model for simulating cloud fog.
According to another embodiment of the present disclosure, a virtual object processing apparatus is applied to a virtual reality game.
The specific details of the modules/units in the above apparatus are already described in the embodiments of the method section, and thus are not repeated.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible embodiments, the aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the "exemplary method" section of this specification, when the program product is run on the terminal device.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
Those skilled in the art will appreciate that the various aspects of the invention may be implemented as a system, method, or program product. Accordingly, aspects of the invention may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to such an embodiment of the invention is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting the different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
Wherein the storage unit stores program code that is executable by the processing unit 910 such that the processing unit 910 performs steps according to various exemplary embodiments of the present invention described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 910 may perform steps S102 to S108 shown in fig. 1.
The storage unit 920 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 9201 and/or cache memory 9202, and may further include Read Only Memory (ROM) 9203.
The storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus 930 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to communicate with the electronic device 900, and/or any devices (e.g., routers, modems, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 950. Also, electronic device 900 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 over the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 900, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Furthermore, the above-described drawings are only schematic illustrations of processes included in the method according to the exemplary embodiment of the present invention, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (13)

1. A virtual object processing method, comprising:
Acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches;
determining the normal direction of each dough sheet;
determining a reference normal direction of a scene where the first virtual object is located; wherein the reference normal direction is a viewing angle direction, which is a direction along any line of sight toward the first virtual object;
respectively calculating an included angle between the normal direction of each surface piece and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angle;
Wherein, the transparency of the dough sheet and the included angle form a negative correlation;
wherein, still include:
determining a center coordinate of the first virtual object;
Determining reference position coordinates of a scene where the first virtual object is located; wherein the reference position coordinates are position coordinates for observing the first virtual object;
calculating a distance between the reference position coordinate and a center coordinate of the first virtual object;
if the distance is within a preset distance range, adjusting the transparency of the first virtual object according to the distance; and the distance and the transparency of the first virtual object are in positive correlation.
2. The virtual object processing method according to claim 1, wherein calculating an angle between a normal direction of each of the patches and the reference normal direction, respectively, and adjusting transparency of the corresponding patch according to the calculated angle comprises:
normalizing the normal direction of each dough sheet and the reference normal direction;
And respectively calculating the included angle between the normal direction of each surface piece after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface piece according to the calculated included angle.
3. The virtual object processing method according to claim 2, wherein calculating an angle between the normal direction of each of the patches after normalization processing and the reference normal direction, respectively, and adjusting the transparency of the corresponding patch according to the calculated angle comprises:
respectively carrying out dot product operation on the normal direction of each surface piece after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface piece and the reference normal direction;
And carrying out nonlinear fitting treatment on the calculated included angle through a preset power function, and determining the transparency of the surface patch corresponding to the calculated included angle.
4. The virtual object processing method according to claim 1 or 2, wherein adjusting the transparency of the corresponding patch according to the calculated included angle comprises:
And if the calculated included angle is larger than the included angle threshold value, adjusting the transparency of the corresponding dough sheet according to the calculated included angle.
5. A virtual object handling method according to any of claims 1 to 3, wherein the scene in which the first virtual object is located comprises a second virtual object, the virtual object handling method further comprising:
if the pixel depth value of the second virtual object in the scene is smaller than that of the first virtual object, determining a first depth difference value between the first virtual object and the second virtual object;
And if the first virtual object and the second virtual object have an overlapping area, adjusting the pixel depth value of the second virtual object based on the first depth difference value so that the second virtual object covers the overlapping area.
6. The virtual object processing method of claim 5, wherein the virtual object processing method further comprises:
If the first virtual object and the second virtual object have an overlapping area, determining a second depth difference value of the first virtual object and the second virtual object in the overlapping area;
Determining a contour line of the second virtual object in the overlapping area;
And adjusting the pixel depth value of the second virtual object according to the contour line and the second depth difference value so that the second virtual object covers the overlapping area.
7. A virtual object handling method according to any of claims 1 to 3, the first virtual object comprising a surface colour characteristic of the first virtual object, the virtual object handling method further comprising:
Acquiring illumination information;
Determining an illumination impact intensity of the first virtual object;
and adjusting the surface color characteristics of the first virtual object according to the illumination information and the illumination influence intensity so as to obtain the adjusted first virtual object.
8. A virtual object handling method according to any of claims 1 to 3, wherein prior to acquiring the first virtual object, the virtual object handling method further comprises:
Obtaining a mapping corresponding to a first virtual object;
Constructing a three-dimensional model using the plurality of interdigitated patches;
A first virtual object is determined based on the map and the three-dimensional model.
9. The virtual object processing method according to claim 1, wherein the model of the first virtual object is a virtual model for simulating cloud fog.
10. The virtual object processing method according to claim 1, wherein the virtual object processing method is applied to a virtual reality game.
11. A virtual object processing apparatus, comprising:
The object acquisition module is used for acquiring a first virtual object, wherein the first virtual object comprises a plurality of intersecting patches;
The surface patch normal determining module is used for determining the normal direction of each surface patch;
the reference normal determining module is used for determining a reference normal direction of a scene where the first virtual object is located; wherein the reference normal direction is a viewing angle direction, which is a direction along any line of sight toward the first virtual object;
The transparency adjusting module is used for respectively calculating the included angle between the normal direction of each dough piece and the reference normal direction and adjusting the transparency of the corresponding dough piece according to the calculated included angle;
Wherein, the transparency of the dough sheet and the included angle form a negative correlation;
Wherein the device is further for:
determining a center coordinate of the first virtual object;
Determining reference position coordinates of a scene where the first virtual object is located; wherein the reference position coordinates are position coordinates for observing the first virtual object;
calculating a distance between the reference position coordinate and a center coordinate of the first virtual object;
if the distance is within a preset distance range, adjusting the transparency of the first virtual object according to the distance; and the distance and the transparency of the first virtual object are in positive correlation.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the virtual object processing method according to any one of claims 1 to 10.
13. An electronic device, comprising:
One or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the virtual object handling method of any of claims 1 to 10.
CN202010322728.1A 2020-04-22 2020-04-22 Virtual object processing method and device, storage medium and electronic equipment Active CN111494945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010322728.1A CN111494945B (en) 2020-04-22 2020-04-22 Virtual object processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010322728.1A CN111494945B (en) 2020-04-22 2020-04-22 Virtual object processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111494945A CN111494945A (en) 2020-08-07
CN111494945B true CN111494945B (en) 2024-04-26

Family

ID=71848344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010322728.1A Active CN111494945B (en) 2020-04-22 2020-04-22 Virtual object processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111494945B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112099638B (en) * 2020-10-19 2024-02-06 瑞立视多媒体科技(北京)有限公司 Information processing method and device in virtual reality scene and computer equipment
CN114612602A (en) * 2020-12-08 2022-06-10 上海米哈游天命科技有限公司 Method and device for determining transparency, electronic equipment and storage medium
CN113298909B (en) * 2021-04-13 2023-07-25 网易(杭州)网络有限公司 Virtual road generation method, device, storage medium and processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN107918949A (en) * 2017-12-11 2018-04-17 网易(杭州)网络有限公司 Rendering intent, storage medium, processor and the terminal of virtual resource object
CN109685869A (en) * 2018-12-25 2019-04-26 网易(杭州)网络有限公司 Dummy model rendering method and device, storage medium, electronic equipment
CN110084879A (en) * 2019-04-28 2019-08-02 网易(杭州)网络有限公司 Object processing method, device, medium and electronic equipment in virtual scene

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN107918949A (en) * 2017-12-11 2018-04-17 网易(杭州)网络有限公司 Rendering intent, storage medium, processor and the terminal of virtual resource object
CN109685869A (en) * 2018-12-25 2019-04-26 网易(杭州)网络有限公司 Dummy model rendering method and device, storage medium, electronic equipment
CN110084879A (en) * 2019-04-28 2019-08-02 网易(杭州)网络有限公司 Object processing method, device, medium and electronic equipment in virtual scene

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄心渊.《计算机三维动画基础》.中国铁道出版社,2011,第104-106页. *

Also Published As

Publication number Publication date
CN111494945A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
CN111494945B (en) Virtual object processing method and device, storage medium and electronic equipment
Wanger et al. Perceiving spatial relationships in computer-generated images
US20170186219A1 (en) Method for 360-degree panoramic display, display module and mobile terminal
CN111815755A (en) Method and device for determining shielded area of virtual object and terminal equipment
US10573060B1 (en) Controller binding in virtual domes
CN109985384B (en) Method and device for dynamically adjusting map
JP2020537201A (en) Shadow generation for inserted image content
CN112184873B (en) Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium
US20230290043A1 (en) Picture generation method and apparatus, device, and medium
CN112766027A (en) Image processing method, device, equipment and storage medium
US10740957B1 (en) Dynamic split screen
CN112657176A (en) Binocular projection man-machine interaction method combined with portrait behavior information
CN114863014B (en) Fusion display method and device for three-dimensional model
CN112734896A (en) Environment shielding rendering method and device, storage medium and electronic equipment
CN115187729A (en) Three-dimensional model generation method, device, equipment and storage medium
CN108031117B (en) Regional fog effect implementation method and device
US20230260218A1 (en) Method and apparatus for presenting object annotation information, electronic device, and storage medium
US20190035134A1 (en) Image processing methods and devices
CN115965735B (en) Texture map generation method and device
CN111460937B (en) Facial feature point positioning method and device, terminal equipment and storage medium
CN108986228B (en) Method and device for displaying interface in virtual reality
CN115619986B (en) Scene roaming method, device, equipment and medium
CN113223137B (en) Generation method and device of perspective projection human face point cloud image and electronic equipment
CN114693780A (en) Image processing method, device, equipment, storage medium and program product
WO2018201663A1 (en) Solid figure display method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant