CN108230436A - The rendering intent of virtual resource object in three-dimensional scenic - Google Patents
The rendering intent of virtual resource object in three-dimensional scenic Download PDFInfo
- Publication number
- CN108230436A CN108230436A CN201711308406.6A CN201711308406A CN108230436A CN 108230436 A CN108230436 A CN 108230436A CN 201711308406 A CN201711308406 A CN 201711308406A CN 108230436 A CN108230436 A CN 108230436A
- Authority
- CN
- China
- Prior art keywords
- water body
- virtual
- body object
- vertex
- virtual resource
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
- G06T15/55—Radiosity
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/60—Methods for processing data by generating or executing the game program
- A63F2300/66—Methods for processing data by generating or executing the game program for rendering three dimensional images
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Geometry (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses rendering intent, device, storage medium, processor and the terminals of virtual resource object in a kind of three-dimensional scenic, applied to the electronic equipment comprising a display unit and a camera unit, virtual resource object includes virtual water body object and default virtual resource object, this method include:The image of reality scene is captured, and using the image of reality scene as one three-dimensional scenic of background constructing by the camera unit of electronic equipment;Determine first position of the virtual water body object in three-dimensional scenic and the second position of the default virtual resource object in three-dimensional scenic, wherein, virtual water body object is the three-dimensional structure with top surface and side, and it is the virtual resource object for not writing depth buffer to preset virtual objects;The image of the reality scene captured according to the camera unit of electronic equipment determines an observation position in three-dimensional scenic;According to the rendering order between first position, the second position and the observation virtual water body object of location determination and default virtual resource object;Virtual water body object and default virtual resource object are rendered according to rendering order.The present invention solves water body rendering effect and the technical issues of efficiency can not be taken into account and can not interact.
Description
Technical field
The present invention relates to field of Computer Graphics, in particular to virtual resource object in a kind of three-dimensional scenic
Rendering intent, device, storage medium, processor and terminal.
Background technology
The essence of Real-time Rendering Technology is that the real-time of graph data is calculated and exported.In the situation that computing capability is limited
Under, it can rapidly render virtual element true to nature by some simple analogy methods.
In fluid emulation simulation field, the method for more common simulation water can be divided into particle method and gridding method.Grain
Sub- method, which splits water body, becomes multiple particles, and by Navier Stokes equation, (describing viscosity in field of fluid mechanics can not press
The equation of motion of contracting fluid momentum conservation) or location-based density estimation scheduling algorithm calculate interparticle interaction
Power, so as to which particle movement be driven to carry out the effect of simulation water.Grid rule is that water area is divided into grid, also according to receiving
The formula such as dimension-stokes equation (are made of to calculate the velocity field of each grid the velocity vector on each moment, every bit
Field) and density field (on each moment, every bit density composition field), then again using Rendering algorithms according to density field come
Draw water-outlet body.
In game real-time rendering field, especially in game of mobile terminal, since computing capability is limited, water body rendering side
Formula only renders the surface of water body.The surface of water body is made of a plane, and by vertex shader, (it is one group of instruction generation
Code, this group of instruction code perform when vertex is rendered) carry out the displacement on control plane vertex, so as to simulate the wave of water surface
And ripples, then by piece member tinter, (it is one group of instruction code, is performed after vertex shader, and instruction code is used again
Calculated in execution diffusing reflection and/or mirror-reflection illumination) to colour for plane, so that the plane seems that approximation one is complete
The surface of whole water body.
Water model, rendering and interaction in the application of mobile terminal there is problems:
(1) water body in existing game real-time rendering field is completed based on a plane (i.e. the side of shortage water body)
It renders.And in mobile terminal application (for example, AR applications), due to needing dummy object being reasonably placed on real space
In, therefore, it is necessary to water body is cut into a stereo block to present.In other words, it can be seen that the side and bottom surface of water body.Thus may be used
See, the mode of existing real-time rendering water body cannot be used directly in AR applications.
(2) due to the particularity of AR platforms, virtual water body needs carry out true environment some refractions to enhance void
The substitution sense merged in fact, the i.e. background of water body behind are the pictures arrived by game player using photographic device captured in real-time.
During AR developments of games, the picture by water refraction is unknown, but the background of the water body behind in common game field
It is then known.
(3) water that existing mobile platform is related to more shows as sea, since seawater typically represents the side of scene of game
A seawater levels may be used to replace in the not enterable region in boundary, i.e. game player, therefore, seawater, without regard to trip
Play player visual angle under water with the situation of Inlet and outlet water, without the interaction situation for considering game player and seawater.However, it is put down in AR
On platform, since the handheld device of game player is player visual angle, can be watched in any position in virtual world
Dummy object, and then need to consider player visual angle under water, outside water, Inlet and outlet water, the object that game player tosses enters in water,
So that seawater present it is different can interaction effect.
(4) the usually used analogy method in fluid simulation field can simulate concept (the i.e. area of simulation water of " body "
Domain is an entity rather than a housing), still, this kind of analogy method (is all needed for the consumption of performance is high per frame image
Calculate the stressing conditions of each particle and simulate the direction of motion of each particle), so can not apply in mobile terminal.
Invention content
At least part embodiment of the present invention provide the rendering intent of virtual resource object in a kind of three-dimensional scenic, device,
Storage medium, processor and terminal, the technology that can not be taken into account and can not interact at least to solve water body rendering effect and efficiency are asked
Topic.
According to a wherein embodiment of the invention, a kind of rendering intent of virtual resource object in three-dimensional scenic is provided, it should
To contain a display unit electronic equipment, virtual resource object includes virtual water body object and default virtual resource object, on
The method of stating includes:
Determine first position of the virtual water body object in three-dimensional scenic with default virtual resource object in three-dimensional scenic
The second position, wherein, virtual water body object is the three-dimensional structure with top surface and side, and default virtual objects is do not write depth
Spend the virtual resource object of caching;An observation position is determined in three-dimensional scenic;According to first position, the second position and observation position
Put the rendering order between determining virtual water body object and default virtual resource object;Virtual water body pair is rendered according to rendering order
As with default virtual resource object.
Optionally, according to first position, the second position and the observation virtual water body object of location determination and default virtual resource
The rendering order of object, including:If the line of the second position and observation position passes through first position, it is determined that default virtual resource
Object is rendered prior to virtual water body object.
Optionally, it before first position and the second position is determined, further includes:The top surface of virtual water body object is configured,
In, top surface is used for wave simulated;The side of virtual water body object is configured, wherein, side is used to three-dimensional special efficacy be presented, and in side
The grid surface quantity that each side is included is less than the grid surface quantity that top surface is included;Each vertex respectively on top surface with
And each apex configuration priming color on side, wherein, priming color is used to identify in virtual water body object and each vertex
Corresponding region.
Optionally, each apex configuration priming color on each vertex and side respectively on top surface includes:It will
The value of first Color Channel on each vertex on top surface is set as true;By each top on first part side
The value of second Color Channel of point is set as true, wherein, first part side is surface adjacent with top surface in side;
The value of the third Color Channel on each vertex on second part side is set as true, wherein, second part side
It is other part side adjacent with first part side in side.
Optionally it is determined that the default virtual resource object includes prior to the virtual water body object rendering:Calculate first
The scalar product of vector and secondary vector, obtains the first result of calculation, wherein, primary vector is by plane each in top surface and side
Center and default virtual resource object position determine that secondary vector is the normal vector of each plane;Calculate the
Three vectors and the scalar product of secondary vector, obtain the second result of calculation, wherein, third vector is by the center of each plane
With observation location determination;The vector product of the first result of calculation and the second result of calculation is calculated, obtains third result of calculation;If
It was found that there are any result of calculations in third result of calculation corresponding with each plane to be less than or equal to 0, it is determined that default
Virtual resource object is rendered prior to virtual water body object.
Optionally, the virtual water body object is rendered according to the rendering order to include:To each on top surface and side
Vertex carry out vertex coloring processing, wherein, vertex coloring processing between virtual water body object and three-dimensional scenic to top surface
Space coordinate transformation is carried out with each vertex on side and is simulated for the part or all of apex configuration on top surface and side
Animation;Piece member coloring treatment is carried out to the pixel region by the covering of virtual water body object in three-dimensional scenic, wherein, at piece member coloring
It manages to mix color corresponding with pixel region in virtual water body object color and frame buffer.
Optionally, according to the rendering order render the virtual water body object and the default virtual resource object it
Afterwards, it further includes:Determine that observation position is switched to the inside of virtual water body object by the outside of virtual water body object;It obtains and virtual
The corresponding shader code in water body object inside simultaneously triggers display screen backstage treatment effect to simulate underweater vision, wherein, screen
It post-processes effect and includes at least one of:Linear mist, height mist, the scattering of surface sunlight, underwater bubble, the shoal of fish.
Optionally, according to the rendering order render the virtual water body object and the default virtual resource object it
Afterwards, it further includes:Determine that observation position is switched to the outside of virtual water body object by the inside of virtual water body object;It obtains and observes
The three-dimensional scenic of position adaptation, and refraction distortion processing is carried out to the three-dimensional scenic of adaptation.
According to a wherein embodiment of the invention, a kind of rendering device of virtual resource object in three-dimensional scenic is additionally provided,
Applied to comprising a display unit electronic equipment, virtual resource object includes virtual water body object and default virtual resource object,
Above device includes:
First determining module, for determining first position of the virtual water body object in three-dimensional scenic and default virtual resource
The second position of the object in three-dimensional scenic, wherein, virtual water body object is the three-dimensional structure with top surface and side, is preset
Virtual objects are the virtual resource object for not writing depth buffer;Second determining module, for determining an observation in three-dimensional scenic
Position;Third determining module, for according to first position, the second position and the virtual water body object of observation location determination and default void
Intend the rendering order between resource object;Rendering module, for rendering virtual water body object according to rendering order and presetting virtual
Resource object.
Optionally, third determining module, if the line for the second position and observation position passes through first position, it is determined that
Default virtual resource object is rendered prior to virtual water body object.
Optionally, above device further includes:Configuration module, for the top surface of virtual water body object to be configured, wherein, top surface is used
In wave simulated;Configuration module is additionally operable to be configured the side of virtual water body object, wherein, side is used to that three-dimensional special efficacy to be presented, and
The grid surface quantity that each side is included in side is less than the grid surface quantity that top surface is included;Configuration module, is additionally operable to point
Each apex configuration priming color on each vertex and side that Wei be on top surface, wherein, priming color is for identifying void
Intend the region with each vertex correspondence in water body object.
Optionally, configuration module includes:First dispensing unit, for first color on each vertex on top surface will to be located at
The value of channel is set as true;Second dispensing unit, for second color on each vertex on first part side will to be located at
The value of channel is set as true, wherein, first part side is surface adjacent with top surface in side;Third configuration is single
Member, for the value of the third Color Channel on each vertex being located on second part side to be set as true, wherein, second
Point side is other part side adjacent with first part side in side.
Optionally, third determining module includes:First computing unit, for calculating the quantity of primary vector and secondary vector
Product, obtains the first result of calculation, wherein, primary vector is virtual with presetting by the center of plane each in top surface and side
Resource object position determines that secondary vector is the normal vector of each plane;Second computing unit, for calculate third to
Amount and the scalar product of secondary vector, obtain the second result of calculation, wherein, third vector is the center and sight by each plane
Examine location determination;Third computing unit for calculating the vector product of the first result of calculation and the second result of calculation, obtains third
Result of calculation;Determination unit, for if it find that there are any calculating in third result of calculation corresponding with each plane
As a result it is less than or equal to 0, it is determined that default virtual resource object is rendered prior to virtual water body object.
Optionally, rendering module includes:First processing units, for carrying out vertex to each vertex on top surface and side
Coloring treatment, wherein, vertex coloring processing between virtual water body object and three-dimensional scenic to every on top surface and side
A vertex carries out space coordinate transformation and for the part or all of apex configuration simulation animation on top surface and side;Second processing
Unit, for carrying out piece member coloring treatment to the pixel region by the covering of virtual water body object in three-dimensional scenic, wherein, piece member
Color handles to mix color corresponding with pixel region in virtual water body object color and frame buffer.
Optionally, above device further includes:4th determining module, for determining observation position by the outer of virtual water body object
Portion switches to the inside of virtual water body object;First acquisition module, for obtaining coloring corresponding with inside virtual water body object
Device code simultaneously triggers display screen backstage treatment effect to simulate underweater vision, wherein, screen post processing effect include it is following at least
One of:Linear mist, height mist, the scattering of surface sunlight, underwater bubble, the shoal of fish.
Optionally, above device further includes:5th determining module, for determining observation position by virtual water body object
Portion switches to the outside of virtual water body object;Second acquisition module, for obtaining the three-dimensional scenic being adapted to observing position, and it is right
The three-dimensional scenic of adaptation carries out refraction distortion processing.
According to a wherein embodiment of the invention, a kind of storage medium is additionally provided, storage medium includes the program of storage,
In, equipment performs the rendering intent of above-mentioned virtual resource object where controlling storage medium when program is run.
According to a wherein embodiment of the invention, a kind of processor is additionally provided, processor is used to run program, wherein, journey
The rendering intent of virtual resource object in above-mentioned three-dimensional scenic is performed during sort run.
According to a wherein embodiment of the invention, a kind of terminal is additionally provided, including:One or more processors, memory,
Display device and one or more program, wherein, one or more programs are stored in memory, and be configured as by
One or more processors perform, and one or more programs are used to perform the rendering side of virtual resource object in above-mentioned three-dimensional scenic
Method.
In at least part embodiment of the present invention, using by determining virtual water body object first in three-dimensional scenic
The second position in three-dimensional scenic with default virtual resource object is put, wherein, virtual water body object is with top surface and side
Three-dimensional structure, preset virtual objects be the virtual resource object for not writing depth buffer;An observation is determined in three-dimensional scenic
Position;According between first position, the second position and the observation virtual water body object of location determination and default virtual resource object
Rendering order;Virtual water body object and default virtual resource object are rendered according to rendering order, reached real in augmented reality
The purpose of water body can be now interacted, it is achieved thereby that the technique effect that practicability is relatively low compared with strong, performance consumption, and then solve water body
The technical issues of rendering effect and efficiency can not be taken into account and can not interact.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and forms the part of the application, this hair
Bright illustrative embodiments and their description do not constitute improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the flow according to the rendering intent of virtual resource object in the present invention wherein three-dimensional scenic of an embodiment
Figure;
Fig. 2 is the virtual water body object schematic diagram according to a wherein preferred embodiment of the invention;
Fig. 3 is the vertex color configuration schematic diagram according to a wherein preferred embodiment of the invention;
Fig. 4 is the spray area schematic according to a wherein preferred embodiment of the invention;
Fig. 5 is the underwater environment schematic diagram according to a wherein preferred embodiment of the invention;
Fig. 6 is the seabed effect diagram according to a wherein preferred embodiment of the invention;
Fig. 7 is the sight held according to the game player of a wherein preferred embodiment of the invention after AR equipment is removed from water
See effect diagram;
Fig. 8 is the structure diagram according to the present invention wherein rendering device of the virtual resource object of an embodiment;
Fig. 9 is the structure diagram according to the present invention wherein rendering device of the virtual resource object of a preferred embodiment.
Specific embodiment
In order to which those skilled in the art is made to more fully understand the present invention program, below in conjunction in the embodiment of the present invention
The technical solution in the embodiment of the present invention is clearly and completely described in attached drawing, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's all other embodiments obtained without making creative work should all belong to the model that the present invention protects
It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way
Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment
Those steps or unit clearly listed, but may include not listing clearly or for these processes, method, product
Or the intrinsic other steps of equipment or unit.
According to a wherein embodiment of the invention, a kind of embodiment of the rendering intent of virtual resource object is provided, is needed
Illustrate, step shown in the flowchart of the accompanying drawings can be in the computer system of such as a group of computer-executable instructions
It performs, although also, show logical order in flow charts, it in some cases, can be to be different from herein suitable
Sequence performs shown or described step.
Fig. 1 is the flow according to the rendering intent of virtual resource object in the present invention wherein three-dimensional scenic of an embodiment
Figure, as shown in Figure 1, this method is applied to the electronic equipment for including a display unit, virtual resource object includes virtual water body pair
As with default virtual resource object, this method comprises the following steps:
Step S11 determines first position of the virtual water body object in three-dimensional scenic with default virtual resource object three
The second position in scene is tieed up, wherein, virtual water body object is the three-dimensional structure with top surface and side, presets virtual objects
Not write the virtual resource object of depth buffer;
Step S12 determines an observation position;
Step S13, according to first position, the second position and the observation virtual water body object of location determination and default virtual resource
Rendering order between object;
Step S14 renders virtual water body object and default virtual resource object according to rendering order.
By above-mentioned steps, may be used by determining first position of the virtual water body object in three-dimensional scenic with presetting
The second position of the virtual resource object in three-dimensional scenic, wherein, virtual water body object is the three-dimensional knot with top surface and side
Structure body, it is the virtual resource object for not writing depth buffer to preset virtual objects;An observation position is determined in three-dimensional scenic;According to
Rendering order between first position, the second position and the observation virtual water body object of location determination and default virtual resource object;
Virtual water body object and default virtual resource object are rendered according to rendering order, water can be interacted by having reached the realization in augmented reality
The purpose of body, it is achieved thereby that the technique effect that practicability is relatively low compared with strong, performance consumption, and then solve water body rendering effect and
The technical issues of efficiency can not be taken into account and can not interact.
Above-mentioned electronic equipment can be but be not limited to:Smart mobile phone, headset equipment.
Above-mentioned observation position is virtual camera position.
Optionally, in step s 13, according to first position, the second position and the virtual water body object of observation location determination and
The rendering order of default virtual resource object can include step performed below:
Step S131, if the line of the second position and observation position passes through first position, it is determined that default virtual resource pair
As being rendered prior to virtual water body object.
The line of the second position and observation position passes through first position, including:The line of the second position and observation position is worn
Cross virtual water body object range.In view of it is real solid structure that water body, which is not, but a cube of body case, for this purpose,
In water body coloring process, need to perform specific rendering order, i.e., when the line between video camera and default virtual resource object
When penetrating water body, these default virtual resource object needs are rendered before water body, to ensure that water body can be implemented to roll over to it
Penetrate effect;Otherwise, these default virtual resource objects will render after water body.In addition, delay for depth need not be written
Deposit (it is used for the depth for recording each pixel, its object is to:Common depth perception effect is properly generated, i.e. nearby object
Body blocks distant objects) object (such as:Particle effect, hundreds of particles ceaselessly convert distant relationships in a small range),
The rendering order needs of water body are dynamically adjusted according to video camera relative to the position relationship of water body.The above method can be with
Applied to the rendering of the virtual resource object in three-dimensional scenic, for example, three-dimensional scenic virtual resource object in augmented reality system
Rendering, can also be applied to other three-dimensional scenics in virtual resource object rendering (for example, 3d gaming).Augmented reality
(Augmented Reality, referred to as AR) technology is a kind of position for calculating camera image in real time and angle and adds
Respective image, video, threedimensional model technology.This technology aims at:Virtual world is nested in reality on the screen
The world simultaneously carries out interaction, can be by the way that true environment and dummy object are superimposed in real time on same picture, thus not only
The information of real world can be showed, but also virtual world can be shown, so that two kinds of information are complementary to one another
With being superimposed.
Below by with the application in augmented reality, above-mentioned specific rendering order is specifically described.By above-mentioned side
Method is applied in augmented reality, needs to consider the rendering to reality scene picture (background frame);The above method is applied general
In logical three-dimensional scenic, then it is not required to consider the rendering of reality scene picture.Firstly, since AR platforms need to reach virtual reality fusion
Therefore effect, needs to be used as background and renders to frame buffer at first, for screen institute by the real-time pictures taken by AR equipment
Show the direct image of picture, also known as bit map (Bit Map) or grating.Each storage unit of frame buffer corresponds to screen
On a pixel, entire frame buffer then correspond to a frame image.
Then, water body can be arranged in opaque article and be rendered later due to being transparent substance.Therefore, water is being rendered
During body, water body and the background previously having completed to render, opaque article, partially transparent object write on color in frame buffer into
Row mixing.
Since depth buffer is not written in part opaque article, i.e. GPU can be known, and the impermeable of depth buffer is not written
The color of bright object, but can not know the position relationship between this kind of opaque article and other objects, therefore, with water body
Rendering order needs that dynamic change occurs according to the relative position relation of visual angle and water body.Such as:When video camera and special efficacy ball are equal
When above water body, it should first render water body, then render effects ball.When video camera is in water, and special efficacy ball is outside water, it should
First render effects ball, then render water body.When video camera and special efficacy ball are all in water, it should first render water body, then render effects
Ball.
By controlling rendering order, not only ensure that special cube water column structure can be normal under different visual angles
It renders, so that water body is mutually merged with real background, achievees the effect that actual situation combines.
Optionally, the method includes:Rapid S10 captures the image of reality scene by the camera unit of electronic equipment, and
Using the image of reality scene as one three-dimensional scenic of background constructing.Can reality scene be captured by the camera unit of electronic equipment
Image identifies the characteristic point in the reality scene image, and the three of a realistic space is built on the basis of wherein several characteristic points
Dimension coordinate system, and the three-dimensional system of coordinate of realistic space is matched with the three-dimensional system of coordinate of Virtual Space, so as to fulfill with real field
The image of scape is one three-dimensional scenic of background constructing, and " actual situation mixed effect " to reach in augmented reality establishes space coordinate base
Plinth.In the specific implementation, existing SDK may be used, for example, ARKit.
Optionally, it in step S11, determines that before first position and the second position step performed below can also be included:
The top surface of virtual water body object is configured in step S15, wherein, top surface is used for wave simulated;
The side of virtual water body object is configured in step S16, wherein, side is used to three-dimensional special efficacy be presented, and each in side
The grid surface quantity that side is included is less than the grid surface quantity that top surface is included;
Each apex configuration priming color on each vertex and side on step S17, respectively top surface, wherein,
Priming color is used to identify the region in virtual water body object with each vertex correspondence.
In a preferred implementation process, the water model mode in existing game real-time rendering platform can be extended
(cube is expanded to by a plane) so that it can suitable for AR scenes, and to the top of virtual water body object
Face is optimized with side, it is made to improve performance as much as possible.
Specifically, cube is set as presenting to the model of water body, wherein, the cubical top surface face number is slightly more, is used for
The surface wave of seawater is showed, the cubical side face number is less and the cube is without bottom surface.
In the manufacturing process of virtual water body object, it may be determined that the color that each vertex is marked, i.e. vertex color.The top
In coloring, (when it refers in game running, graphics processor covers pixel on the screen for the virtual water body object to point color
The behavior of designated color) when for distinguishing different vertex.The different zones of water body can be distinguished by vertex color, such as:It is red
Represent the vertex on virtual water body object top surface, green represents the top half vertex in virtual water body subject side face, and blue represents
The lower half portion vertex in virtual water body subject side face, and then according to different vertex colors, virtual water body object is performed in coloring
Different coloring logical codes, so that the top surface of virtual water body object and side (including:Top half side and lower half portion side
Face) differentiation, water body effect true to nature is presented.Such as:In game running, it is attached that graphics processor (GPU) reads current vertex
The vertex color of band is red, but GPU has found that the vertex should be shown as blue after tinter is run by calculating, finally
GPU notify display screen by the vertex be shown as blue, will the vertex coloring for blue.
Optionally, in step S17, each apex configuration on each vertex and side respectively on top surface is initial
Color can include step performed below:
The value of first Color Channel on each vertex on top surface is set as true by step S171;
The value of second Color Channel on each vertex on first part side is set as true by step S172,
Wherein, first part side is surface adjacent with top surface in side;
The value of the third Color Channel on each vertex on second part side is set as true by step S173,
Wherein, second part side is other part side adjacent with first part side in side.
In virtual water body Object Process is configured, respectively each vertex assigns priming color to be distinguished in tinting stage
The coloring logic on the vertex.Each vertex is respectively provided with tetra- Color Channels of RGBA.For positioned at the vertex of top surface, R can be led to
Road is set as 1 (being true);For the vertex of top half side, G channels can be set as 1;For lower half portion side
Vertex, channel B can be set as 1.
Optionally, in step S12, an observation position is determined in three-dimensional scenic, including:The electronic equipment is taken the photograph comprising one
As unit, the image of the reality scene captured according to the camera unit of electronic equipment determines an observation position in three-dimensional scenic.
Characteristic point can be extracted from the image for the reality scene that the camera unit of electronic equipment captures, and is carried out according to the characteristic point
It calculates, the anti-position (position of point of observation) for releasing virtual camera.
Optionally, in step S12, an observation position is determined in three-dimensional scenic, including:The display list of the electronic equipment
Member is touch-display unit, true in three-dimensional scenic according to the touch control operation for the touch-display unit for acting on the electronic equipment
Fixed observation position.It for example, can be according to the click for the touch-display unit for acting on the electronic equipment or ability sliding touch
The position (observation position) of virtual camera in operation adjustment three-dimensional scenic.
Optionally, in step S131, determine that the default virtual resource object is rendered prior to the virtual water body object
It can include step performed below:
Step S1311 calculates the scalar product of primary vector and secondary vector, obtains the first result of calculation, wherein, first to
Amount is to be determined by the center of plane each in top surface and side with default virtual resource object position, secondary vector
Normal vector for each plane;
Step S1312 calculates the scalar product of third vector and secondary vector, obtains the second result of calculation, wherein, third to
Amount is by the center of each plane and observation location determination;
Step S1313 calculates the vector product of the first result of calculation and the second result of calculation, obtains third result of calculation;
Step S1314, if it find that there are any result of calculations in third result of calculation corresponding with each plane
Less than or equal to 0, it is determined that default virtual resource object is rendered prior to virtual water body object;It is otherwise, it determines default virtual
Resource object is later than virtual water body object and is rendered.
Assuming that the central point in virtual five faces of water body object is Pi, normal vector Ni, wherein, i=1 represents top surface, i=2-5
Four not ipsilaterals are represented respectively, in addition it is also supposed that default virtual resource object position is Po, the position of video camera is PV;
Then calculated using equation below:
Vi=((Po-Pi)·Ni)*((Pv-Pi)·Ni) i=1 ... 5
If for above-mentioned five faces, there is V in one face of any of whichi≤ 0 situation, then it represents that the default virtual resource pair
As needing to be rendered prior to virtual water body object;Otherwise, which will be later than virtual water body object and carry out
It renders.
Optionally, in step S14, following hold can be included by rendering the virtual water body object according to the rendering order
Row step:
Step S141 carries out vertex coloring processing to each vertex on top surface and side, wherein, vertex coloring processing is used
Space coordinate transformation and it is in being carried out between virtual water body object and three-dimensional scenic to each vertex on top surface and side
Part or all of apex configuration simulation animation on top surface and side;
Step S142 carries out piece member coloring treatment to the pixel region by the covering of virtual water body object in three-dimensional scenic,
In, piece member coloring treatment is used to mix color corresponding with pixel region in virtual water body object color and frame buffer.
Completion vertex spatial alternation is not only needed to also need to be located at top surface and side not in vertex coloring processing procedure
The different simulation animation with the apex configuration in region.The pixel that water body is covered mainly is calculated in piece member colouring process
Because of the water body color to be mixed.
Optionally, in step S14, the virtual water body object and the default virtual money are rendered according to the rendering order
After source object, step performed below can also be included:
Step S18 determines that observation position is switched to the inside of virtual water body object by the outside of virtual water body object;
Step S19 obtains shader code corresponding with inside virtual water body object and triggers the processing of display screen backstage and imitates
Fruit simulates underweater vision, wherein, screen post processing effect includes at least one of:Linear mist, height mist, surface sunlight dissipate
It penetrates, underwater bubble, the shoal of fish.
Since in AR platforms, player visual angle can freely be watched under water, therefore, need to post-process using screen under water
Effect and special efficacy avoid above-mentioned virtual water body object in flaw existing for effect display fermentation, wherein it is possible to including but it is unlimited
In:Linear mist (distance is more remote, and mist is denseer), height mist (closer to seabed, the navy blue effect in seabed is denseer), surface sunlight dissipates
It penetrates, underwater bubble, the shoal of fish.In addition, it is also necessary to dispersion effect of the seawater for sunlight is projected on seabed and Watership Down.
In a manner that screen post processing and visual angle trigger special efficacy in specific region, underwater effect is simulated.
Consider that player visual angle can be in virtual world under conditions of any position in AR platforms, by a variety of post-processing technologies truly
Reproduce the player visual angle underwater effect that different depth should be experienced under water.
Optionally, in step S14, the virtual water body object and the default virtual money are rendered according to the rendering order
After source object, step performed below can also be included:
Step S17 determines that observation position is switched to the outside of virtual water body object by the inside of virtual water body object;
Step S18 obtains the three-dimensional scenic being adapted to observation position, and the three-dimensional scenic of adaptation is carried out at refraction distortion
Reason.
Since game player can freely be come in and gone out water body in AR scenes with handheld device, it is raised in equipment under water
It is needed after waterborne, on screen there are the water droplet effect that camera lens is soaked in water, and the water droplet effect is over time, it can be by
Fade mistake, i.e., droplet is air cured.In addition, it is fallen into the AR scenes of water body in object.Water body can splash out spray special efficacy, and water body
Surface will appear ripples to external diffusion.
Adaptable feedback is provided for the interaction of virtual water body object for game player, so that game player is experiencing
When AR plays, there are the truly feels being personally on the scene.
Above-mentioned preferred implementation process is further described below in conjunction with a preferred embodiment.
In the preferred embodiment, part (one of i.e. entire ocean of one piece of water body can be presented in AR platforms solid
Part), water body can generate the real world of its behind certain refraction effect, and then show extremely true virtual reality fusion
Degree.In addition, by real-time rendering and screen post-processing technology, complete waterborne, underwater and visual angle Inlet and outlet water effect can be realized
To support the free-viewing angle of AR platforms.Dummy object that AR platforms are presented needs mutually merged with actual environment as much as possible with
And there is a degree of feedback for the interaction of game player.In this condition, it is also necessary to which efficient performance is as guarantee.
The preferred embodiment can specifically include step performed below:
The first step makes virtual water body object.Fig. 2 is the virtual water body object according to a wherein preferred embodiment of the invention
Schematic diagram, as shown in Fig. 2, the surface of virtual water body object can be subdivided into the surface mesh of 60*60, for the thin of wave simulated
Section.The side of virtual water body object can be subdivided into the surface mesh of 8*4, for the stereoscopic effect of virtual water body object is presented,
And the transition effect of side peak without animation and only from deep to shallow.Due to the water body in AR in use, AR can be placed on
In the plane detected, therefore, in general, game station will not watch water body, and also consider from water bottom
To the rendering performance of transparent substance, so the bottom surface of virtual water body object is removed.
Second step, in virtual water body Object Process is made, respectively each vertex assigns priming color to colour
Stage distinguishes the coloring logic on the vertex.Fig. 3 is according to the vertex color configuration schematic diagram of a wherein preferred embodiment of the invention, such as
Shown in Fig. 3, each vertex is respectively provided with tetra- Color Channels of RGBA.For positioned at the vertex of top surface, R channels can be set as 1;
For the vertex of top half side, G channels can be set as 1;It, can be by channel B for the vertex of lower half portion side
It is set as 1.Fig. 4 is according to the spray area schematic of a wherein preferred embodiment of the invention, as shown in figure 4, for remaining A
Channel, can be as the mark of special area.Such as:As the mark for rendering spray region.
Third step, before to above-mentioned virtual water body object formally render, need to transparent in water body and scene and
The default virtual resource object for not writing depth buffer carries out rendering order rearrangement, is virtually provided with this to ensure that water body and these are default
Rendering effect between source object is normal.The foundation of rearrangement is:When the line between video camera and default virtual resource object is worn
During Water permeable body, these default virtual resource objects are located at rendering before water body, ensure that water body generates refraction effect to it with this;
Otherwise, these default virtual resource objects render after being located at water body.
4th step preloads water body outside and two kinds of different shader codes on the inside of water body, when visual angle is located at outside water body
During side (whole region except i.e. virtual water body object coverage area), more rich sea details is presented in water body;When visual angle exists
When water-bed (i.e. under sea level and in virtual water body object coverage area), in order to save performance, water body presents simpler
Details.Both shader codes automatically switch according to the position at visual angle.
5th step, setting water body rendering state, wherein it is possible to include but not limited to:
(1) setting render-ahead queue is transparent substance, is carried out for ensuring that virtual water body object is later than all opaque articles
It renders;
(2) it is transparent to render type, for being determined as the tinter group of tinter distribution;
(3) it closes the back side to cut, the reverse side for determining object from each face is also shown;
(4) depth write is opened, for when drawing water body, the distant relationships of itself and other objects to be notified to GPU;
(5) depth test is opened, for being distal to other notified to GPU's when the specific pixel in discovery certain objects
The object of distant relationships, then this pixel will not finally be shown on screen.
6th step, crawl background.In order to fully realize the effect of virtual reality fusion, water body needs to draw the reality that AR takes
Face generates certain refraction effect, therefore, before water body is rendered, needs to carry out the content for currently having rendered to frame buffer
Crawl, and preserve into a background texture, it is used when water body being waited for render.
7th step, vertex coloring stage.It is main to complete vertex spatial alternation in vertex Shader Stage, wave simulated
Vertex animation simulates the vertex animation of interaction ripples and provides required parameter for subsequent first tinter.
The vertex animation of wave simulated can select most popular Gerstner waves at present, compared to other waveforms,
The wave crest of Gerstner waves is more acute, and trough is wider, closer to true wave.
The vertex animation of simulation interaction ripples result of calculation is written into textures by script, and then be transferred to tinter.
Detailed process performance is as follows:Water body collision body detects the collision of object and water surface, is generated centered on the point of impingement outside
The Gerstner waves of diffusion, influence of the wave for each position of the water surface are recorded in specific textures.The color gray scale of the textures
Value represents the position of water surface by the influence size of ripples, so as to vertex Shader Stage according to the gray scale of textures come
Change the size of vertex fluctuating.
In addition, above-mentioned vertex animation needs the vertex color in second step to distinguish which vertex by vertex animation
It influences.Only R channels can just be controlled more than the vertex of 0 (red area) by wave and ripples animation.
8th step, piece member tinting stage.It is main to calculate pixel that water body covered because of the water body color to be mixed,
In, the vertex color in second step, the vertex performance of red area is sea characteristic, and what green and blue were showed is then
The characteristic of seawater lateral effect.On the outside of the water body mentioned in the 4th step with two kinds of different shader codes of inside, main body
Present current procedures.Because in water, the expense of water body piece member coloring becomes very high with pixel full frame shared by water body, but
Many details of water surface can not be seen in fact in water.Therefore, the shader code in water can be omitted a large amount of water
Body surface details.
The coloration attributes of the water surface are identical with existing water body feature, mainly include:By the rips of textures noise simulation,
It is used as the refraction effect of the mixture of colours by the background in the 6th step, bloom effect, the reflecting effect generated by Environment,
Fresnel effects, by the breakers along ashore effect of vertex color A channel mark and the mixed effect of color.
The breakers along ashore effect identified by vertex color A channel, due to all remains stationary states of the massif in scene, not
The spray is generated to calculate the difference of current coloration depth and existing depth using the existing depth pinup picture by video camera, it is main
If consider for performance.
In water intrinsic color device code, the effect of the water surface retains rips and color blending effect.
Water side wall master feature to be used can include:The mixed effect of color, from shallow to deep, the depth of water body gradually increase
Greatly, the refraction effect of the mixture of colours and the decorative effect of water body dynamic light beam are used as by the background in the 6th step.
9th step, Fig. 5 are according to the underwater environment schematic diagram of a wherein preferred embodiment of the invention, as shown in figure 5, when trip
After play player holds the entrance under water of AR equipment, other than water body switches to relatively simple water intrinsic color device code in itself, also
It needs that screen post processing effect is activated to simulate underweater vision, can include but is not limited to:Linear mist, height mist, surface sun
Light scattering, underwater bubble, the shoal of fish.
In game engine, when the collision body of AR equipment is located at except water body collision body, then AR equipment can be determined in water
Outside;When the collision body of AR equipment is within water body, then it can determine AR equipment in water.
Linear mist is that a kind of common mist in game real-time rendering field is imitated, the object more remote apart from viewpoint, the mist of mixing
Color is more.Height mist is a kind of common mist effect in game real-time rendering field, can be shown as closer to seabed, the depth in seabed
Blue color effect is denseer.The rips that surface sunlight scattering is generated when mainly being coloured using the water surface, color are extremely shielded by screen top
Curtain two bottom sides are gradually linearly spread.Effect consuming performance is more, therefore only interior apart from extra large surface certain distance and new line
When seeing to sea, the special efficacy of sunlight scattering can be just triggered.In addition it when triggering the special efficacy, needs between effect and iterations
Weighed to ensure to realize efficiency.
Tenth step, Fig. 6 are according to the seabed effect diagram of a wherein preferred embodiment of the invention, as shown in fig. 6, seabed
Effect according to the world coordinates position of seafloor model, the underwater effect that gleams of light are reflecting on waves in the river is mixed with textures plus noise, so as to make
Obtaining seabed becomes more vivid.Specifically, the similar textures that gleams of light are reflecting on waves in the river can be prepared in advance, then according to noise (its
Can be understood as an irregular black and white picture of display content) it moves and shows above-mentioned textures to be promoted to perform, to generate wave
The clear effect of light.
11st step is held in game player after AR equipment removes from water, and screen can generate screen whithin a period of time
The special efficacy of curtain droplet.Specifically, the time of droplet trickling could be provided as 3 seconds, and the time that droplet is slowly dried could be provided as 6
Second.Fig. 7 is that the viewing held according to the game player of a wherein preferred embodiment of the invention after AR equipment is removed from water is imitated
Fruit schematic diagram, as shown in fig. 7, when the special efficacy triggers, the screen real world seen interior for a period of time is in refractive status, is rolled over
It is identical with water body to penetrate principle, is first to acquire three-dimensional scenic, refraction distortion then is carried out to three-dimensional scenic in post processing.
According to a wherein embodiment of the invention, a kind of reality of the rendering device of virtual resource object in three-dimensional scenic is provided
Apply example, Fig. 8 be according to the structure diagram of the present invention wherein rendering device of the virtual resource object of an embodiment, as shown in figure 8,
The device is applied to comprising a display unit electronic equipment, and virtual resource object includes virtual water body object and default virtual resource
Object, the device include:First determining module 20, for determine first position of the virtual water body object in three-dimensional scenic with it is pre-
If the second position of the virtual resource object in three-dimensional scenic, wherein, virtual water body object is the three-dimensional with top surface and side
Structure, it is the virtual resource object for not writing depth buffer to preset virtual objects;Second determining module 30, in three-dimensional scenic
In determine one observation position;Third determining module 40, for according to first position, the second position and observation location determination Virtual water
Rendering order between body object and default virtual resource object;Rendering module 50, for rendering Virtual water according to rendering order
Body object and default virtual resource object.
Optionally, third determining module, if the line for the second position and observation position passes through first position, it is determined that
Default virtual resource object is rendered prior to virtual water body object.
Optionally, Fig. 9 is the structure according to the rendering device of the virtual water body object of a wherein preferred embodiment of the invention
Block diagram, as shown in figure 9, above device includes:Configuration module 60, for the top surface of virtual water body object to be configured, wherein, top surface is used
In wave simulated;Configuration module 60 is additionally operable to be configured the side of virtual water body object, wherein, side is used to that three-dimensional special efficacy to be presented,
And the grid surface quantity that each side is included in side is less than the grid surface quantity that top surface is included;Configuration module 60, is also used
Each apex configuration priming color on each vertex and side on respectively top surface, wherein, priming color is used to mark
Know the region with each vertex correspondence in virtual water body object.
Optionally, configuration module 60 includes:First dispensing unit (not shown), it is each on top surface for that will be located at
The value of first Color Channel on vertex is set as true;Second dispensing unit (not shown), for first part will to be located at
The value of second Color Channel on each vertex on side is set as true, wherein, first part side be in side with top surface
Adjacent surface;Third dispensing unit (not shown), for each vertex on second part side will to be located at
The value of third Color Channel is set as true, wherein, second part side is adjacent in addition with first part side in side
Surface.
Optionally, third determining module 40 includes:First computing unit (not shown), for calculate primary vector with
The scalar product of secondary vector obtains the first result of calculation, wherein, primary vector is by the center of plane each in top surface and side
What position was determined with default virtual resource object position, secondary vector is the normal vector of each plane;Second computing unit
(not shown) for calculating the scalar product of third vector and secondary vector, obtains the second result of calculation, wherein, third to
Amount is by the center of each plane and observation location determination;Third computing unit (not shown), for calculating the
The vector product of one result of calculation and the second result of calculation, obtains third result of calculation;Determination unit (not shown), for such as
Fruit is found in third result of calculation corresponding with each plane there are any result of calculation less than or equal to 0, it is determined that pre-
If virtual resource object is rendered prior to virtual water body object.
Optionally, rendering module 50 includes:First processing units (not shown), for every on top surface and side
A vertex carries out vertex coloring processing, wherein, vertex coloring processing between virtual water body object and three-dimensional scenic to top
Each vertex on face and side carries out space coordinate transformation and for the part or all of apex configuration mould on top surface and side
Intend animation;Second processing unit (not shown), for the pixel region covered in three-dimensional scenic by virtual water body object
Carry out piece member coloring treatment, wherein, piece member coloring treatment be used for by virtual water body object color and frame buffer with pixel region
Corresponding color is mixed.
Optionally, as shown in figure 9, above device can also include:4th determining module 70, for determine observation position by
The outside of virtual water body object switches to the inside of virtual water body object;First acquisition module 80, for obtaining and virtual water body
The corresponding shader code in object inside simultaneously triggers display screen backstage treatment effect to simulate underweater vision, wherein, after screen
It manages effect and includes at least one of:Linear mist, height mist, the scattering of surface sunlight, underwater bubble, the shoal of fish.
Optionally, as shown in figure 9, above device can also include:Third determining module 90, for determine observation position by
The inside of virtual water body object switches to the outside of virtual water body object;Second acquisition module 100, for obtaining and observing position
The three-dimensional scenic of adaptation, and refraction distortion processing is carried out to the three-dimensional scenic of adaptation.
According to a wherein embodiment of the invention, a kind of storage medium is additionally provided, storage medium includes the program of storage,
In, equipment performs the rendering intent of above-mentioned virtual water body object where controlling storage medium when program is run.Above-mentioned storage is situated between
Matter can include but is not limited to:USB flash disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disc or
The various media that can store program code such as CD.
According to a wherein embodiment of the invention, a kind of processor is additionally provided, processor is used to run program, wherein, journey
The rendering intent of above-mentioned virtual water body object is performed during sort run.Above-mentioned processor can include but is not limited to:Microprocessor
(MCU) or the processing unit of programmable logic device (FPGA) etc..
According to a wherein embodiment of the invention, a kind of terminal is additionally provided, including:One or more processors, memory,
Display device and one or more program, wherein, one or more programs are stored in memory, and be configured as by
One or more processors perform, and one or more programs are used to perform the rendering intent of above-mentioned virtual water body object.At some
In embodiment, above-mentioned terminal can be smart mobile phone (such as:Android phone, iOS mobile phones etc.), the terminals such as AR helmets
Equipment.Above-mentioned display device can be the liquid crystal display (LCD) of touch-screen type, which may be such that user can be with
The user interface of terminal interacts.In addition, above-mentioned terminal can also include:Input/output interface (I/O interfaces), general string
Row bus (USB) port, network interface, power supply and/or camera.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
In the above embodiment of the present invention, all emphasize particularly on different fields to the description of each embodiment, do not have in some embodiment
The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei
A kind of division of logic function, can there is an other dividing mode in actual implementation, for example, multiple units or component can combine or
Person is desirably integrated into another system or some features can be ignored or does not perform.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module
It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple
On unit.Some or all of unit therein can be selected according to the actual needs to realize the purpose of this embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent product sale or uses
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially
The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products
It embodies, which is stored in a storage medium, is used including some instructions so that a computer
Equipment (can be personal computer, server or network equipment etc.) perform each embodiment the method for the present invention whole or
Part steps.And aforementioned storage medium includes:USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can to store program code
Medium.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (19)
1. the rendering intent of virtual resource object in a kind of three-dimensional scenic, which is characterized in that applied to including a display unit
Electronic equipment, the virtual resource object include virtual water body object and default virtual resource object, the method includes:
Determine first position of the virtual water body object in the three-dimensional scenic with the default virtual resource object in institute
The second position in three-dimensional scenic is stated, wherein, the virtual water body object is the three-dimensional structure with top surface and side, described
Default virtual objects are the virtual resource object for not writing depth buffer;
An observation position is determined in the three-dimensional scenic;
According to virtual water body object described in the first position, the second position and the observation location determination and described default
Rendering order between virtual resource object;
The virtual water body object and the default virtual resource object are rendered according to the rendering order.
2. according to the method described in claim 1, it is characterized in that, it is described according to the first position, the second position and
The rendering order of virtual water body object and default virtual resource object described in the observation location determination, including:
If the line of the second position and the observation position passes through the first position, it is determined that the default virtual resource
Object is rendered prior to the virtual water body object.
3. according to the method described in claim 1, it is characterized in that, determine the first position and the second position it
Before, it further includes:
The top surface of the virtual water body object is configured, wherein, the top surface is used for wave simulated;
The side of the virtual water body object is configured, wherein, the side is used to three-dimensional special efficacy be presented, and the side is included
Grid surface quantity be less than the grid surface quantity that is included of the top surface;
Each apex configuration priming color on each vertex and the side on respectively described top surface, wherein, it is described
Priming color is used to identify the region in the virtual water body object with each vertex correspondence.
4. according to the method described in claim 3, it is characterized in that, each vertex and the side on respectively described top surface
Priming color described in each apex configuration on face includes:
The value of first Color Channel on each vertex on the top surface is set as true;
The value of second Color Channel on each vertex on first part side is set as true, wherein, described first
Surface is surface adjacent with the top surface in the side;
The value of the third Color Channel on each vertex on second part side is set as true, wherein, described second
Surface is other part side adjacent with the first part side in the side.
5. according to the method described in claim 2, it is characterized in that, determine that the default virtual resource object is virtual prior to described
The rendering of water body object includes:
The scalar product of primary vector and secondary vector is calculated, obtains the first result of calculation, wherein, the primary vector is by described
The center of each plane is determined with the second position in top surface and the side, and the secondary vector is each plane
Normal vector;
Calculate the scalar product of third vector and the secondary vector, obtain the second result of calculation, wherein, the third vector be by
The center of each plane and the observation location determination;
The vector product of first result of calculation and second result of calculation is calculated, obtains third result of calculation;
If it find that there are any result of calculations in third result of calculation corresponding with each plane to be less than or equal to 0, then
Determine that the default virtual resource object is rendered prior to the virtual water body object.
6. according to the method described in claim 1, it is characterized in that, the virtual water body object is rendered according to the rendering order
Including:
Vertex coloring processing is carried out to each vertex on the top surface and the side, wherein, the vertex coloring processing is used
It is empty in being carried out between the virtual water body object and the three-dimensional scenic to each vertex on the top surface and the side
Between coordinate transform and be the part or all of apex configuration simulation animation on the top surface and the side;
Piece member coloring treatment is carried out to the pixel region by the virtual water body object covering in the three-dimensional scenic, wherein, institute
Piece member coloring treatment is stated for color corresponding with the pixel region in virtual water body object color and frame buffer to be mixed
It closes.
7. according to the method described in claim 1, it is characterized in that, rendering the virtual water body pair according to the rendering order
As with after the default virtual resource object, further including:
Determine that the observation position is switched to the inside of the virtual water body object by the outside of the virtual water body object;
It obtains shader code corresponding with the virtual water body object inside and triggers display screen backstage treatment effect to simulate
Underweater vision, wherein, the screen post processing effect includes at least one of:Linear mist, height mist, the scattering of surface sunlight,
Underwater bubble, the shoal of fish.
8. according to the method described in claim 1, it is characterized in that, rendering the virtual water body pair according to the rendering order
As with after the default virtual resource object, further including:
Determine that the observation position is switched to the outside of the virtual water body object by the inside of the virtual water body object;
The three-dimensional scenic being adapted to the observation position is obtained, and refraction distortion processing is carried out to the three-dimensional scenic of the adaptation.
9. the rendering device of virtual resource object in a kind of three-dimensional scenic, which is characterized in that applied to including a display unit
Electronic equipment, the virtual resource object includes virtual water body object and default virtual resource object, described device include:
First determining module, for determining that first position of the virtual water body object in the three-dimensional scenic is preset with described
The second position of the virtual resource object in the three-dimensional scenic, wherein, the virtual water body object is with top surface and side
Three-dimensional structure, the default virtual objects are the virtual resource object for not writing depth buffer;
Second determining module, for determining an observation position in the three-dimensional scenic;
Third determining module, for virtual according to the first position, the second position and the observation location determination
Rendering order between water body object and the default virtual resource object;
Rendering module, for rendering the virtual water body object and the default virtual resource object according to the rendering order.
10. device according to claim 9, which is characterized in that the third determining module, if for the second position
The first position is passed through with the line of the observation position, it is determined that the default virtual resource object is prior to the Virtual water
Body object renders.
11. device according to claim 9, which is characterized in that described device further includes:
Configuration module, for the top surface of the virtual water body object to be configured, wherein, the top surface is used for wave simulated;
The configuration module is additionally operable to be configured the side of the virtual water body object, wherein, the side is three-dimensional special for presenting
Effect, and the grid surface quantity that each side is included in the side is less than the grid surface quantity that the top surface is included;
The configuration module, each apex configuration on each vertex and the side being additionally operable on respectively described top surface
Priming color, wherein, the priming color is used to identify the region in the virtual water body object with each vertex correspondence.
12. according to the devices described in claim 11, which is characterized in that the configuration module includes:
First dispensing unit, for the value of first Color Channel on each vertex being located on the top surface to be set as true;
Second dispensing unit, for the value of second Color Channel on each vertex being located on first part side to be set as
Very, wherein, the first part side is surface adjacent with the top surface in the side;
Third dispensing unit, for the value of the third Color Channel on each vertex being located on second part side to be set as
Very, wherein, the second part side is other part side adjacent with the first part side in the side.
13. device according to claim 10, which is characterized in that the third determining module includes:
First computing unit for calculating the scalar product of primary vector and secondary vector, obtains the first result of calculation, wherein, institute
It is to be determined by the center of plane each in the top surface and the side with the second position to state primary vector, described
Secondary vector is the normal vector of each plane;
Second computing unit for calculating the scalar product of third vector and the secondary vector, obtains the second result of calculation,
In, the third vector is the center and the observation location determination by each plane;
Third computing unit for calculating the vector product of first result of calculation and second result of calculation, obtains third
Result of calculation;
Determination unit, for if it find that there are any result of calculation is small in third result of calculation corresponding with each plane
In or equal to 0, it is determined that the default virtual resource object is rendered prior to the virtual water body object.
14. device according to claim 9, which is characterized in that the rendering module includes:
First processing units, for carrying out vertex coloring processing to each vertex on the top surface and the side, wherein, institute
State vertex coloring processing between the virtual water body object and the three-dimensional scenic to the top surface and the side
Each vertex carry out space coordinate transformation and for the part or all of apex configuration simulation on the top surface and the side
Animation;
Second processing unit, for carrying out piece member to the pixel region by the virtual water body object covering in the three-dimensional scenic
Coloring treatment, wherein, described first coloring treatment be used for by virtual water body object color and frame buffer with the pixel region
Corresponding color is mixed.
15. device according to claim 9, which is characterized in that described device further includes:
4th determining module, for determining that the observation position switches to the Virtual water by the outside of the virtual water body object
The inside of body object;
First acquisition module, for obtaining shader code corresponding with the virtual water body object inside and triggering display screen
Effect is post-processed to simulate underweater vision, wherein, the screen post processing effect includes at least one of:Linear mist, height
Mist, the scattering of surface sunlight, underwater bubble, the shoal of fish.
16. device according to claim 9, which is characterized in that described device further includes:
5th determining module, for determining that the observation position switches to the Virtual water by the inside of the virtual water body object
The outside of body object;
Second acquisition module, for obtaining the three-dimensional scenic being adapted to the observation position, and to the three-dimensional scenic of the adaptation
Carry out refraction distortion processing.
17. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein, it is run in described program
When control the storage medium where virtual resource object in equipment perform claim requirement 1 to 8 described in any one rendering
Method.
18. a kind of processor, which is characterized in that the processor is used to run program, wherein, right of execution when described program is run
Profit requires the rendering intent of the virtual resource object described in any one in 1 to 8.
19. a kind of terminal, which is characterized in that including:One or more processors, memory, display device and one or more
A program, wherein, one or more of programs are stored in the memory, and are configured as by one or more
A processor performs, virtual resource pair of one or more of programs described in for any one in perform claim requirement 1 to 8
The rendering intent of elephant.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711308406.6A CN108230436A (en) | 2017-12-11 | 2017-12-11 | The rendering intent of virtual resource object in three-dimensional scenic |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711308406.6A CN108230436A (en) | 2017-12-11 | 2017-12-11 | The rendering intent of virtual resource object in three-dimensional scenic |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108230436A true CN108230436A (en) | 2018-06-29 |
Family
ID=62649335
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711308406.6A Pending CN108230436A (en) | 2017-12-11 | 2017-12-11 | The rendering intent of virtual resource object in three-dimensional scenic |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108230436A (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110102053A (en) * | 2019-05-13 | 2019-08-09 | 腾讯科技(深圳)有限公司 | Virtual image display methods, device, terminal and storage medium |
CN111145323A (en) * | 2019-12-27 | 2020-05-12 | 珠海金山网络游戏科技有限公司 | Image rendering method and device |
CN111429558A (en) * | 2020-03-02 | 2020-07-17 | 武汉大学 | Method and system for simulating dynamic water body abbreviation model in real time |
CN111467795A (en) * | 2020-04-02 | 2020-07-31 | 北京代码乾坤科技有限公司 | Physical settlement method and device in game scene |
CN111773701A (en) * | 2020-07-29 | 2020-10-16 | 网易(杭州)网络有限公司 | Method and device for building water surface platform in game, electronic equipment and storage medium |
CN112884874A (en) * | 2021-03-18 | 2021-06-01 | 腾讯科技(深圳)有限公司 | Method, apparatus, device and medium for applying decals on virtual model |
CN112927365A (en) * | 2021-04-13 | 2021-06-08 | 网易(杭州)网络有限公司 | Method and device for rendering mountain in three-dimensional virtual scene of application program |
CN113345066A (en) * | 2021-05-26 | 2021-09-03 | 网易(杭州)网络有限公司 | Method, device, equipment and computer-readable storage medium for rendering sea waves |
CN113421343A (en) * | 2021-05-27 | 2021-09-21 | 深圳市晨北科技有限公司 | Method for observing internal structure of equipment based on augmented reality |
CN113413602A (en) * | 2021-07-20 | 2021-09-21 | 网易(杭州)网络有限公司 | Method and device for processing underwater indoor environment in game |
WO2022111037A1 (en) * | 2020-11-27 | 2022-06-02 | 成都完美时空网络技术有限公司 | Method and device for rendering virtual object wind animation, program, and readable medium |
CN116617658A (en) * | 2023-07-20 | 2023-08-22 | 腾讯科技(深圳)有限公司 | Image rendering method and related device |
WO2023197729A1 (en) * | 2022-04-14 | 2023-10-19 | 腾讯科技(深圳)有限公司 | Object rendering method and apparatus, electronic device, and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005346165A (en) * | 2004-05-31 | 2005-12-15 | Sony Computer Entertainment Inc | Image processor, and image processing method |
CN101650837A (en) * | 2009-07-16 | 2010-02-17 | 浙江大学 | Virtual-reality modeling method of ocean water body |
CN102243770A (en) * | 2011-07-19 | 2011-11-16 | 南昌航空大学 | Method for quickly drawing realistic rendering of naval battlefield based on OSG |
CN102855662A (en) * | 2012-07-25 | 2013-01-02 | 中国科学院对地观测与数字地球科学中心 | Ocean environment visualization method |
CN103106680A (en) * | 2013-02-16 | 2013-05-15 | 赞奇科技发展有限公司 | Implementation method for three-dimensional figure render based on cloud computing framework and cloud service system |
CN103577656A (en) * | 2013-11-25 | 2014-02-12 | 哈尔滨工业大学 | Three-dimensional dynamic simulation method for water outlet process of submarine-launched missiles |
-
2017
- 2017-12-11 CN CN201711308406.6A patent/CN108230436A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005346165A (en) * | 2004-05-31 | 2005-12-15 | Sony Computer Entertainment Inc | Image processor, and image processing method |
CN101650837A (en) * | 2009-07-16 | 2010-02-17 | 浙江大学 | Virtual-reality modeling method of ocean water body |
CN102243770A (en) * | 2011-07-19 | 2011-11-16 | 南昌航空大学 | Method for quickly drawing realistic rendering of naval battlefield based on OSG |
CN102855662A (en) * | 2012-07-25 | 2013-01-02 | 中国科学院对地观测与数字地球科学中心 | Ocean environment visualization method |
CN103106680A (en) * | 2013-02-16 | 2013-05-15 | 赞奇科技发展有限公司 | Implementation method for three-dimensional figure render based on cloud computing framework and cloud service system |
CN103577656A (en) * | 2013-11-25 | 2014-02-12 | 哈尔滨工业大学 | Three-dimensional dynamic simulation method for water outlet process of submarine-launched missiles |
Non-Patent Citations (1)
Title |
---|
OPENGL: "⾼级OpenGL混合教程", 《HTTPS://WEB.ARCHIVE.ORG/WEB/20160505111325/HTTPS://LEARNOPENGL-CN.READTHEDOCS.IO/ZH/LATEST/04%20ADVANCED%20OPENGL/03%20BLENDING/》 * |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110102053B (en) * | 2019-05-13 | 2021-12-21 | 腾讯科技(深圳)有限公司 | Virtual image display method, device, terminal and storage medium |
CN110102053A (en) * | 2019-05-13 | 2019-08-09 | 腾讯科技(深圳)有限公司 | Virtual image display methods, device, terminal and storage medium |
CN111145323A (en) * | 2019-12-27 | 2020-05-12 | 珠海金山网络游戏科技有限公司 | Image rendering method and device |
CN111145323B (en) * | 2019-12-27 | 2023-09-22 | 珠海金山数字网络科技有限公司 | Image rendering method and device |
CN111429558A (en) * | 2020-03-02 | 2020-07-17 | 武汉大学 | Method and system for simulating dynamic water body abbreviation model in real time |
CN111467795A (en) * | 2020-04-02 | 2020-07-31 | 北京代码乾坤科技有限公司 | Physical settlement method and device in game scene |
CN111773701A (en) * | 2020-07-29 | 2020-10-16 | 网易(杭州)网络有限公司 | Method and device for building water surface platform in game, electronic equipment and storage medium |
CN111773701B (en) * | 2020-07-29 | 2023-10-20 | 网易(杭州)网络有限公司 | Method and device for building water surface platform in game, electronic equipment and storage medium |
WO2022111037A1 (en) * | 2020-11-27 | 2022-06-02 | 成都完美时空网络技术有限公司 | Method and device for rendering virtual object wind animation, program, and readable medium |
CN112884874A (en) * | 2021-03-18 | 2021-06-01 | 腾讯科技(深圳)有限公司 | Method, apparatus, device and medium for applying decals on virtual model |
CN112884874B (en) * | 2021-03-18 | 2023-06-16 | 腾讯科技(深圳)有限公司 | Method, device, equipment and medium for applying applique on virtual model |
CN112927365B (en) * | 2021-04-13 | 2023-05-26 | 网易(杭州)网络有限公司 | Method and device for rendering mountain in three-dimensional virtual scene of application program |
CN112927365A (en) * | 2021-04-13 | 2021-06-08 | 网易(杭州)网络有限公司 | Method and device for rendering mountain in three-dimensional virtual scene of application program |
CN113345066B (en) * | 2021-05-26 | 2022-07-22 | 网易(杭州)网络有限公司 | Method, device, equipment and computer-readable storage medium for rendering sea waves |
CN113345066A (en) * | 2021-05-26 | 2021-09-03 | 网易(杭州)网络有限公司 | Method, device, equipment and computer-readable storage medium for rendering sea waves |
CN113421343A (en) * | 2021-05-27 | 2021-09-21 | 深圳市晨北科技有限公司 | Method for observing internal structure of equipment based on augmented reality |
CN113421343B (en) * | 2021-05-27 | 2024-06-04 | 深圳市晨北科技有限公司 | Method based on internal structure of augmented reality observation equipment |
CN113413602A (en) * | 2021-07-20 | 2021-09-21 | 网易(杭州)网络有限公司 | Method and device for processing underwater indoor environment in game |
CN113413602B (en) * | 2021-07-20 | 2024-05-10 | 网易(杭州)网络有限公司 | Processing method and device for underwater indoor environment in game |
WO2023197729A1 (en) * | 2022-04-14 | 2023-10-19 | 腾讯科技(深圳)有限公司 | Object rendering method and apparatus, electronic device, and storage medium |
CN116617658A (en) * | 2023-07-20 | 2023-08-22 | 腾讯科技(深圳)有限公司 | Image rendering method and related device |
CN116617658B (en) * | 2023-07-20 | 2023-10-20 | 腾讯科技(深圳)有限公司 | Image rendering method and related device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107918949A (en) | Rendering intent, storage medium, processor and the terminal of virtual resource object | |
CN108230436A (en) | The rendering intent of virtual resource object in three-dimensional scenic | |
CN106056661B (en) | Three-dimensional graphics renderer engine based on Direct3D 11 | |
CN108564646A (en) | Rendering intent and device, storage medium, the electronic device of object | |
KR100823786B1 (en) | Display, displaying method, and computer-readable information recording medium having a program recorded thereon | |
CN101477701B (en) | Built-in real tri-dimension rendering process oriented to AutoCAD and 3DS MAX | |
US7046242B2 (en) | Game system, program and image generating method | |
US7202867B1 (en) | Generation of glow effect | |
Ganovelli et al. | Introduction to computer graphics: A practical learning approach | |
US20100315421A1 (en) | Generating fog effects in a simulated environment | |
CN101477702A (en) | Built-in real tri-dimension driving method for computer display card | |
Kolivand et al. | An overview on base real-time shadow techniques in virtual environments | |
CN101540056B (en) | Implanted true-three-dimensional stereo rendering method facing to ERDAS Virtual GIS | |
Lee et al. | Real time 3D avatar for interactive mixed reality | |
CN101488229B (en) | PCI three-dimensional analysis module oriented implantation type ture three-dimensional stereo rendering method | |
Kenwright | Approximate inter-fur shadowing effect using shells | |
CN101482978B (en) | ENVI/IDL oriented implantation type true three-dimensional stereo rendering method | |
Ropinski et al. | Virtual reflections for augmented reality environments | |
Babić | Volumetric Atmospheric Effects Rendering | |
CN110458922B (en) | Graphics rendering method and related product | |
CN101482977B (en) | Microstation oriented implantation type true three-dimensional stereo display method | |
CN101488232A (en) | Implanted true three-dimension volumetric display method oriented to C Tech software | |
JP3511597B2 (en) | PROGRAM, INFORMATION STORAGE MEDIUM, AND GAME DEVICE | |
Elmqvist et al. | Dynamic transparency for 3d visualization: design and evaluation | |
Provost | Beautiful, Yet Friendly Part 1: Stop Hitting the Bottleneck |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180629 |
|
RJ01 | Rejection of invention patent application after publication |