CN110354499A - The method and device of profile photocontrol - Google Patents

The method and device of profile photocontrol Download PDF

Info

Publication number
CN110354499A
CN110354499A CN201910633944.5A CN201910633944A CN110354499A CN 110354499 A CN110354499 A CN 110354499A CN 201910633944 A CN201910633944 A CN 201910633944A CN 110354499 A CN110354499 A CN 110354499A
Authority
CN
China
Prior art keywords
light
rim
ming
angle
distribution
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
CN201910633944.5A
Other languages
Chinese (zh)
Other versions
CN110354499B (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 CN201910633944.5A priority Critical patent/CN110354499B/en
Publication of CN110354499A publication Critical patent/CN110354499A/en
Application granted granted Critical
Publication of CN110354499B publication Critical patent/CN110354499B/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
    • 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
    • A63F13/525Changing parameters of virtual cameras
    • 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/55Controlling game characters or game objects based on the game progress
    • 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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the present invention provides a kind of method and device of profile photocontrol, this method comprises: obtaining distribution of light sources information according to the first angle between light source direction and the normal direction on each vertex of game object.According to the second angle between the normal direction on each vertex of direction of visual lines and game object, profile light distribution information is obtained.According to rim(ming) light thickness coefficient adjustment profile light distribution information, to control the rim(ming) light of game object, wherein rim(ming) light thickness coefficient is according to distribution of light sources information acquisition, and rim(ming) light thickness coefficient is used to indicate the thickness of rim(ming) light.By determining rim(ming) light thickness coefficient according to distribution of light sources information, and according to rim(ming) light thickness coefficient adjustment profile light distribution information, to control the direction that can accurately reflect light source when rim(ming) light is presented in game object, to increase the reasonability of the rim(ming) light of game object.

Description

The method and device of profile photocontrol
Technical field
The present embodiments relate to computer technology more particularly to a kind of method and devices of profile photocontrol.
Background technique
In scene of game, when the overlapping of the tone of game object and game background (for example game object is dark, game background Also dark), rim(ming) light can separate game object and game background, to keep the level of scene of game obvious, to increase bearty in form Sense.
Currently, what the angle between the direction of the video camera of scene of game and the direction of light source was always fixed, no matter image Machine rotate to where, light source direction is always kept fixed angle with camera direction so that game object shows wheel Wide light, however in full view game, light source that light source is usually a fixed position, not binding with video camera is presented The usual still angle representations based on video camera of rim(ming) light out.
However, being only the angle representations rim(ming) light from video camera, it can make rim(ming) light that can not accurately reflect the side of light source To showing unreasonable state so as to cause the rim(ming) light of game object.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of profile photocontrol, to overcome the rim(ming) light of game object to present Unreasonable state out.
In a first aspect, the embodiment of the present invention provides a kind of method of profile photocontrol, comprising:
According to the first angle between light source direction and the normal direction on each vertex of game object, distribution of light sources letter is obtained Breath;
According to the second angle between the normal direction on each vertex of direction of visual lines and the game object, rim(ming) light is obtained Distributed intelligence;
According to profile light distribution information described in rim(ming) light thickness coefficient adjustment, to control the rim(ming) light of the game object, Wherein, the rim(ming) light thickness coefficient is according to the distribution of light sources information acquisition, and the rim(ming) light thickness coefficient is for referring to Show the thickness of rim(ming) light.
It is described according between light source direction and the normal direction on each vertex of game object in a kind of possible design First angle obtains distribution of light sources information, comprising:
Obtain the first angle between the normal direction on each vertex of light source direction and game object;
According to the corresponding relationship between preset angle and brightness value, the first angle for obtaining each vertex correspondence is corresponding Brightness value, wherein the brightness value is used to indicate the brightness on vertex;
According to the corresponding brightness value of the first angle of each vertex correspondence, the distribution of light sources information is obtained.
In a kind of possible design, the normal direction on each vertex according to direction of visual lines and the game object it Between the second angle, obtain profile light distribution information, comprising:
Obtain the second angle between the normal direction on each vertex of direction of visual lines and the game object;
According to the corresponding relationship between preset angle and Distribution Value, the second angle for obtaining each vertex correspondence is corresponding Distribution Value, wherein the Distribution Value is used to indicate whether vertex is located at outline position;
According to the corresponding Distribution Value of the second angle of each vertex correspondence, the profile light distribution information is obtained.
In a kind of possible design, in the corresponding relationship between the preset angle and Distribution Value, angle and distribution It is worth negative correlation;
According to the corresponding Distribution Value of the second angle of each vertex correspondence, the profile light distribution information is obtained, comprising:
Reverse phase processing is carried out to the corresponding Distribution Value of the second angle of each vertex correspondence, obtains the profile light distribution Information.
In a kind of possible design, the method also includes:
According to the distribution of light sources information and default negative correlation model, rim(ming) light thickness coefficient is obtained, wherein described default Negative correlation model is used to indicate the negative correlativing relation between the distribution of light sources information and the profile thickness coefficient.
In a kind of possible design, the method also includes:
According to the soft coefficient in rim(ming) light edge or/and default interpolation model, the profile light distribution information is adjusted, Wherein, the default interpolation model is for being adjusted the distribution of the profile light distribution information.
In a kind of possible design, the default interpolation model is smooth interpolation model.
Second aspect, the embodiment of the present invention provide a kind of device of profile photocontrol, comprising:
Module is obtained, for according to the first angle between light source direction and the normal direction on each vertex of game object, Obtain distribution of light sources information;
Obtain module, second be also used between the normal direction according to each vertex of direction of visual lines and the game object Angle obtains profile light distribution information;
Module is adjusted, the profile light distribution information according to rim(ming) light thickness coefficient adjustment is used for, to control the game The rim(ming) light of object, wherein the rim(ming) light thickness coefficient is according to the distribution of light sources information acquisition, and the rim(ming) light is thick Thin coefficient is used to indicate the thickness of rim(ming) light.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, comprising:
Memory, for storing program;
Processor, for executing the described program of memory storage, when described program is performed, the processor For executing any method in the various possible designs of first aspect and first aspect as above.
Fourth aspect, the embodiment of the present invention provides a kind of computer readable storage medium, including instruction, when it is in computer When upper operation, so that computer executes any side in the various possible designs of first aspect and first aspect as above Method.
The embodiment of the present invention provides a kind of method and device of profile photocontrol, this method comprises: according to light source direction and The first angle between the normal direction on each vertex of game object, obtains distribution of light sources information.According to direction of visual lines and game The second angle between the normal direction on each vertex of object, obtains profile light distribution information.According to rim(ming) light thickness coefficient tune Whole profile light distribution information, to control the rim(ming) light of game object, wherein rim(ming) light thickness coefficient is according to distribution of light sources information It obtains, rim(ming) light thickness coefficient is used to indicate the thickness of rim(ming) light.By determining rim(ming) light thickness according to distribution of light sources information Coefficient, and according to rim(ming) light thickness coefficient adjustment profile light distribution information, to control energy when rim(ming) light is presented in game object The direction of light source is accurately reflected, enough to increase the reasonability of the rim(ming) light of game object.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 is the schematic diagram of a scenario of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 2 is the interface schematic diagram one of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 3 is the flow chart one of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 4 is the flowchart 2 of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 5 is the interface schematic diagram two of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 6 is the interface schematic diagram three of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 7 is the interface schematic diagram four of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 8 A is the interface schematic diagram five of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 8 B is the interface schematic diagram six of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 9 A is the interface schematic diagram seven of the method for profile photocontrol provided in an embodiment of the present invention;
Fig. 9 B is the interface schematic diagram eight of the method for profile photocontrol provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram one of the device of profile photocontrol provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram two of the device of profile photocontrol provided in an embodiment of the present invention;
Figure 12 is the hardware structural diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is combined simply to introduce scene of game first, Fig. 1 is profile photocontrol provided in an embodiment of the present invention The schematic diagram of a scenario of method, as shown in Figure 1:
When carrying out scene of game production, scene of game is provided with camera 102, wherein camera 102 is used In obtaining scene of game in graphical user interfaces to be shown, it will be understood by those skilled in the art that user is in client institute The scene of game seen is shot by camera 102, when the angle of camera 102 or position change, The scene of game of corresponding presentation in graphical user interfaces can also change, in scene of game observed by end user It can't see the presence of camera 102, because the position where the sight of user is actually the position of camera.
It wherein, include game object (virtual portrait of such as player exercises, non-gaming player, house, stone in scene of game Deng), it further include game background, when carrying out scene of game production, game object is present in production region in a manner of three-dimensional, ginseng See Fig. 1, it is assumed that cube 101 therein is a game object, and camera 102 observes 101 from different angles, thus scheming Corresponding game object is shown in shape user interface.
By taking the state of camera 102 and game object 101 in Fig. 1 as an example, game object 101 includes 6 faces, wherein imaging First 102 are shot from the angle of " plane 6 ", to show " plane 6 " of game object 101 in final scene of game.
Light source is also typically included in scene of game, wherein light source can be for example sunlight, light, the laser for discharging technical ability Deng the present embodiment is not construed as limiting the type of light source, actual setting can be carried out according to different game, specifically, trip Play object can show corresponding effect of shadow under the action of light source, so that scene of game has authenticity.
Wherein, rim(ming) light be comparable in face of video camera direction carry out light irradiation so that game object The position at its edge shows backlight effect in the state of video camera, so that the profile to the game object being taken carries out It delineates, so that game object is mutually separated with game background, keeps picture level abundant, increase visual format aesthetic feeling.
Currently, in the prior art, what the direction of video camera and the direction of light source were always bound, i.e., it is deposited between both direction In fixed angular relationship, no matter camera rotation to where, light source always comes from the same side so that game object Show rim(ming) light.
However in full view game, since it is desired that the function from each view game state is provided a user, because Light source (as sunlight is exactly fixed) that this light source is usually a fixed position, not bound with video camera, below with reference to Fig. 2 is illustrated the performance of rim(ming) light, and Fig. 2 is the interface schematic diagram of the method for profile photocontrol provided in an embodiment of the present invention One.
As shown in Fig. 2, being illustrated in Fig. 2 under 4 different angles of camera direction and light source direction, the same trip The corresponding different 4 kind state showed of play object, in the figure 2 example, wherein the direction of light source does not change, in Fig. 2 4 kinds of states be angle between light source direction and camera direction (not consecutive variations are intended merely to show being changed Different states), alternatively, for the ease of being understood referring to fig. 2, opposite it can be construed to, when game object is from the right side of light source When side gradually goes to left side (angle of video camera remains at the front of game object), it is equivalent to, the direction of light source is opposite Right side is gradually gone to from left side in game object.
However, the light-receiving surface of game object can be made to show greatly when camera rotation is extremely consistent with the direction of light source The exposure of range, such as the state that game object 201 (in Fig. 2 from left to right count third images) is showed, so as to cause trip Object play in the unreasonable of present condition, based on the above issues, the present invention provides a kind of method of profile photocontrol, so that from light The angle in source is not in large-scale exposure when observing game object, to increase the reasonability of game object.
It is illustrated below with reference to specific embodiment, is introduced first in conjunction with Fig. 3, Fig. 3 mentions for the embodiment of the present invention The flow chart one of the method for the profile photocontrol of confession.
As shown in figure 3, this method comprises:
S301, according to the first angle between light source direction and the normal direction on each vertex of game object, obtain light source Distributed intelligence.
In the present embodiment, light source is corresponding with light source direction, which angle is light source direction be used to indicate light source to game Object is irradiated, such as may refer to direction indicated by the dotted arrow of light source 103 in Fig. 1.
Wherein, game object include multiple vertex, the respective normal direction of each vertex correspondence, wherein normal direction be Refer to the direction perpendicular to the plane where the vertex, such as may refer to Fig. 1, game object 101 includes six planes, Mei Geping Bread contains multiple vertex, and wherein the normal direction on multiple vertex is direction indicated by arrow 104 in plane 1, more in plane 2 The normal direction on a vertex is direction indicated by arrow 105, and the normal direction on multiple vertex is arrow 106 in plane 3 Indicated direction.
It will be understood by those skilled in the art that Fig. 1 is only the schematical introduction carried out with a cube, in reality In scene of game, specific game object can correspond to many planes, therefore each vertex corresponds to respective normal direction.
Secondly, normal direction can reflect the direction on each vertex of game object, wherein light source direction and each vertex There are the first angles between normal direction can obtain according to the first angle between light source direction and the normal direction on each vertex To for reflecting the distribution of light sources information of the distribution of the Lighting information of light source on the surface of game object.
Such as the normal direction on light source direction and certain vertex shows that the vertex is faced directly on the contrary, then the first angle is 180 ° Light source (as light-receiving surface), alternatively, such as light source direction is identical as the normal direction on certain vertex, then the first angle is 0 °, table The bright vertex is back to light source (as shady face), alternatively, such as light source direction is vertical with the normal direction on certain vertex, then first presss from both sides Angle is 90 °, shows that the vertex is located exactly at the intersection of shady face and light-receiving surface, wherein it is understood that working as light source side To when being greater than 90 ° with the normal direction angle on vertex, then the position where the vertex is to be in backlight (light source irradiation less than) State.
Being above take the first angle as 180 ° (direction is consistent), the first angle is 0 ° (contrary) and the first angle is It is illustrated for 90 ° (direction is vertical), it will be understood by those skilled in the art that each except above-mentioned three kinds of first angles A angle corresponds to respective distribution of light sources information, for indicating distribution of the illumination on each vertex of game object, In optional embodiment, distribution of light sources information can be for example indicated with angle, or can also be indicated with numerical value, this Embodiment is not particularly limited this.
In an alternate embodiment of the invention, may exist multiple light sources in scene of game, it can be simultaneously in a such as scene of game There are sunlights and light, and in the present embodiment, light source can be understood as individual main light source, i.e., are showed to game object Effect of shadow influence maximum light source, alternatively, light source is also understood that the synthesis light source obtained for multiple light sources collective effect, The present embodiment does not limit this.
S302, according to the second angle between the normal direction on each vertex of direction of visual lines and game object, obtain profile Light distribution information.
It is appreciated that the direction that video camera is placed is that preset user checks direction, root during making game According to the difference for the position that video camera is placed, game object can be shot from different directions.It should be noted that the present invention is implemented The direction of camera is carried out reversely, as direction of visual lines in example.In the present embodiment, profile light distribution information is used to indicate wheel Wide light the surface of game object distribution, for example, see Fig. 1, video camera from the angle shot game object of plane 6, therefore When showing scene of game, it should show rim(ming) light in the surrounding of plane 6.
It will be understood by those skilled in the art that the game object that user observes in graphical user interfaces is actually two Dimension, there is always marginal positions for a two-dimensional object, and wherein the distributing position of rim(ming) light is actually to shoot from video camera The marginal position for the game object that angle looks over.
In the present embodiment, there are the second angles between direction of visual lines and the normal direction on each vertex, according to the second angle It is available for the profile light distribution information of the marginal position of instruction game object.
Such as direction of visual lines is consistent with the normal direction on certain vertex, then the second angle is 0 °, shows that the vertex is faced directly and takes the photograph Camera (position that the direction of observation of as user is faced directly), alternatively, such as direction of visual lines is vertical with the normal direction on certain vertex, Then the second angle is 90 °, show the vertex perpendicular to video camera (as most marginal position), wherein it is understood that When direction of visual lines and the normal direction angle on vertex are less than 90 °, then the position where the vertex is the position that user does not observe It sets, it, can only be to game object of second angle between 90 ° to 180 ° because screen is shown with two-dimensional state Part is shown.
S303, according to rim(ming) light thickness coefficient adjustment profile light distribution information, to control the rim(ming) light of game object, In, rim(ming) light thickness coefficient is according to distribution of light sources information acquisition, and rim(ming) light thickness coefficient is used to indicate the thickness of rim(ming) light.
In the present embodiment, light source and video camera are not bound, therefore the position between light source direction and direction of visual lines Relationship be also it is uncertain, for avoid in the prior art rim(ming) light can not accurately reflect the direction of main light source, so as to cause profile Light is in the irrationality of present condition, and present invention combination distribution of light sources information adjusts profile light distribution information, to control game pair The rim(ming) light of elephant, to increase the reasonability that rim(ming) light is presented in game object.
Specifically, profile light distribution information indicates the marginal position of the game object from the angle of video camera, it is false If light source is located at the left side of video camera, that is, show that light source irradiates game object from left side, then the marginal portion on the left of game object For light-receiving surface, the marginal position that should be showed on the right side of large range of rim(ming) light and game object is shady face, should not be in Existing rim(ming) light (performance black), and from the left side of game object to right side (light-receiving surface to shady face), the profile of game object Light should show the smaller and smaller state of range, so that the presentation of rim(ming) light can accurately reflect the direction of main light source.
In the present embodiment, the rim(ming) light thickness system for the thickness for being used to indicate rim(ming) light is obtained according to distribution of light sources information Secondly number is adjusted profile light distribution information according to rim(ming) light thickness coefficient, because rim(ming) light thickness coefficient is according to light Source distribution information obtains, therefore when according to rim(ming) light thickness coefficient adjustment profile light distribution information, corresponding game object is in The rim(ming) light revealed also shows corresponding distribution of light sources information, the i.e. direction of main light source.
In an optional implementation manner, for example, can be set rim(ming) light thickness coefficient and distribution of light sources information present it is negative Correlativity, this, which sentences distribution of light sources information and is expressed as example with numerical value, is illustrated, when distribution of light sources information uses other forms When (such as the first angle) indicates, implementation is similar, specifically, the numerical value of distribution of light sources information is bigger, (vertex is located Light-receiving surface), corresponding rim(ming) light thickness coefficient is smaller (rim(ming) light showed is thicker), so that game object showed Rim(ming) light range in light-receiving surface is larger, corresponding, is more proximate to the part of shady face, and the range of rim(ming) light is smaller.
Alternatively, positive correlation can also be presented with distribution of light sources information in rim(ming) light thickness coefficient, then it at this time for example can be with Setting rim(ming) light thickness coefficient is smaller, and the rim(ming) light showed is thinner, it will be understood by those skilled in the art that according to distribution of light sources The specific implementation that information obtains rim(ming) light thickness coefficient can be set according to actual needs, as long as guaranteeing according to profile After light thickness coefficient adjustment profile light distribution information, the profile optical range of the light-receiving surface of game object is larger, light-receiving surface extremely Shady face profile optical range is gradually reduced, so as to reflect the direction of main light source.
The method of profile photocontrol provided in an embodiment of the present invention, comprising: according to each top of light source direction and game object The first angle between the normal direction of point, obtains distribution of light sources information.According to each vertex of direction of visual lines and game object The second angle between normal direction, obtains profile light distribution information.Believed according to rim(ming) light thickness coefficient adjustment profile light distribution Breath, to control the rim(ming) light of game object, wherein rim(ming) light thickness coefficient is according to distribution of light sources information acquisition, rim(ming) light Thickness coefficient is used to indicate the thickness of rim(ming) light.By determining rim(ming) light thickness coefficient according to distribution of light sources information, and according to Rim(ming) light thickness coefficient adjustment profile light distribution information, so that light source can be accurately reflected by controlling when rim(ming) light is presented in game object Direction, to increase the reasonability of the rim(ming) light of game object.
On the basis of the above embodiments, the prior art can make at the direction of video camera and the consistent direction of light source The light-receiving surface of game object shows large-scale exposure, shows unreasonable shape so as to cause the rim(ming) light of game object State, the method for profile photocontrol provided in this embodiment, by being adjusted profile light distribution information to control game object Rim(ming) light, wherein profile light distribution information is used to indicate the position of rim(ming) light, therefore only marginal position is made to show profile Light, for not being the part of marginal position, there is no rim(ming) lights will not show rim(ming) light so that camera direction and When light source direction is consistent, the rim(ming) light of game object is not in the exposure of large area, below with reference to Fig. 4 to Fig. 9 B to the present invention The method for the profile photocontrol that embodiment provides further is discussed in detail, and Fig. 4 is profile provided in an embodiment of the present invention The flowchart 2 of the method for photocontrol, Fig. 5 are the interface schematic diagram two of the method for profile photocontrol provided in an embodiment of the present invention, Fig. 6 is the interface schematic diagram three of the method for profile photocontrol provided in an embodiment of the present invention, and Fig. 7 is provided in an embodiment of the present invention The interface schematic diagram four of the method for profile photocontrol, Fig. 8 A are the interface of the method for profile photocontrol provided in an embodiment of the present invention Schematic diagram five, Fig. 8 B are the interface schematic diagram six of the method for profile photocontrol provided in an embodiment of the present invention, and Fig. 9 A is the present invention The interface schematic diagram seven of the method for the profile photocontrol that embodiment provides, Fig. 9 B are profile photocontrol provided in an embodiment of the present invention Method interface schematic diagram eight.
As shown in figure 4, this method comprises:
The first angle between the normal direction on each vertex of S401, acquisition light source direction and game object.
Specifically, each vertex of game object corresponds to respective normal direction, therefore the method on each vertex is obtained first Line direction.
It in an optional implementation manner, can be according to the corresponding normal line vector of each normal direction and light source direction pair The light source vector answered obtains the first angle, and wherein vector is the amount with size and Orientation, in the present embodiment, each normal line vector With the default size that is dimensioned to of light source vector, such as default size can be 1, thus by each normal line vector and light source direction Being set as unit vector or default size can be selected according to demand, and the present embodiment is without limitation.
Specifically, can indicate each normal line vector and light source vector using the numerical value in three-dimensional system of coordinate, such as can adopt A normal line vector is indicated with the x, y, z value in three Cartesian coordinates, with the corresponding method of the normal direction on any one vertex For line vector, it is assumed that origin of the position as three-dimensional system of coordinate where the vertex, according to normal direction and preset to X, y, z value of the terminal of the available normal line vector of size in three-dimensional system of coordinate is measured, to obtain the normal line vector, ability Field technique personnel are appreciated that such as can also obtain sight line vector and each normal line vector using spheric coordinate system, this reality Example is applied to the implementation of sight line vector and each normal line vector with no restrictions.
It is worth noting that the present embodiment when winning the first place angle, can carry out light source direction reversely, to obtain light source Vector, the i.e. direction of light source vector and light source direction are opposite, and the implementation for obtaining the first angle is introduced below.
In the present embodiment, dot product operation can be carried out according to each normal line vector of light source vector sum to obtain the first folder Angle is below illustrated dot product operation by taking some normal line vector a and light source vector b as an example, wherein the public affairs of vector dot Formula is shown in following formula one
Ab=| a | × | b | × cos θ formula one
Wherein " " is the symbol of dot product operation, indicates that vector a and vector b carry out dot product, wherein the length that " | a | " is vector a Degree, " | b | " are the length of vector b, and in the present embodiment, the length of vector is default size, as given value, wherein θ be to The angle between a and vector b is measured, further, it is assumed that vector a is expressed as (x in three-dimensional system of coordinate1,y1,z1), vector b exists (x is expressed as in three-dimensional system of coordinate2,y2,z2), then there is following formula two
Ab=(x1×x2)+(y1×y2)+(z1×z2) formula two
According to formula two, available vector a and vector b carry out the point multiplier value that dot product operates, further, according to public affairs Formula one and formula two, the value of available cos θ, so as to further obtain the angle between normal line vector and light source vector θ, wherein angle theta is the first angle.
It is to combine light source vector to carry out dot product operation with a normal line vector to be illustrated above, for game object Each vertex carries out dot product operation all in accordance with the corresponding normal line vector of light source vector sum, thus obtain light source direction with The first angle between the normal direction on each vertex.
It will be understood by those skilled in the art that determine that the mode of the first angle can be selected according to actual needs, this Embodiment is not construed as limiting this, as long as the first angle between light source direction and the normal direction on each vertex can be obtained.
S402, according to the corresponding relationship between preset angle and brightness value, obtain the first angle pair of each vertex correspondence The brightness value answered, wherein brightness value is used to indicate the brightness on vertex.
In the present embodiment, there are preset corresponding relationship between angle and brightness value, brightness value is used to indicate vertex Brightness level (illumination is stronger, and correspondence is also brighter), therefore each vertex can be got according to the first angle of each vertex correspondence Brightness value corresponding to corresponding first angle.
In an optional implementation manner, give an account of above continue carry out for dot product according to formula one and formula two Introduce, above-mentioned when carrying out dot product operation according to light source vector and normal line vector, the point multiplier value of available two vectors, i.e., on State that formula two obtains as a result, this multiplier value is the brightness value on vertex, wherein corresponding between the first angle and brightness value Relationship is relationship shown by formula one.
In another optional implementation, the corresponding brightness of the first angle directly can be determined according to dot product function Value, see, for example, following formula:
NoL_org=dot (N, L) formula three
Wherein, N indicates that normal line vector, L indicate that light source vector, NoL_org indicate the corresponding brightness value of the first angle, dot Normal line vector and light source vector are handled by dot product function for carrying out the dot product of two vectors for dot product function, from And obtain the corresponding brightness value of the first angle.
S403, the corresponding brightness value of the first angle according to each vertex correspondence, obtain distribution of light sources information.
In the present embodiment, the corresponding brightness value of the first angle can indicate distribution of light sources information, specifically, combining figure 5 are illustrated with the default size of vector for 1, wherein each normal line vector and light source vector are unit vector, and then dot product obtains The size of the point multiplier value arrived is between 0 to 1, and when multiplier value is 0, the numerical value of cos θ is 0, corresponding light source direction and method First angle in line direction is 90 °, and the brightness value of the vertex correspondence is also 0 at this time, which shows black and (be located at shady face With the intersection of light-receiving surface), referring to Fig. 5, it is assumed that light source is located at the right side of game object, then the vertex in left side shows black.
Alternatively, the numerical value of cos θ is 1, and the angle of corresponding light source vector sum normal line vector is when dot product result is 1 180 °, and the direction of light source vector and light source direction be on the contrary, then the first angle of corresponding light source direction and normal direction is 0 °, The brightness value of the vertex correspondence is 1 at this time, which shows white (vertex be light-receiving surface, face light source directly), referring to Fig. 5, The vertex that light source is faced on right side directly shows white.
Alternatively, game object shows the light of different brightness levels when the brightness value of pixel is the numerical value between 0 to 1 Shadow effect, different degrees of expressing gradation as shown in Figure 5.
Therefore, brightness value is the numerical value between the first angle corresponding -1 to 1, right when brightness value is between 0 to 1 Each vertex answered is located at light-receiving surface, and when brightness value is between -1-0, corresponding each vertex is located at shady face, each numerical value pair The corresponding brightness level showed of different illumination should be indicated, so that the brightness level on each vertex shows model jointly Effect of shadow, by above-mentioned introduction it is found that when the first angle is 0 °, corresponding vertex is most bright, corresponding when the first angle is 90 ° Vertex is most dark, therefore the first angle and brightness level are in inversely prroportional relationship in the present embodiment.
Above is only that 1 citing is illustrated with the default size of vector, when the default size of vector is other numerical value, As long as obtaining the brightness value of each vertex correspondence according to the corresponding relationship and the first angle of the first angle and brightness value, Implementation is similar, and details are not described herein again.
The second angle between the normal direction on each vertex of S404, acquisition direction of visual lines and game object.
Wherein, the implementation for obtaining the second angle is similar with the implementation of the first angle is obtained, and details are not described herein again.
The difference is that indicating that the plane where the vertex when the angle of direction of visual lines and normal direction is 90 ° It is parallel with direction of visual lines, thus angle be 90 ° vertex i.e. sight it is observed that game object marginal portion, i.e., The vertex at edge is illustrated in Fig. 6.
Alternatively, also indicating that the plane and sight where the vertex when the angle of direction of visual lines and normal direction is 0 ° Direction is vertical, therefore the part that the second angle is faced directly by 0 ° of corresponding vertex i.e. sight, is not also just marginal position, It can be found in the part of White vertex in Fig. 6.
In an alternate embodiment of the invention, the range of the second angle is 0 ° to 180 °, wherein although the range of the second angle is 0 ° To 180 °, but we are when determining profile light distribution information according to the second angle, it is only necessary to portion of the range between 0 ° to 90 ° Point, wherein 90 ° to 180 ° of part be observed by sight less than part, therefore do not need to handle this part (available but It is not necessary to processing), can by determining profile light distribution information according only to the part between 0 ° to 90 ° Effectively reduce calculation amount.
S405, according to the corresponding relationship between preset angle and Distribution Value, obtain the second angle pair of each vertex correspondence The Distribution Value answered, wherein Distribution Value is used to indicate whether vertex is located at outline position.
In the present embodiment, the second angle is corresponding with Distribution Value, and wherein Distribution Value is used to indicate whether vertex is located at profile Position, Distribution Value is similar with the brightness value of above-mentioned introduction, and only indicated content is different, specifically, angle and Distribution Value it Between there are preset corresponding relationship, the corresponding relationship of angle and Distribution Value is referred to the corresponding relationship of angle and brightness value, this Place repeats no more.
In an optional implementation manner, such as Distribution Value can be obtained using formula four:
NoV=saturate (dot (N, V)) formula four
Wherein, N indicates that normal line vector, V indicate sight line vector, and dot is dot product function, and for obtaining the second angle, NoVNoV is Distribution Value, wherein the effect of function saturate (x) is the return value 0 if x value is less than 0.If x value is greater than 1, Then return value is 1, if x between 0 to 1, directly returns to the value of x, to determining Distribution Value between 0 to 1.
It will be understood by those skilled in the art that the black and white in Fig. 6 is not lighting effect, it is intended merely to show model surface The positional relationship on each vertex and direction of visual lines, to indicate whether vertex is located at outline position.
S406, the corresponding Distribution Value of the second angle according to each vertex correspondence, obtain profile light distribution information.
Specifically, Distribution Value can be used to indicate that profile light distribution information, wherein Distribution Value is corresponding with the second angle 0 Numerical value between to 1, when the second angle is 0 °, corresponding Distribution Value is 1, shows that the vertex is the part for facing video camera directly (not in outline position);When the second angle is 90 °, corresponding Distribution Value is 0, shows that the normal direction on the vertex is vertical In the direction (being located at outline position) of video camera, when the second angle is 180 °, corresponding Distribution Value is -1, shows that the vertex is Back to the part of video camera, wherein the second angle and Distribution Value are in inversely prroportional relationship.
In an optional implementation manner, in the corresponding relationship between preset angle and Distribution Value, angle and distribution It is worth negative correlation, i.e. the second angle is bigger, and corresponding Distribution Value is smaller, is not located at the position of profile, this field skill Art personnel are appreciated that the range that the outline position in the present embodiment can be not absolute, can be the range of referring to property.
In an alternate embodiment of the invention, for the ease of handling rim(ming) light, reverse phase processing is carried out according to Distribution Value, thus Profile light distribution information is obtained, wherein reverse phase processing can be understood as black and white reverse phase, i.e. script Distribution Value is 1 (facing video camera directly) Vertex after reverse phase is handled, obtain reverse phase Distribution Value be 0, script Distribution Value be 0 (marginal position) vertex pass through reverse phase After processing, obtaining reverse phase Distribution Value is 1, to obtain rim(ming) light breadth coefficient, the position that wherein rim(ming) light breadth coefficient is 1 is For the marginal position of game object, that is, the position of rim(ming) light should be shown.
In an optional implementation manner, such as reverse phase processing can be carried out according to formula five:
RimFactor=1.0-Nov formula five
Wherein, Nov is Distribution Value, and RimFactor is profile light distribution information because in the present embodiment NoV be 0 to 1 it Between numerical value, therefore using formula five may be implemented reverse phase processing, to determine profile light distribution information.
Illustratively, treated that profile light distribution information can be as shown in fig. 7, its marginal position be schematically in for reverse phase Reveal white, its corresponding profile light distribution information is 1.
S407, according to distribution of light sources information and default negative correlation model, obtain rim(ming) light thickness coefficient, wherein preset negative Correlation model is used to indicate the negative correlativing relation between distribution of light sources information and profile thickness coefficient.
In the present embodiment, it can control the rim(ming) light of game object, by adjusting profile light distribution information to guarantee When light source direction is identical with direction of visual lines, the light-receiving surface of game object is not in large-scale exposure, therefore also needs basis Distribution of light sources information is adjusted profile light distribution information, shows reasonability to promote the rim(ming) light of game object.
Specifically, rim(ming) light thickness coefficient is the coefficient for being used to indicate the thickness of rim(ming) light, wherein rim(ming) light thickness coefficient Specific effect can be found in Fig. 8, the corresponding rim(ming) light (wheel shown of thickness coefficient of 6 different rim(ming) lights is given in Fig. 8 The soft degree of wide light is fixed), wherein being from left to right respectively obtained when rim(ming) light thickness coefficient is arranged from 0 to 1 The expression effect of rim(ming) light.
As can be seen from Figure 8, rim(ming) light thickness coefficient is smaller, and the profile optical range showed is bigger, therefore in fig. 8 With the increase of from left to right rim(ming) light thickness coefficient, gradually thinning state is presented in the rim(ming) light of game object, and finally disappears It loses on the surface of game object.
It is understood that when user observes game object, it is assumed that light source direction is in the left side of game object, in order to protect The reasonability that shows of card rim(ming) light, it is therefore desirable to the profile optical range that light-receiving surface (left side of game object) is arranged is larger, from by The profile optical range of smooth surface to penumbra is gradually reduced, and rim(ming) light is not presented in shady face, corresponding, needs that game pair is arranged When as light-receiving surface (the corresponding brightness value of the first angle is bigger), rim(ming) light thickness coefficient is a lesser value (profile optical range Greatly), when game object is not light-receiving surface (the corresponding brightness value of the first angle is smaller), rim(ming) light thickness coefficient is one biggish Value (profile optical range reduces until rim(ming) light is not presented), i.e., should be corresponding between distribution of light sources information and rim(ming) light thickness coefficient Negative correlativing relation is presented.
Therefore, the preset negative relevant mode being provided in the present embodiment between distribution of light sources information and rim(ming) light thickness coefficient Type, wherein default negative correlation model is used to indicate the negative correlativing relation between distribution of light sources information and profile thickness coefficient, below A kind of possible implementation of default negative correlation model is introduced by taking formula six as an example:
RimWide=1.2-NoL_org × 0.5 × cRimWide formula six
Wherein, RimWide is rim(ming) light thickness coefficient, and NoL_org indicates the corresponding brightness value of the first angle, cRimWide It is the rim(ming) light thickness factor, is used for adjustment profile light thickness coefficients R imWide, wherein with the increase of cRimWide, RimWide can accordingly reduce, and can voluntarily be configured according to actual needs, referring to formula six, distribution of light sources information i.e. and Rim(ming) light thickness coefficient is inversely prroportional relationship.
Specifically, the range of NoL_org is -1 to 1 in the present embodiment, the default negative correlation introduced referring to above-mentioned formula six Model, it is assumed that cRimWide 1, when vertex is located at light-receiving surface, NoL_org 1, corresponding RimWide are 0.7;Work as vertex When positioned at penumbra, NoL_org 0, corresponding RimWide are 1.2;When vertex is located at shady face, NoL_org be- 1, corresponding RimWide are 1.7, therefore the reduction with brightness value NoL_org from 1 to -1, corresponding rim(ming) light thickness coefficient RimWide is increased with it, and the profile optical range shown is also smaller and smaller, so that the profile luminous energy that game object shows The direction of enough accurately reflection main light sources.
And in conjunction with Fig. 8 it is clear that, when RimWide is 1, the rim(ming) light on game object surface is just substantially It disappears, referring to above-mentioned introduction, before NoL_org is decreased to 0, corresponding RimWide has just had exceeded 1 range, right The effect that should be presented be game object each vertex since light-receiving surface to the place for having not arrived shadow line, game object The rim(ming) light that shows of edge just faded away, to ensure that the shady face of game object is not in profile Light, i.e. rim(ming) light only appear in the light-receiving surface side of game object, to increase the reasonability that game object shows rim(ming) light.
In an alternate embodiment of the invention, referring to Fig. 8 A, when rim(ming) light thickness coefficient is 0, the profile optical range showed is most Greatly, be similar to the state that rim(ming) light is presented in all vertex, the present invention when camera direction is consistent with main light source direction, Need to guarantee that game object will not show the exposure of large area, it is therefore desirable to which rim(ming) light thickness coefficient is set so that game Object will not show the state of the leftmost side Fig. 8 game object.
(i.e. the first angle corresponding brightness value) is closed in inverse proportion specifically, rim(ming) light thickness coefficient and distribution of light sources information System, therefore in rim(ming) light thickness coefficient minimum, there should be the corresponding brightness value of the first angle maximum (for 1), accordingly to keep away Exempt from the state for leftmost side game object in Fig. 8 occur, it is therefore desirable to which setting is maximum (for 1) in the corresponding brightness value of the first angle When, corresponding rim(ming) light thickness coefficient is minimum but is not 0, and referring to formula six, when vertex is located at light-receiving surface, NoL_org is 1, corresponding RimWide are 0.7, although so that the state comparison for the rim(ming) light that the light-receiving surface of game object shows is thick, But also it is unlikely to the state for large area exposure occur.
Above-mentioned formula six is a kind of schematical introduction, it will be understood by those skilled in the art that numerical value therein, ginseng Number can also be replaced, as long as default negative correlation model can indicate the negative between the second angle and rim(ming) light thickness coefficient Pass relationship, and guarantee that corresponding rim(ming) light thickness coefficient is not 0 in the corresponding brightness value maximum of the second angle, this Embodiment to this with no restriction.
S408, according to rim(ming) light thickness coefficient adjustment profile light distribution information, to control the rim(ming) light of game object, In, rim(ming) light thickness coefficient is according to distribution of light sources information acquisition, and rim(ming) light thickness coefficient is used to indicate the thickness of rim(ming) light.
Specifically, the implementation of S408 is similar with S303.
It is worth noting that on the vertex of marginal position, rim(ming) light, therefore the present embodiment should not do not showed In be only " profile light distribution information " is adjusted according to rim(ming) light thickness coefficient, and wherein profile light distribution information indicate Be rim(ming) light position, that is to say, that the present embodiment is only adjusted the rim(ming) light of the marginal position of game object, with The reasonability that rim(ming) light is presented in enhancing game object will not show rim(ming) light, simultaneously for not being the vertex of marginal position The lighting effect that the present embodiment shows it not will do it processing.
When light source direction is consistent with the direction of video camera, the position of rim(ming) light indicated by profile light distribution information is The position of the two sides of game object, therefore the center (non-edge position) of game object will not show rim(ming) light.
Meanwhile the corresponding brightness value of the first angle (NoL_org) and the corresponding Distribution Value of the second angle (NoV) are one at this time Sample, when Distribution Value is 0, indicate that the vertex is located at the marginal position of game object, and when brightness value is 0, indicate the vertex Positioned at the intersection of light-receiving surface and shady face, therefore marginal position will not show rim(ming) light, so as to avoid the prior art In when light source direction is consistent with the direction of video camera caused game object a wide range of exposure, enhance game object presentation The reasonability of state.
In one possible implementation, the present embodiment can also be according to the soft coefficient in rim(ming) light edge or/and default Interpolation model is adjusted profile light distribution information, wherein default interpolation model is for the distribution to profile light distribution information Range is adjusted, and the soft coefficient in rim(ming) light edge is used to indicate the soft degree of rim(ming) light.
Soft degree indicated by the soft coefficient of rim(ming) light is illustrated below with reference to Fig. 8 B, gives difference in Fig. 8 B The corresponding rim(ming) light shown of the soft coefficient of 6 rim(ming) lights effect (wherein rim(ming) light thickness is fixed), wherein from a left side The expression effect of obtained rim(ming) light when to right respectively setting rim(ming) light thickness coefficient from 0 to 1.
It can be seen from fig. 8b that the soft coefficient of rim(ming) light is bigger, the rim(ming) light showed is softer, therefore in the fig. 8b With the increase of from left to right rim(ming) light thickness coefficient, gradually soft state is presented in the rim(ming) light of game object, can be observed The state of the rim(ming) light showed to game object is more lively.
In one possible implementation, presetting interpolation model is smooth interpolation model, wherein the smooth interpolation mould Type is used to generating the profile light distribution information of script into the smooth excessiveness between the range after interpolation, to realize to rim(ming) light point The smooth increase or reduction of the range of cloth coefficient, so that the rim(ming) light that game object shows is more lively.
A kind of possible implementation is introduced by taking formula seven as an example below:
Rim=smoothstep (RimWide-RimSoftness, RimWide+RimSoftness, RimFactor) formula seven
Wherein, RimWide is rim(ming) light thickness coefficient, and RimSoftness is the soft coefficient in rim(ming) light edge, RimFactor is profile light distribution information, and rim is the range of rim(ming) light, is used to indicate the state that final rim(ming) light shows, Smoothstep function therein is smooth interpolation function, and the function is introduced first below.
Smooth interpolation function is introduced first, such as has smoothstep (a, b, x), wherein a, b are interpolation parameter, X is interpolation variable, then the effect of smooth interpolation function is the smooth transition generated between 0 to the 1 of interpolation variable x, specifically , it can refer to the following table 1:
Table 1
Below with reference to formula seven citing be illustrated, it is assumed that RimWide 0.5, RimSoftness 0.3, then correspond to a, B is respectively 0.3 and 0.8, and RimFactor (profile light distribution information) range of script is 0 to 1 in embodiment, by smooth Interpolation, can be right by the Ratage Coutpressioit of profile light distribution information in 0.3-0.8, so that the comparison of rim(ming) light is stronger The rim(ming) light answered is also just sharper keen.
Referring to Fig. 7 and Fig. 9, state in Fig. 9 is the rim(ming) light when RimWide be 0.5, RimSoftness is 0.3 The state shown, it can be seen that rim(ming) light presents sharper keen state.
Or, it is assumed that interpolation parameter a, b is respectively -0.3 and 1.7, then the range of corresponding profile light distribution information will It is extended between -0.3 to 1.7, thus the comparison of weakened outline light, so that rim(ming) light shows softer state.
The above is only combine smoothstep function carry out illustrative introduction, not unique implementation, wherein Default interpolation model can be set according to actual needs, the present embodiment to default interpolation model with no restriction, if its It can be realized the change of the range to profile light distribution information.
It will be understood by those skilled in the art that combined according to the soft coefficient in rim(ming) light edge, default interpolation model above And rim(ming) light thickness coefficient is adjusted the introduction of progress to profile light distribution information, however the soft coefficient of above-mentioned rim(ming) light It is for default interpolation model so that the effect of rim(ming) light performance is more lively and setting, therefore the present embodiment can root Profile light distribution information is adjusted according to the soft coefficient of rim(ming) light thickness coefficient and rim(ming) light edge or/and default interpolation model It is whole, profile light distribution information can also be adjusted according only to rim(ming) light thickness coefficient, can be corresponded to so that game pair As the rim(ming) light showed accurately reflects light source direction, implementation is similar with above-mentioned introduction, and details are not described herein again.
Wherein, profile light distribution information refers specifically to the specific range of the display position for having shown rim(ming) light and display, thus According to profile light distribution information adjusted, controls game object and show corresponding rim(ming) light, in conjunction with Fig. 9 B to game object The rim(ming) light showed is illustrated, and has been put on display in Fig. 9 B in the case where light source direction is constant, and video camera is seen from all angles The rim(ming) light that game object is shown when examining game object, wherein from left to right, as light source direction and camera direction are more next Closer, the range of exposures of the corresponding illumination shown is increasing, rim(ming) light (the game object performance of corresponding game object Brighter region) be always able to reflect the direction of light source, while when light source direction is consistent with camera direction (rightmost State), game object would not show rim(ming) light, and correspondence will not show the exposure of large area.
The method of profile photocontrol provided in an embodiment of the present invention, comprising: obtain each top of light source direction and game object The first angle between the normal direction of point.According to the corresponding relationship between preset angle and brightness value, each vertex pair is obtained The corresponding brightness value of the first angle answered, wherein brightness value is used to indicate the brightness on vertex.According to the first of each vertex correspondence the folder The corresponding brightness value in angle, obtains distribution of light sources information.Between the normal direction for obtaining each vertex of direction of visual lines and game object The second angle.According to the corresponding relationship between preset angle and Distribution Value, the second angle for obtaining each vertex correspondence is corresponding Distribution Value, wherein Distribution Value is used to indicate whether vertex is located at outline position.It is corresponding according to the second angle of each vertex correspondence Distribution Value, obtain profile light distribution information.According to distribution of light sources information and default negative correlation model, rim(ming) light thickness system is obtained Number, wherein default negative correlation model is used to indicate the negative correlativing relation between distribution of light sources information and profile thickness coefficient.According to Rim(ming) light thickness coefficient adjustment profile light distribution information, to control the rim(ming) light of game object, wherein rim(ming) light thickness coefficient is According to distribution of light sources information acquisition, rim(ming) light thickness coefficient is used to indicate the thickness of rim(ming) light.Believed by setting distribution of light sources Negative correlativing relation between breath and profile thickness coefficient, secondly according to the soft coefficient of rim(ming) light thickness coefficient and rim(ming) light edge And/or default interpolation model, profile light distribution information is adjusted, with controlling profile light, wherein when light source direction and camera shooting When machine direction is consistent, only the position of the two sides of the game object indicated by profile light distribution information shows rim(ming) light, and game The non-edge position of object will not show rim(ming) light, cause so as to avoid when light source direction is consistent with the direction of video camera Game object a wide range of exposure, enhance game object be in present condition reasonability.
Figure 10 is the structural schematic diagram one of the device of profile photocontrol provided in an embodiment of the present invention.As shown in Figure 10, should Device 100 includes: to obtain module 1001 and adjustment module 1002.
Module 1001 is obtained, for according to the first folder between light source direction and the normal direction on each vertex of game object Angle obtains distribution of light sources information;
Module 1001 is obtained, is also used between the normal direction according to each vertex of direction of visual lines and the game object Second angle obtains profile light distribution information;
Module 1002 is adjusted, the profile light distribution information according to rim(ming) light thickness coefficient adjustment is used for, described in control The rim(ming) light of game object, wherein the rim(ming) light thickness coefficient is according to the distribution of light sources information acquisition, the profile Light thickness coefficient is used to indicate the thickness of rim(ming) light.
In a kind of possible design, the acquisition module 1001 is specifically used for:
Obtain the first angle between the normal direction on each vertex of light source direction and game object;
According to the corresponding relationship between preset angle and brightness value, the first angle for obtaining each vertex correspondence is corresponding Brightness value, wherein the brightness value is used to indicate the brightness on vertex;
According to the corresponding brightness value of the first angle of each vertex correspondence, the distribution of light sources information is obtained.
In a kind of possible design, the acquisition module 1001 is specifically used for:
Obtain the second angle between the normal direction on each vertex of direction of visual lines and the game object;
According to the corresponding relationship between preset angle and Distribution Value, the second angle for obtaining each vertex correspondence is corresponding Distribution Value, wherein the Distribution Value is used to indicate whether vertex is located at outline position;
According to the corresponding Distribution Value of the second angle of each vertex correspondence, the profile light distribution information is obtained.
In a kind of possible design, in the corresponding relationship between the preset angle and Distribution Value, angle and distribution It is worth negative correlation;
The acquisition module 1001 is specifically used for:
Reverse phase processing is carried out to the corresponding Distribution Value of the second angle of each vertex correspondence, obtains the profile light distribution Information.
Device provided in this embodiment can be used for executing the technical solution of above method embodiment, realization principle and skill Art effect is similar, and details are not described herein again for the present embodiment.
Figure 11 is the structural schematic diagram two of the device of profile photocontrol provided in an embodiment of the present invention.As shown in figure 11, exist On the basis of Figure 10, further includes: determining module 1103;
In a kind of possible design, the determining module 1103, for according to the distribution of light sources information and preset negative Correlation model obtains rim(ming) light thickness coefficient, wherein the default negative correlation model be used to indicate the distribution of light sources information and Negative correlativing relation between the profile thickness coefficient.
In a kind of possible design, the adjustment module 1102 is also used to:
According to the soft coefficient in rim(ming) light edge or/and default interpolation model, the profile light distribution information is adjusted, Wherein, the default interpolation model is for being adjusted the distribution of the profile light distribution information.
In a kind of possible design, the default interpolation model is smooth interpolation model.
Device provided in this embodiment can be used for executing the technical solution of above method embodiment, realization principle and skill Art effect is similar, and details are not described herein again for the present embodiment.
Figure 12 is the hardware structural diagram of electronic equipment provided in an embodiment of the present invention, as shown in figure 12, the present embodiment Electronic equipment 120 include: processor 1201 and memory 1202;Wherein
Memory 1202, for storing computer executed instructions;
Processor 1201, for executing the computer executed instructions of memory storage, to realize profile in above-described embodiment Each step performed by the method for photocontrol.It specifically may refer to the associated description in preceding method embodiment.
Optionally, memory 1202 can also be integrated with processor 1201 either independent.
When memory 1202 is independently arranged, which further includes bus 1203, for connecting the memory 1202 and processor 1201.
The embodiment of the present invention also provides a kind of computer readable storage medium, stores in the computer readable storage medium There are computer executed instructions, when processor executes the computer executed instructions, realizes wheel performed by electronic equipment as above The method of wide photocontrol.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, apparatus embodiments described above are merely indicative, for example, the division of the module, only Only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple modules can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or module It connects, can be electrical property, mechanical or other forms.
The above-mentioned integrated module realized in the form of software function module, can store and computer-readable deposit at one In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) or processor (English: processor) execute this Shen Please each embodiment the method part steps.
It should be understood that above-mentioned processor can be central processing unit (English: Central Processing Unit, letter Claim: CPU), can also be other general processors, digital signal processor (English: Digital Signal Processor, Referred to as: DSP), specific integrated circuit (English: Application Specific Integrated Circuit, referred to as: ASIC) etc..General processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with hair The step of bright disclosed method, can be embodied directly in hardware processor and execute completion, or with hardware in processor and soft Part block combiner executes completion.
Memory may include high speed RAM memory, it is also possible to and it further include non-volatile memories NVM, for example, at least one Magnetic disk storage can also be USB flash disk, mobile hard disk, read-only memory, disk or CD etc..
Bus can be industry standard architecture (Industry Standard Architecture, ISA) bus, outer Portion's apparatus interconnection (Peripheral Component, PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, EISA) bus etc..Bus can be divided into address bus, data/address bus, control Bus etc..For convenient for indicating, the bus in illustrations does not limit only a bus or a type of bus.
Above-mentioned storage medium can be by any kind of volatibility or non-volatile memory device or their combination It realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable Read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, Disk or CD.Storage medium can be any usable medium that general or specialized computer can access.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (10)

1. a kind of method of profile photocontrol characterized by comprising
According to the first angle between light source direction and the normal direction on each vertex of game object, distribution of light sources information is obtained;
According to the second angle between the normal direction on each vertex of direction of visual lines and the game object, profile light distribution is obtained Information;
According to profile light distribution information described in rim(ming) light thickness coefficient adjustment, to control the rim(ming) light of the game object, wherein The rim(ming) light thickness coefficient is according to the distribution of light sources information acquisition, and the rim(ming) light thickness coefficient is used to indicate profile The thickness of light.
2. the method according to claim 1, wherein described according to each vertex of light source direction and game object The first angle between normal direction, obtains distribution of light sources information, comprising:
Obtain the first angle between the normal direction on each vertex of light source direction and game object;
According to the corresponding relationship between preset angle and brightness value, the first angle for obtaining each vertex correspondence is corresponding bright Angle value, wherein the brightness value is used to indicate the brightness on vertex;
According to the corresponding brightness value of the first angle of each vertex correspondence, the distribution of light sources information is obtained.
3. the method according to claim 1, wherein each top according to direction of visual lines and the game object The second angle between the normal direction of point, obtains profile light distribution information, comprising:
Obtain the second angle between the normal direction on each vertex of direction of visual lines and the game object;
According to the corresponding relationship between preset angle and Distribution Value, corresponding point of the second angle of each vertex correspondence is obtained Implantation, wherein the Distribution Value is used to indicate whether vertex is located at outline position;
According to the corresponding Distribution Value of the second angle of each vertex correspondence, the profile light distribution information is obtained.
4. according to the method described in claim 3, it is characterized in that, corresponding relationship between the preset angle and Distribution Value In, angle and Distribution Value negative correlation;
According to the corresponding Distribution Value of the second angle of each vertex correspondence, the profile light distribution information is obtained, comprising:
Reverse phase processing is carried out to the corresponding Distribution Value of the second angle of each vertex correspondence, obtains the profile light distribution letter Breath.
5. the method according to claim 1, wherein the method also includes:
According to the distribution of light sources information and default negative correlation model, rim(ming) light thickness coefficient is obtained, wherein the default negative It closes model and is used to indicate the negative correlativing relation between the distribution of light sources information and the profile thickness coefficient.
6. the method according to claim 1, wherein the method also includes:
According to the soft coefficient in rim(ming) light edge or/and default interpolation model, the profile light distribution information is adjusted, In, the default interpolation model is for being adjusted the distribution of the profile light distribution information.
7. according to the method described in claim 6, it is characterized in that, the default interpolation model is smooth interpolation model.
8. a kind of device of profile photocontrol characterized by comprising
Module is obtained, for obtaining according to the first angle between light source direction and the normal direction on each vertex of game object Distribution of light sources information;
The acquisition module, second be also used between the normal direction according to each vertex of direction of visual lines and the game object Angle obtains profile light distribution information;
Module is adjusted, the profile light distribution information according to rim(ming) light thickness coefficient adjustment is used for, to control the game object Rim(ming) light, wherein the rim(ming) light thickness coefficient be according to the distribution of light sources information acquisition, rim(ming) light thickness system Number is used to indicate the thickness of rim(ming) light.
9. a kind of electronic equipment characterized by comprising
Memory, for storing program;
Processor, for executing the described program of the memory storage, when described program is performed, the processor is used for Execute the method as described in any in claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that including instruction, when run on a computer, make to succeed in one's scheme Calculation machine executes the method as described in any in claim 1 to 7.
CN201910633944.5A 2019-07-15 2019-07-15 Contour light control method and device Active CN110354499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910633944.5A CN110354499B (en) 2019-07-15 2019-07-15 Contour light control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910633944.5A CN110354499B (en) 2019-07-15 2019-07-15 Contour light control method and device

Publications (2)

Publication Number Publication Date
CN110354499A true CN110354499A (en) 2019-10-22
CN110354499B CN110354499B (en) 2023-05-16

Family

ID=68219139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910633944.5A Active CN110354499B (en) 2019-07-15 2019-07-15 Contour light control method and device

Country Status (1)

Country Link
CN (1) CN110354499B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130072302A1 (en) * 2010-06-11 2013-03-21 Sony Computer Entertainment Inc. Game device, game control method, and game control program configured to control a game in which a character is moved along a shadow
CN104574495A (en) * 2014-12-22 2015-04-29 北京像素软件科技股份有限公司 Method and device for rendering image
CN107481304A (en) * 2017-07-31 2017-12-15 广东欧珀移动通信有限公司 The method and its device of virtual image are built in scene of game
WO2018226264A1 (en) * 2017-06-04 2018-12-13 Apple Inc. User interface camera effects
CN109242794A (en) * 2018-08-29 2019-01-18 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and computer readable storage medium
CN109985384A (en) * 2019-03-21 2019-07-09 网易(杭州)网络有限公司 Textures dynamic adjusting method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130072302A1 (en) * 2010-06-11 2013-03-21 Sony Computer Entertainment Inc. Game device, game control method, and game control program configured to control a game in which a character is moved along a shadow
CN104574495A (en) * 2014-12-22 2015-04-29 北京像素软件科技股份有限公司 Method and device for rendering image
WO2018226264A1 (en) * 2017-06-04 2018-12-13 Apple Inc. User interface camera effects
CN107481304A (en) * 2017-07-31 2017-12-15 广东欧珀移动通信有限公司 The method and its device of virtual image are built in scene of game
CN109242794A (en) * 2018-08-29 2019-01-18 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and computer readable storage medium
CN109985384A (en) * 2019-03-21 2019-07-09 网易(杭州)网络有限公司 Textures dynamic adjusting method and device

Also Published As

Publication number Publication date
CN110354499B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
US20180164592A1 (en) System and method for foveated image generation using an optical combiner
CN112316420B (en) Model rendering method, device, equipment and storage medium
CN102708585B (en) Method for rendering contour edges of models
EP2705501B1 (en) Texturing in graphics hardware
CN109985384A (en) Textures dynamic adjusting method and device
US7982734B2 (en) Spatially-varying convolutions for rendering soft shadow effects
US7852350B2 (en) Graphic antialiasing method and graphic system employing the method
CN107220925A (en) A kind of real accelerating method and device of real-time virtual
US20070046665A1 (en) Apparatus and program for image generation
US8169439B2 (en) Scalar precision float implementation on the “W” lane of vector unit
TWI300908B (en) Video game system, image rendering system, and computer-readable medium having stored thereon a program of computer-readable instructions configured to cause generation of a renderized display
JP2007054092A (en) Display device, its control method and game machine
CN106780313A (en) Image processing method and device
CN113302658A (en) Parallel texture sampling
McReynolds et al. Programming with opengl: Advanced rendering
CN109903374A (en) Eyeball analogy method, device and the storage medium of virtual objects
CN110354499A (en) The method and device of profile photocontrol
US6982717B2 (en) Game apparatus, storage medium and computer program
US20110102449A1 (en) Image Display Device, Image Display Method and Computer-Readable Information Recording Medium
JP2002092633A (en) Game system and information storage medium
WO2023005631A1 (en) Rendering method and apparatus, and storage medium
JP2009110362A (en) Image generation device and image generation program
US20200027250A1 (en) Adaptive three-dimensional space generation method and system
Liu et al. Depth of field synthesis from sparse views
Nguyen Low-latency mixed reality headset

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