CN111494945A - 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
CN111494945A
CN111494945A CN202010322728.1A CN202010322728A CN111494945A CN 111494945 A CN111494945 A CN 111494945A CN 202010322728 A CN202010322728 A CN 202010322728A CN 111494945 A CN111494945 A CN 111494945A
Authority
CN
China
Prior art keywords
virtual object
normal direction
patch
included angle
transparency
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.)
Granted
Application number
CN202010322728.1A
Other languages
Chinese (zh)
Other versions
CN111494945B (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

Images

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)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (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 an electronic device, 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 patches which are mutually crossed; determining the normal direction of each patch; determining a reference normal direction of a scene where a first virtual object is located; and respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle. The present disclosure can improve the sense of volume and reality of a virtual object.

Description

Virtual object processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, 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 Reality and reasonableness of the cloud model.
At present, when a process of rendering a cloud model in a VR game is performed, an adopted technical scheme includes: firstly, creating a plurality of patch particles facing a camera, and then combining texture maps corresponding to cloud models in a game scene with the patch particles to obtain rendered cloud models. However, when the player rotates the angle of view, the patch facing the camera generates a rotating effect in a direction perpendicular to the angle of view, reducing the reality of the cloud model, and causing a problem of the cloud model sheet-like feeling.
It is to be noted that the information disclosed in the above background section is only for enhancement of 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, thereby overcoming, at least to some extent, the problems of no volume and poor reality of a virtual object due to limitations and disadvantages 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 patches which are mutually crossed; determining the normal direction of each patch; determining a reference normal direction of a scene where a first virtual object is located; and respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
According to a second aspect of the present disclosure, there is provided a virtual object processing apparatus comprising: the object acquisition module is used for acquiring a first virtual object, and the first virtual object comprises a plurality of mutually crossed patches; the normal determining module of the surface patch is used for determining the normal direction of each surface patch; the reference normal determining module is used for determining the reference normal direction of a scene where the first virtual object is located; and the transparency adjusting module is used for respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
Optionally, the transparency adjustment module may be configured to perform: normalizing the normal direction of each surface patch and the reference normal direction; and respectively calculating an included angle between the normal direction of each surface patch after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
Optionally, the transparency adjustment module may be further configured to perform: respectively carrying out dot product operation on the normal direction of each surface patch after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface patch and the reference normal direction; and carrying out nonlinear fitting processing on the calculated included angle through a preset power function, and determining the transparency of the 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, the transparency of the corresponding surface patch is adjusted according to the calculated included angle; wherein, the transparency of the surface patch and the included angle are in a negative correlation relationship.
Optionally, the virtual object processing apparatus further includes: a central coordinate determination module for determining a central coordinate of the first virtual object; the reference coordinate determination module is used for determining the reference position coordinates of the scene where the first virtual object is located; a distance calculation module for calculating a distance between the reference position coordinates and the center coordinates 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 belongs to the preset distance range.
Optionally, the scene in which the first virtual object is located includes a second virtual object, and the virtual object processing apparatus further includes: a depth value comparison module, configured to determine a first depth difference value 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; 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: a 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; an outline determination module may be configured to perform: determining a contour line of the second virtual object in the overlapping area; a 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 surface color features of the first virtual object, and the virtual object processing apparatus further includes: an information acquisition module that may be configured to perform: acquiring illumination information; an intensity determination module may be configured to perform: determining an illumination impact intensity of the first virtual object; a color adjustment module 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 the adjusted first virtual object.
Optionally, before acquiring the first virtual object, the virtual object processing apparatus further includes: a map acquisition module that may be configured to perform: obtaining a map corresponding to the first virtual object; a model construction module that may be configured to perform: constructing a three-dimensional model by utilizing a plurality of mutually crossed patches; an 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 means 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; a storage device for storing one or more programs which, when executed by 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 obtained, where the first virtual object includes a plurality of patches that are intersected with each other; then, determining the normal direction of each surface patch; then, determining the reference normal direction of the scene where the first virtual object is located; and then, respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle. On the one hand, in the present disclosure, the first virtual object includes a plurality of patches that are intersected with each other, and the transparency of the corresponding patch is adjusted according to the calculated included angle, so that the problems of obvious interpenetration and flaky object feeling between objects in a rendering scene are avoided, the volume feeling of the virtual object is improved, and the rendering effect is more realistic. On one hand, the transparency of the corresponding patch 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 present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. 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 a virtual object, according to an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic view of a game play effect according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a rendering effect diagram before and after adjusting the transparency of a virtual object, according to an exemplary embodiment of the present disclosure;
FIG. 5 schematically illustrates an effect diagram before and after two virtual objects interpenetrate 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. Example embodiments may, however, be embodied in many different 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 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 disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. 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 their repetitive description 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 the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the present disclosure, the terms "comprises" and "comprising" are used in an open-ended fashion, and mean that there may be additional elements/components/etc. in addition to the listed elements/components/etc. In addition, the terms "first" and "second" used in the present disclosure are for the purpose of distinction only and should not be construed as a limitation of the present disclosure.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
With the development and popularity of game entertainment devices, players have increasingly demanding requirements for realism and immersion in game scenes. For example, the cloud model is rendered in a VR game scene to create an immersive sensation for the player.
At present, under the condition of rendering a cloud model in a VR game, the adopted technical scheme includes two types: the first technical solution performs texture volume rendering processing on the cloud model by using a ray stepping + NOISE technique (RAY MARCHING + NOISE), but the technical solution generates high consumption. The second technical scheme comprises the following steps: firstly, creating a plurality of patch particles facing a camera, and then combining texture maps corresponding to cloud models in a game scene with the patch particles to obtain rendered cloud models. However, in the case where the player rotates the angle of view left and right, the patch facing the camera may generate a rotating effect in a direction perpendicular to the angle of view, reducing the reality of the cloud model, and causing a problem that the cloud model is not voluminous.
To address this problem, the present disclosure proposes a virtual object processing method.
It should be noted that, in the exemplary embodiment of the present disclosure, the virtual object processing method described below may be generally implemented by a server, that is, the steps of the virtual object processing method may be executed by the 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 mobile phone, a tablet, a personal computer, etc.), that is, the respective steps of the virtual object processing method may be executed 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 drawings and examples.
Fig. 1 schematically shows a flowchart of a virtual object processing method of an exemplary embodiment of the present disclosure. In the following description, a server is used as an execution subject. Referring to fig. 1, the virtual object processing method may specifically include the steps of:
s102, obtaining a first virtual object, wherein the first virtual object comprises a plurality of mutually crossed 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, flying dust, etc. in a virtual scene, and a model of the first virtual object may be used to simulate a virtual model of cloud fog.
The number of patches included in the first virtual object may be, but is not limited to, derived from the size of the three-dimensional model and a 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 acquires the first virtual object, according to an exemplary embodiment of the present disclosure, the server may first acquire a map corresponding to the first virtual object; then, constructing a three-dimensional model by utilizing a plurality of mutually crossed surface patches; subsequently, 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 cloud map 201, then constructs a three-dimensional model 203 by using two patch crosses, and then combines the cloud map 201 and the three-dimensional model 203 to determine a virtual object: cloud 205.
And S104, determining the normal direction of each patch.
In an exemplary embodiment of the present disclosure, a normal of a patch may refer to a straight line passing through a center position of the patch and perpendicular to the patch, and a normal direction may be a direction outward of the perpendicular patch.
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 of the patch, and a direction of the straight line perpendicular to the patch and outward may be determined as a normal direction.
The server may use a direction passing through the center position of the patch and vertically facing the patch as the normal direction.
And S106, determining the reference normal direction of the scene where the first virtual object is located.
The scene in which the first virtual object is located is a three-dimensional virtual scene, and may be a virtual game scene or a virtual animation scene, for example. The scene in which the first virtual object can be constructed can be taken as the scene protected by the present disclosure.
The reference normal of the scene may be any line of sight for viewing the surroundings outside the first virtual object, and the reference normal direction may be a direction towards the first virtual object along any line of sight. The reference normal direction may also be referred to as a viewing angle direction. The reference normal direction may be the same as the normal direction of the patch or opposite to the normal direction of the patch.
And S108, respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
In an exemplary embodiment of the present disclosure, the transparency of the patch may refer to the degree to which the patch is visible. When the transparency of the patch is 1, it can indicate that the patch is completely visible; when the transparency of the patch is 0, it may indicate that the patch is completely invisible; when the transparency of the patch is a number between 0 and 1, the transparency of the patch can be expressed.
After the normal direction of each patch and the reference normal direction of the scene where the first virtual object is located are determined, the server may first 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, and then calculate an included angle between the normal direction of each patch and the reference normal direction after the normalization processing, respectively.
It should be noted that the value of the included angle between the normal direction of each patch after the normalization process and the reference normal direction 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 and flaky object feeling between objects in a rendering scene are solved, the volume feeling of the virtual object is improved, and the rendering effect is more realistic.
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 execution effect after a virtual object processing method is executed in a virtual reality game.
And after the server respectively calculates the included angle between the normal direction of each surface patch after normalization processing and the reference normal direction, comparing the calculated included angle 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.
The transparency of the patch and the included angle are in a negative correlation relationship, namely, the larger the angle is, the lower the transparency of the patch is.
Referring to fig. 4, the left side of the arrow indicates that the angle between the normal direction of a patch in the virtual object and the reference normal direction is 90, the transparency is low, and the sheet-like effect is generated. The right side of the arrow indicates that the transparency of each patch of the virtual object becomes high after the angle is adjusted, and the virtual object has no rendering effect of flaky feeling.
The transparency of the corresponding patch is adjusted by the calculated included angle, and the included angle threshold value is set, so that the included angle range is more accurate, the transparency adjusting process of the first virtual object is further simpler, and the resource consumption is reduced.
According to the exemplary embodiment of the present disclosure, the server may also perform a dot product operation on the normal direction of each normalized patch 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 a nonlinear fitting process on the calculated included angle through a preset power function to determine the 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 center coordinates of the first virtual object; and if the distance belongs to 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 patches included in the first virtual object and intersecting with each other. The reference position coordinates of the scene in which the first virtual object is located may be position coordinates for observing the first virtual object. The preset distance range may be a distance determined according to a position coordinate corresponding to a case where the transparency of the first virtual object is completely visible and a position coordinate corresponding to a case where the transparency of the first virtual object is completely invisible.
The server may compare whether a 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 the 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, 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 to be understood by workers.
According to an exemplary embodiment of the present disclosure, the first virtual object is located in a scene including 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, or the like in the virtual game scene. The first depth difference value may refer to a portion where a pixel depth value of the first virtual object is greater than a pixel depth value of the second virtual object. The overlap region may refer to a region where 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 the server determines the first depth difference value, the server may add the first depth difference value to the pixel depth value of the second virtual object to obtain an 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 disclosure, if there is an overlapping area between the first virtual object and the second virtual object, the server may determine 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.
Here, the second depth difference value may be a pixel depth value of a region where the first virtual object is displayed in the second virtual object model, that is, may be a pixel depth value of an overlapping region between the first virtual object and the second virtual object.
The pixel depth value of the second virtual object is adjusted, so that the second virtual object covers the overlapping area, the problem that the first virtual object and the second virtual object are obviously interspersed is reduced, and the rendering effect of the virtual scene is improved.
Fig. 5 illustrates the effect of two virtual objects before and after the interleaving fusion rendering in the virtual scene, where the first virtual object 502 and the second virtual object 504 are interleaved with each other and have 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 exhibits a pronounced interspersed rendering effect and has a flaky feel before the pixel depth value of the second virtual object 504 is adjusted. 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 interleaving, and improves the interleaving fusion rendering effect of the two virtual objects in the virtual scene.
According to an exemplary embodiment of the present disclosure, the first virtual object includes surface color features of the first virtual object, and the server may first acquire illumination information; then, determining the illumination influence intensity of the first virtual object; subsequently, the surface color feature of the first virtual object is adjusted 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 color feature overlaid on the surface of the first virtual object, and the illumination information may be, for example, yellow-colored illumination, and may be, for example, red-colored illumination.
The light influencing intensity can be represented by a value from 0 to 1. 0 may indicate that the surface color feature of the first virtual object is not affected by illumination; 1 may indicate that the surface color feature of the first virtual object is affected by illumination and is intense; a value between 0-1 may represent an intensity value at which the surface color feature of the first virtual object is affected by the illumination. In addition, 1 may also indicate that the surface color feature of the first virtual object is not affected by illumination; 0 may also indicate that the surface color feature of the first virtual object is affected by illumination and is intense.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, in an exemplary embodiment of the present disclosure, a virtual object processing apparatus is also provided.
Fig. 6 schematically shows 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 are intersected with each other; a patch normal determining module 603, configured to determine a normal direction of each patch; a reference normal determining module 605, configured to determine a reference normal direction of a scene where the first virtual object is located; and a transparency adjusting module 607, 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, the transparency adjustment module 607 may be configured to perform: normalizing the normal direction of each surface patch and the reference normal direction; and respectively calculating an included angle between the normal direction of each surface patch after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
According to another embodiment of the present disclosure, the transparency adjustment module 607 may be further configured to perform: respectively carrying out dot product operation on the normal direction of each surface patch after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface patch and the reference normal direction; and carrying out nonlinear fitting processing on the calculated included angle through a preset power function, and determining the transparency of the patch corresponding to the calculated included angle.
According to another embodiment of the present disclosure, the transparency adjustment module 607 may be further configured to perform: if the calculated included angle is larger than the included angle threshold value, the transparency of the corresponding surface patch is adjusted according to the calculated included angle; wherein, the transparency of the surface patch and the included angle are in a negative correlation relationship.
According to another embodiment of the present disclosure, referring to fig. 7, the virtual object processing apparatus 700 further includes, compared to the virtual object processing apparatus 600: a center coordinate determination module 702, a reference coordinate determination module 704, a distance calculation module 706, and a distance comparison module 708.
The central coordinate determining module 702 is configured to determine a central coordinate of the first virtual object; a reference coordinate determination module 704, configured to determine a reference position coordinate of a scene where the first virtual object is located; a distance calculation module 706 for calculating a distance between the reference position coordinates and the center coordinates of the first virtual object; a distance comparison module 708, configured to adjust a transparency of the first virtual object according to the distance if the distance falls within a preset distance range.
According to another embodiment of the present disclosure, referring to fig. 8, compared to the virtual object processing apparatus 600, the scene in which the first virtual object is located includes the second virtual object, the virtual object processing apparatus 800 further includes: a depth value comparison module 801 and a depth value adjustment module 803.
The depth value comparing module 801 is configured to determine a first depth difference value 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; a depth value adjusting module 803, configured to adjust a pixel depth value of the second virtual object based on the first depth difference value if there is an overlapping area between the first virtual object and the second virtual object, 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: a 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; an outline determination module may be configured to perform: determining a contour line of the second virtual object in the overlapping area; a 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 surface color features of the first virtual object, and the virtual object processing apparatus 600 further includes: an information acquisition module that may be configured to perform: acquiring illumination information; an intensity determination module may be configured to perform: determining an illumination impact intensity of the first virtual object; a color adjustment module 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 the adjusted first virtual object.
According to another embodiment of the present disclosure, before acquiring the first virtual object, the virtual object processing apparatus 600 further includes: a map acquisition module that may be configured to perform: obtaining a map corresponding to the first virtual object; a model construction module that may be configured to perform: constructing a three-dimensional model by utilizing a plurality of mutually crossed patches; an 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 details of each module/unit in the above-mentioned apparatus have been described in detail in the embodiments of the method section, and thus are not described again.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, 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.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to this embodiment of the invention is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the function and scope of use of the 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 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 to cause the processing unit 910 to perform steps according to various exemplary embodiments of the present invention described in the above section "exemplary methods" of the present specification. For example, the processing unit 910 may perform steps S102 to S108 as shown in fig. 1.
The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM)9201 and/or a cache memory unit 9202, and may further include a read only memory unit (ROM) 9203.
Storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 930 can be any 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.
Electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, Bluetooth device, etc.), and may also communicate with one or more devices that enable a user to communicate with electronic device 900, and/or with any device (e.g., router, modem, etc.) that enables electronic device 900 to communicate with one or more other computing devices.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, 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 (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the 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, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
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 variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (14)

1. A virtual object processing method, comprising:
acquiring a first virtual object, wherein the first virtual object comprises a plurality of patches which are mutually crossed;
determining the normal direction of each patch;
determining a reference normal direction of a scene where the first virtual object is located;
and respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
2. The method of claim 1, wherein calculating an angle between a normal direction of each patch and the reference normal direction, and adjusting the transparency of the corresponding patch according to the calculated angle comprises:
normalizing the normal direction of each surface patch and the reference normal direction;
and respectively calculating an included angle between the normal direction of each surface patch after normalization processing and the reference normal direction, and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
3. The method of claim 2, wherein the calculating an angle between the normal direction of each patch after the normalization processing and the reference normal direction, and the 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 patch after normalization processing and the reference normal direction to obtain an included angle between the normal direction of each surface patch and the reference normal direction;
and carrying out nonlinear fitting processing on the calculated included angle through a preset power function, and determining the transparency of the 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:
if the calculated included angle is larger than the included angle threshold value, the transparency of the corresponding surface patch is adjusted according to the calculated included angle;
and the transparency of the patch and the included angle are in a negative correlation relationship.
5. The virtual object processing method according to any one of claims 1 to 3, further comprising:
determining 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 center coordinates of the first virtual object;
and if the distance belongs to a preset distance range, adjusting the transparency of the first virtual object according to the distance.
6. The virtual object processing method according to any one of claims 1 to 3, wherein the scene in which the first virtual object is located includes a second virtual object, the virtual object processing method further comprising:
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;
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.
7. The virtual object processing method according to claim 6, further comprising:
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 an outline of the second virtual object in the overlapping region;
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.
8. The virtual object processing method according to any one of claims 1 to 3, wherein the first virtual object includes a surface color feature of the first virtual object, and wherein the virtual object processing method further includes:
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.
9. The virtual object processing method according to any one of claims 1 to 3, wherein before acquiring the first virtual object, the virtual object processing method further comprises:
obtaining a map corresponding to the 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.
10. 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.
11. The virtual object processing method according to claim 1, wherein the virtual object processing method is applied to a virtual reality game.
12. A virtual object processing apparatus, comprising:
the system comprises an object acquisition module, a storage module and a processing module, wherein the object acquisition module is used for acquiring a first virtual object, and the first virtual object comprises a plurality of mutually crossed patches;
the normal determining module of the surface patch is used for determining the normal direction of each surface patch;
a reference normal determining module, configured to determine a reference normal direction of a scene where the first virtual object is located;
and the transparency adjusting module is used for respectively calculating an included angle between the normal direction of each surface patch and the reference normal direction and adjusting the transparency of the corresponding surface patch according to the calculated included angle.
13. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing a virtual object processing method according to any one of claims 1 to 11.
14. 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 processing method of any one of claims 1 to 11.
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 true CN111494945A (en) 2020-08-07
CN111494945B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112099638A (en) * 2020-10-19 2020-12-18 深圳市瑞立视多媒体科技有限公司 Information processing method and device in virtual reality scene and computer equipment
CN113298909A (en) * 2021-04-13 2021-08-24 网易(杭州)网络有限公司 Virtual road generation method and device, storage medium and processor
WO2022121653A1 (en) * 2020-12-08 2022-06-16 上海米哈游天命科技有限公司 Transparency determination method and apparatus, electronic device, and storage medium

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
黄心渊, 中国铁道出版社 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112099638A (en) * 2020-10-19 2020-12-18 深圳市瑞立视多媒体科技有限公司 Information processing method and device in virtual reality scene and computer equipment
CN112099638B (en) * 2020-10-19 2024-02-06 瑞立视多媒体科技(北京)有限公司 Information processing method and device in virtual reality scene and computer equipment
WO2022121653A1 (en) * 2020-12-08 2022-06-16 上海米哈游天命科技有限公司 Transparency determination method and apparatus, electronic device, and storage medium
CN113298909A (en) * 2021-04-13 2021-08-24 网易(杭州)网络有限公司 Virtual road generation method and device, storage medium and processor

Also Published As

Publication number Publication date
CN111494945B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
US20170186219A1 (en) Method for 360-degree panoramic display, display module and mobile terminal
US8803879B1 (en) Omnidirectional shadow texture mapping
CN111494945A (en) Virtual object processing method and device, storage medium and electronic equipment
WO2022048115A1 (en) Terrain deformation method and apparatus, device, and storage medium
CN112712582B (en) Dynamic global illumination method, electronic device and computer readable storage medium
CN109985384B (en) Method and device for dynamically adjusting map
CN113436343A (en) Picture generation method and device for virtual studio, medium and electronic equipment
US20230290043A1 (en) Picture generation method and apparatus, device, and medium
WO2022247204A1 (en) Game display control method, non-volatile storage medium and electronic device
CN112734896A (en) Environment shielding rendering method and device, storage medium and electronic equipment
CN115082607A (en) Virtual character hair rendering method and device, electronic equipment and storage medium
US20230260218A1 (en) Method and apparatus for presenting object annotation information, electronic device, and storage medium
CN115965735B (en) Texture map generation method and device
CN108031117A (en) Region mist effect implementation method and device
CN108986228B (en) Method and device for displaying interface in virtual reality
CN111489426A (en) Expression generation method, device, equipment and storage medium
US7643028B2 (en) Image generation program product and image generation device
CN116310041A (en) Rendering method and device of internal structure effect, electronic equipment and storage medium
JP4303395B2 (en) GAME DEVICE AND INFORMATION STORAGE MEDIUM
CN115761105A (en) Illumination rendering method and device, electronic equipment and storage medium
CN115063330A (en) Hair rendering method and device, electronic equipment and storage medium
CN116958390A (en) Image rendering method, device, equipment, storage medium and program product
CN114494545A (en) Implementation method and system for simulating foggy day in 3D scene
CN114693780A (en) Image processing method, device, equipment, storage medium and program product
JP4802254B2 (en) GAME DEVICE AND INFORMATION STORAGE MEDIUM

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