CN113345066A - Method, device, equipment and computer-readable storage medium for rendering sea waves - Google Patents

Method, device, equipment and computer-readable storage medium for rendering sea waves Download PDF

Info

Publication number
CN113345066A
CN113345066A CN202110580640.4A CN202110580640A CN113345066A CN 113345066 A CN113345066 A CN 113345066A CN 202110580640 A CN202110580640 A CN 202110580640A CN 113345066 A CN113345066 A CN 113345066A
Authority
CN
China
Prior art keywords
time
real
mask
wave
sea
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
CN202110580640.4A
Other languages
Chinese (zh)
Other versions
CN113345066B (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 CN202110580640.4A priority Critical patent/CN113345066B/en
Publication of CN113345066A publication Critical patent/CN113345066A/en
Application granted granted Critical
Publication of CN113345066B publication Critical patent/CN113345066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

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

Abstract

The application relates to the field of computer graphics, and provides a method, a device, equipment and a computer-readable storage medium for rendering sea waves, so that the sea wave rendering effect is improved, and the sea waves in a game are closer to the real world sea waves. The method comprises the following steps: acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch; intercepting a real-time strip-shaped shade parallel to a coastline to form a real-time sea wave line; mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coasts; and superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves. Compared with the prior art, the sea waves rendered by the technical scheme of the application have stronger variability, so that the sea waves in the game scene are closer to the sea waves in the real world, and more real visual sense is given to game players.

Description

Method, device, equipment and computer-readable storage medium for rendering sea waves
Technical Field
The present invention relates to the field of computer graphics, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for rendering ocean waves.
Background
Sea surface is a common effect in games, is one of important elements for enhancing visual effects of game scenes, occupies a large area of a picture in some game scenes, and is developed by adopting a game Engine, and the non Engine 4 is a well-known game development tool.
The non Engine 4 is a powerful three-dimensional game Engine developed by Epic Games, which can create a multi-platform integrated game of three-dimensional video Games, two-dimensional planar Games and architectural real-time presentations. When a mobile terminal game is developed by using an unregeal Engine 4 game Engine, if waves need to be rendered, the existing method is a mode of displaying a wave texture on a contact part between the water surface and the shore, and the effect of the waves is expressed by adopting the mode.
However, the existing sea wave rendering method can only show some simple effects of sea wave texture flowing, and cannot render the effect that sea waves rush from the sea to the shore, so that the visual effect is not satisfactory.
Disclosure of Invention
The application provides a method, a device, equipment and a computer-readable storage medium for rendering sea waves, so that the sea wave rendering effect is improved, and the sea waves in a game are closer to the real world sea waves.
In one aspect, the present application provides a method of rendering ocean waves, including:
acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch;
intercepting the real-time strip-shaped shade to form a real-time sea wave line;
mapping the prefabricated moving sea wave texture to the real-time strip-shaped shade to obtain a real-time sea wave rendering effect moving relative to the coast;
and superposing the real-time wave effect moving relative to the coast with the real-time wave line to obtain the final rendering effect of the waves.
Optionally, the obtaining a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch includes: determining the moving direction and the moving amplitude of a strip-shaped mask which is parallel to a coastline and is related to the current time according to the scene depth, the pixel depth, the current time and the sine value of the current time; taking the decimal part of the sum of the moving direction and the moving amplitude; and calculating the real-time strip-shaped mask parallel to the coastline by taking the decimal part as a variable.
Optionally, the determining a sum of a moving direction and a moving amplitude of a strip-shaped mask parallel to a coastline associated with the current time instant according to the scene depth, the pixel depth, the current time instant and a sine value of the current time instant comprises: calculating a difference value between the scene depth and the pixel depth, and taking the difference value as a moving direction of a strip-shaped mask which is related to the current moment and is parallel to a coastline; calculating the sum of the sine values of the current time and the current time, and taking the sum of the sine values of the current time and the current time as the moving amplitude of the strip-shaped mask which is related to the current time and is parallel to the coastline; the calculating the real-time strip-shaped mask parallel to the coastline by taking the decimal part as a variable comprises the following steps: calling an integer function Ceil ((1-x) -0.5) by taking the decimal part as a parameter, and assigning Ceil ((1-x) -0.5) to alpha, wherein x is the decimal part; calling a first cut-off function Saturate (alpha) by taking the alpha as a parameter; and calling a second truncation function Lerp (power (2x, 8), 2x, Saturate (alpha)) by taking power (2x, 8), 2x and Saturate (alpha) as parameters, and taking a return value of the second truncation function as the real-time strip-shaped mask parallel to the coastline, wherein the power (2x, 8) represents that 2x is raised to the power of 8.
Optionally, said intercepting said real-time strip-like mask to form a real-time ocean wave line comprises: taking the difference between the real-time strip-shaped mask and the adjustable parameter of the sea wave line width as a parameter, and calling a rounding function Ceil (FlowMask- _ WaveLineWidth), wherein the FlowMask is the real-time strip-shaped mask, and the WaveLineWidth is the adjustable parameter of the sea wave line width; calling a second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) with a return value of power (FlowMask x, 4), 0, Ceil (FlowMask x, 4) as a parameter, wherein the power (FlowMask x, 4) represents raising FlowMask x to 4 th power; adding a return value of the second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask-WaveLineWidth)) to a part of the real-time strip-shaped mask to obtain the real-time wave line, wherein the part of the real-time strip-shaped mask is the product of the FlowMask and a preset decimal.
Optionally, the moving sea wave texture is produced by: calling a first cut-off function Saturate (1- (SceneDepth-PixelDepth)/500 by taking 1- (SceneDepth-PixelDepth)/500 as a parameter, wherein the SceneDepth-PixelDepth is the difference value between the scene depth and the pixel depth; sampling textures of sea waves based on sea wave circulation speed adjusting parameters to obtain sea wave texture sampling values; and multiplying the return value of the first cut-off function Saturate (1- (scenDEpth-PixelDepth)/500) by the sea wave texture sampling value to obtain the moving sea wave texture.
Optionally, the sampling the texture of the sea wave based on the sea wave cycle speed adjusting parameter to obtain a sea wave texture sampling value includes: and calling texture sampling functions tex2D (TexWave, sin (Time) wave loopspeed) + TexCoord0) by taking texture of the sea wave and sin (Time _ wave loopspeed) and TexCoord0 as parameters, taking a return value of the texture sampling functions tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) as a sea wave texture sampling value, wherein the TexWave is texture of the sea wave, the _ wave loopspeed is a sea wave circulation speed regulation parameter, the Time is the current Time, and the sin (Time _ wave loopspeed) represents that a sine value is obtained by multiplying the Time and the wave loopspeed, and the TexCoord0 is a sampling coordinate of the texture.
Optionally, the method further comprises: and controlling the display range of the sea waves according to the sampling value of the mask texture and the real-time sea wave rendering effect moving relative to the coast.
Optionally, the controlling the display range of the ocean waves according to the sampling values of the mask texture and the real-time ocean wave rendering effect moving relative to the coast comprises: obtaining a first Mask range value Mask01 through a first operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture; obtaining a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture; and limiting the first Mask range value Mask01 and/or the second Mask range value Mask02 by adopting an interval limiting function to obtain the display range of the sea wave.
Optionally, the obtaining a first Mask range value Mask01 through a first operation according to the wave movement speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture includes: calculating to obtain the first Mask range value Mask01 according to a calculation formula Mask01 ═ (tex, area Mask-0.5) + sin (Time _ Speed) _ Mask intensity, wherein tex, area Mask represents a sampling value of the Mask texture, Speed represents the sea wave movement Speed adjusting parameter, Time represents the current Time, Mask intensity represents the Mask intensity adjusting parameter, and sin (Time _ Speed) represents that a sine function value is obtained for Time _ Speed; the obtaining of a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture comprises: the second Mask range value Mask02 is calculated according to the calculation formula Mask02 ═ (tex. area Mask-0.5) -sin (Time _ Speed) _ Mask intensity.
In another aspect, the present application provides an apparatus for rendering ocean waves, including:
the acquiring module is used for acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch;
the sea wave line forming module is used for intercepting the real-time strip-shaped shade to form a real-time sea wave line;
the middle effect forming module is used for mapping the prefabricated moving sea wave textures to the real-time strip-shaped shade to obtain the real-time sea wave effect moving relative to the coast;
and the wave effect forming module is used for superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves.
In a third aspect, the present application provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps in the method for rendering sea waves according to any one of the above embodiments by calling the computer program stored in the memory.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor to perform the steps of the method for rendering ocean waves as described in any one of the above embodiments.
According to the technical scheme, the real-time sea wave line can be formed according to the scene depth and the pixel depth of the preset water surface patch, the prefabricated moving sea wave texture is mapped to the real-time strip-shaped shade, the real-time sea wave rendering effect moving relative to the coast is obtained, and finally the real-time sea wave rendering effect moving relative to the coast is superposed with the real-time sea wave line, and the final sea wave rendering effect is obtained. Because the wave effect is relative coast removal in real time, compared with the prior art, can only show the simple effect that some wave textures flow, can not render the effect that the wave dashes to the bank from the sea, the variability of the wave that the technical scheme of this application was rendered out is stronger, makes the wave in the recreation scene more closely to the wave in the real world, gives the more real visual sense of game player.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for rendering sea waves according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an apparatus for rendering sea waves according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an apparatus for rendering sea waves according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a final rendering effect of ocean waves provided by an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this specification, adjectives such as first and second may only be used to distinguish one element or action from another, without necessarily requiring or implying any actual such relationship or order. References to an element or component or step (etc.) should not be construed as limited to only one of the element, component, or step, but rather to one or more of the element, component, or step, etc., where the context permits.
In the present specification, the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The application provides a method for rendering sea waves, as shown in fig. 1, which mainly includes steps S101 to S104, as detailed below:
step S101: and acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch.
In the embodiment of the application, a water surface patch and a land patch can be created in a three-dimensional game scene in advance, wherein the water surface patch is endowed with water surface materials, and the land patch can be endowed with any opaque materials. The Scene Depth (Scene Depth) and the Pixel Depth (Pixel Depth) of these surface patches may then be read in the shader (shader).
As an embodiment of the present application, according to the scene depth and the pixel depth of the preset water surface patch, acquiring the real-time strip-shaped mask parallel to the coastline may be: according to the scene depth, the pixel depth of the surface patch of the water, the current time and the sine value of the current time, determining the moving direction and the moving amplitude of the strip-shaped mask which is related to the current time and is parallel to the coastline, then taking the decimal part of the sum of the moving direction and the moving amplitude of the strip-shaped mask, and finally calculating to obtain the real-time strip-shaped mask which is parallel to the coastline by taking the decimal part as a variable. In the above embodiment, determining, according to the scene depth, the pixel depth of the water surface patch, the current time, and the sine value of the current time, the moving direction and the moving amplitude of the strip mask parallel to the coastline and related to the current time may specifically be: calculating the difference value of the scene depth and the pixel depth of the water surface patch, and taking the difference value as the moving direction of the strip-shaped mask which is related to the current moment and is parallel to the coastline; calculating the sum of the sine values of the current Time and the current Time, and using the sum of the sine values of the current Time and the current Time as the moving amplitude of the strip-shaped mask parallel to the coastline related to the current Time, wherein the formula is expressed as x ═ Frac (Time + sin (Time) + (SceneDepth-PixelDepth)), where Time in the above calculation formula represents the current Time, sin (Time) represents that a sine function value is obtained for sin (Time), SceneDepth represents the scene depth, PixelDepth represents the pixel depth of the surface of the water, and Frac (Time + sin (Time) + (SceneDepth-PixelDepth)) represents that the calculation result of Time + sin (Time) + (SceneDepth-PixelDepth), that is, the sum of the moving direction and the moving amplitude of the strip-shaped mask parallel to the coastline related to the current Time, where the sum of the moving amplitude of the strip-shaped mask parallel to the coastline is the moving amplitude of the current Time + the strip-shaped mask parallel to the coastline related to the current Time, scenedeth-PixelDepth is the direction of movement of the strip-like mask parallel to the coastline associated with the current time instant. In the above embodiment, taking the fractional part as a variable, the real-time strip-like mask calculated to be parallel to the coastline may be: calling an integer function Ceil ((1-x) -0.5) by taking the decimal part as a parameter, and assigning Ceil ((1-x) -0.5) to alpha; calling a first cut-off function Saturate (alpha) by taking the alpha as a parameter; with power (2x, 8), 2x, and saturrate (α) as parameters, a second cutoff function, called a first cutoff function, called a second cutoff function, called a power (2x, 8), 2x, saturrate (α), with its return value as the real-time striplike mask parallel to the coastline, i.e., FlowMask ═ Lerp (power (2x, 8), 2x, saturrate (α)), where x is the fractional part of the sum of the moving direction and the moving amplitude of the striplike mask parallel to the coastline associated with the current time, power (2x, 8) indicating 8 th-power to 2x, an integer function Ce ((1-x) -0.5) indicating the smallest integer of the calculation results that is greater than (1-x) -0.5, and a prototype of the first cutoff function, saturrate (α), is a function return value of 1 when α ≧ 1, a function < 1 when α < 0, a < 0 < il < 0, and a function return value of 0, when α < 0, a < 0, the function returns a value, the second truncation function Lerp (power (2x, 8), 2x, saturrate (α)) indicates that a value truncation is performed between power (2x, 8) and 2x in accordance with saturrate (α).
Through the above calculation formula, a striped mask FlowMask parallel to the coastline with alternate black and white can be rendered. On one hand, in the final expression Lerp (power (2x, 8), 2x, saturrate (α)) of the strip-shaped mask FlowMask, x is a variable related to the parameter Time at the current Time, so that the strip-shaped mask FlowMask has real-Time performance; on the other hand, the cosine value sin (Time) itself represents the oscillation characteristic, and the strip-shaped mask FlowMask continuously moves to the coast intermittently along with the Time at the current moment.
Step S102: and intercepting the real-time strip-shaped shade parallel to the coastline to form a real-time sea wave line.
As an embodiment of the present application, the real-time strip-like mask parallel to the coastline is intercepted, and the real-time wave lines can be formed by: taking the difference between the real-time strip-shaped mask parallel to the coastline and the adjustable parameter of the sea wave line width as a parameter, and calling an integer function Ceil (FlowMask- _ WaveLineWidth), wherein the FlowMask is the real-time strip-shaped mask parallel to the coastline, and the _WaveLineWidthis the adjustable parameter of the sea wave line width; then, a second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) is called with return values of power (FlowMask x, 4), 0, Ceil (FlowMask x, 4) as parameters, wherein power (FlowMask x, 4) indicates that the calculation result of FlowMask x is raised to the power of 4; finally, the return value of the second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) is added to the real-time strip-shaped mask partially parallel to the coastline to obtain the real-time wave line WaveLine, where the real-time strip-shaped mask partially parallel to the coastline is a product of the real-time strip-shaped mask parallel to the coastline and a preset decimal (for example, 0.3), and specifically, the real-time wave line WaveLine may be calculated according to the following formula:
WaveLine=Lerp(Power(FlowMask*x,4),0,Ceil(FlowMask-_WaveLineWidth))+FlowMask*0.3
where x is Frac (Time + sin (Time)) + (SceneDepth-PixelDepth) of the previous embodiment, FlowMask is Lerp (power (2x, 8), 2x, saturrate (α)) of the previous embodiment, and _ WaveLineWidth is a WaveLineWidth adjustable parameter for adjusting WaveLine. As for the function Lerp (), the function Ceil () and the function Power (), similarly to the previous embodiment, Ceil (FlowMask _ WaveLineWidth) represents the smallest integer that takes a result of this calculation larger than FlowMask _ WaveLineWidth), Lerp (Power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth) represents the truncation of a value between Power (FlowMask x, 4) and 0 according to Ceil (FlowMask _ WaveLineWidth), and Power (FlowMask x, 4) represents the exponentiation to the 4 th Power of FlowMask x.
Step S103: mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coasts.
The real-time strip-shaped mask parallel to the coastline obtained in step S101 is actually a black and white strip-shaped mask without texture, and therefore, in order to enhance the rendering effect of the sea waves, in the embodiment of the present application, the pre-made moving sea wave texture may be mapped to the real-time strip-shaped mask parallel to the coastline, so as to obtain the real-time wave rendering effect moving relative to the coast, where the moving sea wave map may be made in advance in the following manner: calling a first cut-off function Saturate (1- (SceneDepth-PixelDepth)/500 by taking 1- (SceneDepth-PixelDepth)/500 as a parameter, wherein SceneDepth-PixelDepth is the difference value of the scene depth and the pixel depth of a preset water surface patch; sampling textures of sea waves based on sea wave circulation speed adjusting parameters to obtain sea wave texture sampling values; multiplying a return value of a first cut-off function saturrate (1- (sceneddepth-PixelDepth)/500) by a sea wave texture sampling value to obtain a moving sea wave texture, wherein the sea wave texture is sampled based on a sea wave cycle speed adjusting parameter in the above embodiment, and the obtained sea wave texture sampling value may be: the texture of the sea wave and sin (Time _ wave loopspeed) and TexCoord0 are taken as parameters, a texture sampling function tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) is called, and the return value of the texture sampling function tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) is taken as a sea wave texture sampling value, wherein TexWave is the texture of the sea wave, WaveLoopSpeed is a sea wave circulation speed regulation parameter, Time is the current Time, sin (Time _ wave loopspeed) indicates that the sine value is obtained by multiplying the Time and the WaveLoopSpeed, and TexCoord0 is the coordinate UV of texture sampling. The implementation of the step S103 may specifically obtain the moving sea wave texture WaveColor according to the following calculation formula:
WaveColor=saturate(1-(SceneDepth-PixelDepth)/500)*tex2D(TexWave,sin(Time*_WaveLoopSpeed)+TexCoord0)
by the above calculation formula, a tiled texture effect moving back and forth on the bank can be obtained, and the prefabricated moving sea wave texture WaveColor is mapped to the real-time strip-shaped mask obtained in the step S101, that is, the prefabricated moving sea wave texture WaveColor is multiplied by the real-time strip-shaped mask FlowMask obtained in the step S101, so that a real-time sea wave rendering effect moving relative to the coast can be obtained.
Step S104: and superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves.
And (3) superposing the wave effect moving relative to the coast in real time and the real-time wave line, namely adding the WaveColor FlowMask and the WaveLine obtained in the steps S101 to S103, wherein the WaveColor FlowMask and the WaveLine are the final rendering effect of the waves, and the final rendering effect is shown in the attached figure 5.
Further, in order to break the continuity of the sea wave and make the sea wave closer to the sea wave in the real world, the embodiment further comprises controlling the display range of the sea wave according to the sampling value of the mask texture and the rendering effect of the sea wave moving relative to the coast in real time. After the control of the display range of the sea waves is added, the waves are not uniformly distributed on the shore any more, but are changed according to the coastline. As an embodiment of the present application, according to the sampling value of the mask texture and the real-time wave rendering effect moving relative to the coast, the display range of the control wave may be: obtaining a first Mask range value Mask01 through a first operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture; obtaining a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture; and limiting the first Mask range value Mask01 and/or the second Mask range value Mask02 by adopting an interval limiting function to obtain the display range of the sea waves.
Specifically, according to the sea wave movement speed adjustment parameter, the Mask strength adjustment parameter, and the sampling value of the Mask texture, the first Mask range value Mask01 obtained through the first operation may be: calculating to obtain a first Mask range value Mask01 according to a calculation formula Mask01 ═ (tex, area Mask-0.5) + sin (Time _ Speed) _ Mask intensity, wherein tex, area Mask represents a sampling value of a Mask texture, Speed represents a sea wave moving Speed adjusting parameter, Time represents the current Time, Speed intensity represents a Mask intensity adjusting parameter, and sin (Time _ Speed) represents that a sine function value is obtained for the Time _ Speed; according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture, the second Mask range value Mask02 obtained through the second operation may be: a second Mask range value Mask02 is calculated according to the calculation formula Mask02 ═ (tex. area Mask-0.5) -sin (Time _ Speed) _ Mask intensity. As for the use of the interval limiting function, the first Mask range value Mask01 and/or the second Mask range value Mask02 are/is limited, and specifically may be that an area Mask is camp (Max (Mask01, Mask02) × 2, 0, 1), where Max (Mask01, Mask02) represents a larger value between Mask01 and Mask02, and camp () is an interval limiting function, which represents that if Max (Mask01, Mask 02)' 2 is between [0, 1], the area Mask takes (Max 01, Mask02) × 2, if Max (Mask01, Mask02) × 2 is less than 0, the area Mask takes 0, and if Max (Mask01, Mask02) × 2 is greater than 1, the area Mask takes 1. After the above calculation, a region mask that changes continuously with time can be obtained.
As can be seen from the method for rendering sea waves illustrated in fig. 1, a real-time sea wave line can be formed according to a scene depth and a pixel depth of a preset water surface patch, a pre-made moving sea wave texture is mapped to a real-time strip-shaped mask to obtain a real-time sea wave rendering effect moving relative to a coast, and finally, the real-time sea wave rendering effect moving relative to the coast is superimposed on the real-time sea wave line to obtain a final sea wave rendering effect. Because the wave effect is relative coast removal in real time, compared with the prior art, can only show the simple effect that some wave textures flow, can not render the effect that the wave dashes to the bank from the sea, the variability of the wave that the technical scheme of this application was rendered out is stronger, makes the wave in the recreation scene more closely to the wave in the real world, gives the more real visual sense of game player.
Referring to fig. 2, the apparatus for rendering sea waves provided in the embodiment of the present application may include an obtaining module 201, a sea wave line forming module 202, an intermediate effect forming module 203, and a sea wave effect forming module 204, which are detailed as follows:
the acquiring module 201 is configured to acquire a real-time strip-shaped mask parallel to a coastline according to a scene depth and a pixel depth of a preset water surface patch;
a sea wave line forming module 202 for intercepting a real-time strip-shaped shade parallel to a coastline to form a real-time sea wave line;
the middle effect forming module 203 is used for mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coastline;
and the wave effect forming module 204 is used for superposing the wave rendering effect moving relative to the coast in real time and the strip-shaped shade parallel to the coastline in real time to obtain the final rendering effect.
Optionally, in the apparatus illustrated in fig. 2, the obtaining module 201 may include a first calculating unit, a decimal processing unit, and a second calculating unit, where:
the first calculation unit is used for determining the moving direction and the moving amplitude of the strip-shaped mask which is related to the current time and is parallel to the coastline according to the scene depth, the pixel depth of a preset water surface patch, the current time and the sine value of the current time;
a decimal processing unit for taking the decimal part of the sum of the moving direction and the moving amplitude of the strip-shaped shade parallel to the coastline related to the current time;
and the second calculation unit is used for calculating the real-time strip-shaped mask parallel to the coastline by taking the decimal part as a variable.
Optionally, the first calculating unit of the above example may include a difference calculating unit and a summing unit, and the second calculating unit may include a first calling unit, a second calling unit, and a third calling unit, where:
the difference value calculating unit is used for calculating the difference value between the scene depth and the pixel depth of a preset water surface patch, and taking the difference value as the moving direction of the strip-shaped shade which is related to the current moment and is parallel to the coastline;
the summing unit is used for calculating the sum of the sine values of the current moment and the current moment, and taking the sum of the sine values of the current moment and the current moment as the moving amplitude of the strip-shaped mask which is related to the current moment and is parallel to the coastline;
a first calling unit, configured to call an integer function Ceil ((1-x) -0.5) with a decimal part of a sum of a moving direction and a moving amplitude of the strip-shaped mask parallel to the coastline associated with the current time as a parameter, and assign Ceil ((1-x) -0.5) to α, where x is the decimal part;
a second calling unit, configured to call the first cut-off function saturrate (α) with α as a parameter;
a third calling unit, configured to call a second cutoff function Lerp (power (2x, 8), 2x, saturrate (α)) with power (2x, 8), 2x, and saturrate (α) as parameters, and take a return value of the second cutoff function as a real-time strip-like mask parallel to the coastline, where power (2x, 8) represents raising 2x to 8 th
In the apparatus illustrated in fig. 2, the wave line forming module 202 may include a fourth invoking unit, a third calculating unit, and a fourth calculating unit, wherein:
a fourth calling unit, configured to call an rounding function Ceil (FlowMask- _ WaveLineWidth) with a difference between a real-time strip-shaped mask parallel to the coastline and the adjustable parameter of the wave line width as a parameter, where FlowMask is the real-time strip-shaped mask parallel to the coastline, and _wavelinewidthis the adjustable parameter of the wave line width;
a third calculating unit, for calling a second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) with return values of power (FlowMask x, 4), 0, Ceil (FlowMask x _ WaveLineWidth) as parameters, wherein power (FlowMask x, 4) indicates that FlowMask x is raised to 4 th power;
and a fourth calculating unit, configured to add a return value of a second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) to a partial real-time strip mask to obtain a real-time wave line, where the partial real-time strip mask is a product of the FlowMask and a preset decimal.
Optionally, in the above embodiment, the moving sea wave texture is made by: calling a first cut-off function Saturate (1- (SceneDepth-PixelDepth)/500 by taking 1- (SceneDepth-PixelDepth)/500 as a parameter, wherein SceneDepth-PixelDepth is the difference value of the scene depth and the pixel depth of a preset water surface patch; sampling textures of sea waves based on sea wave circulation speed adjusting parameters to obtain sea wave texture sampling values; and multiplying the return value of the first cut-off function Saturate (1- (scenDEpth-PixelDepth)/500) by the sampling value of the sea wave texture to obtain the moving sea wave texture.
Optionally, in the above embodiment, based on the wave cycle speed adjusting parameter, the texture of the wave is sampled, and the obtained wave texture sampling value may be: the texture of the sea wave and sin (Time _ wave loopspeed) and TexCoord0 are taken as parameters, a texture sampling function tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) is called, and the return value of the texture sampling function tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) is taken as a sea wave texture sampling value, wherein TexWave is the texture of the sea wave, WaveLoopSpeed is a sea wave circulation speed regulation parameter, Time is the current Time, sin (Time _ wave loopspeed) indicates that the sine value is obtained by multiplying the Time and the WaveLoopSpeed, and TexCoord0 is the coordinate of texture sampling.
Optionally, the apparatus illustrated in fig. 2 may further include a range control module 301, as shown in fig. 3, which is an apparatus for rendering ocean waves according to another embodiment of the present application. The range control module 301 is configured to control a display range of the sea wave according to the sampling value of the mask texture and a sea wave rendering effect moving relative to the coast in real time.
Alternatively, in the apparatus illustrated in fig. 3, the range control module 301 may include a fifth calculation unit, a sixth calculation unit, and an interval limitation unit, where:
the fifth calculation unit is used for obtaining a first Mask range value Mask01 through first operation according to the sea wave movement speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture;
the sixth calculating unit is used for obtaining a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture;
and the interval limiting unit is used for limiting the first Mask range value Mask01 and/or the second Mask range value Mask02 by adopting an interval limiting function to obtain the display range of the sea waves.
Optionally, the fifth calculating unit is specifically configured to calculate a first Mask range value Mask01 according to a calculation formula Mask01 ═ (tex, area Mask-0.5) + sin (Time _ Speed) _ Mask intensity, where tex, area Mask represents a sampling value of a Mask texture, Speed represents a sea wave movement Speed adjusting parameter, Time represents current Time, Speed _ Mask intensity represents a Mask intensity adjusting parameter, and sin (Time _ Speed) represents a sine function value obtained by calculating Time _ Speed; the sixth calculating unit is specifically configured to calculate a second Mask range value Mask02 according to a calculation formula Mask02 ═ (tex. area Mask-0.5) -sin (Time _ Speed) × Mask intensity.
According to the technical scheme, the real-time sea wave lines can be formed according to the scene depth and the pixel depth of the preset water surface patch, the prefabricated moving sea wave textures are mapped to the real-time strip-shaped shade, the real-time sea wave rendering effect moving relative to the coast is obtained, and finally the real-time sea wave rendering effect moving relative to the coast is superposed with the real-time sea wave lines, and the final sea wave rendering effect is obtained. Because the wave effect is relative coast removal in real time, compared with the prior art, can only show the simple effect that some wave textures flow, can not render the effect that the wave dashes to the bank from the sea, the variability of the wave that the technical scheme of this application was rendered out is stronger, makes the wave in the recreation scene more closely to the wave in the real world, gives the more real visual sense of game player.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 4, the computer device 4 of this embodiment mainly includes: a processor 40, a memory 41 and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a program of a method of rendering ocean waves. The processor 40, when executing the computer program 42, implements the steps in the above-described method embodiment of rendering ocean waves, such as the steps S101 to S104 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the acquiring module 201, the wave line forming module 202, the intermediate effect forming module 203, and the wave effect forming module 204 shown in fig. 2.
Illustratively, the computer program 42 of the method of rendering ocean waves mainly comprises: acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch; intercepting a real-time strip-shaped shade parallel to a coastline to form a real-time sea wave line; mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coasts; and superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves. The computer program 42 may be partitioned into one or more modules/units, which are stored in the memory 41 and executed by the processor 40 to accomplish the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions that describe the execution of the computer program 42 in the computer device 4. For example, the computer program 42 may be divided into the functions of the acquisition module 201, the wave line forming module 202, the intermediate effect forming module 203, and the wave effect forming module 204 (modules in the virtual device), and the specific functions of each module are as follows: the acquiring module 201 is configured to acquire a real-time strip-shaped mask parallel to a coastline according to a scene depth and a pixel depth of a preset water surface patch; a sea wave line forming module 202 for intercepting a real-time strip-shaped shade parallel to a coastline to form a real-time sea wave line; the middle effect forming module 203 is used for mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coastline; and the wave effect forming module 204 is used for superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves.
Computer device 4 may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a computing device 4 and is not intended to limit computing device 4 and may include more or fewer components than those shown, or some of the components may be combined, or different components, e.g., the computing device may also include an input-output computing device, a network access computing device, a bus, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. The memory 41 may also be an external storage computer device of the computer device 4, such as a plug-in hard disk provided on the computer device 4, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 41 may also include both an internal storage unit of the computer device 4 and an external storage computer device. The memory 41 is used for storing computer programs and other programs and data required by the computer device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as required to different functional units and modules, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/computer device and method may be implemented in other ways. For example, the above-described apparatus/computer device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a non-transitory computer readable storage medium. Based on such understanding, all or part of the processes in the method of the embodiments described above may also be implemented by a computer program instructing related hardware to complete, where the computer program of the method for rendering sea waves may be stored in a computer readable storage medium, and when being executed by a processor, the computer program may implement the steps of the embodiments of the methods described above, that is, obtaining a real-time strip-shaped mask parallel to a coastline according to a depth of a scene and a depth of pixels of a preset surface patch; intercepting a real-time strip-shaped shade parallel to a coastline to form a real-time sea wave line; mapping the prefabricated moving sea wave texture to a real-time strip-shaped shade parallel to a coastline to obtain a real-time sea wave rendering effect moving relative to the coasts; and superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The non-transitory computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the non-transitory computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, non-transitory computer readable media does not include electrical carrier signals and telecommunications signals as subject to legislation and patent practice. The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are described in further detail, it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present application should be included in the scope of the present invention.

Claims (12)

1. A method of rendering ocean waves, the method comprising:
acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch;
intercepting the real-time strip-shaped shade to form a real-time sea wave line;
mapping the prefabricated moving sea wave texture to the real-time strip-shaped shade to obtain a real-time sea wave rendering effect moving relative to the coast;
and superposing the real-time wave effect moving relative to the coast with the real-time wave line to obtain the final rendering effect of the waves.
2. A method of rendering ocean waves as defined in claim 1, wherein said obtaining a real-time strip-like mask parallel to a coastline based on a depth of a scene and a depth of pixels of a predetermined surface patch of water comprises:
determining the moving direction and the moving amplitude of a strip-shaped mask which is parallel to a coastline and is related to the current time according to the scene depth, the pixel depth, the current time and the sine value of the current time;
taking the decimal part of the sum of the moving direction and the moving amplitude;
and calculating the real-time strip-shaped mask parallel to the coastline by taking the decimal part as a variable.
3. A method of rendering ocean waves as defined in claim 2, wherein said determining a sum of a moving direction and a moving amplitude of a strip-like mask parallel to a coastline associated with a current time based on said scene depth, said pixel depth, said current time, and a sine of said current time comprises: calculating a difference value between the scene depth and the pixel depth, and taking the difference value as a moving direction of a strip-shaped mask which is related to the current moment and is parallel to a coastline; calculating the sum of the sine values of the current time and the current time, and taking the sum of the sine values of the current time and the current time as the moving amplitude of the strip-shaped mask which is related to the current time and is parallel to the coastline;
the calculating the real-time strip-shaped mask parallel to the coastline by taking the decimal part as a variable comprises the following steps: calling an integer function Ceil ((1-x) -0.5) by taking the decimal part as a parameter, and assigning Ceil ((1-x) -0.5) to alpha, wherein x is the decimal part; calling a first cut-off function Saturate (alpha) by taking the alpha as a parameter; and calling a second truncation function Lerp (power (2x, 8), 2x, Saturate (alpha)) by taking power (2x, 8), 2x and Saturate (alpha) as parameters, and taking a return value of the second truncation function as the real-time strip-shaped mask parallel to the coastline, wherein the power (2x, 8) represents that 2x is raised to the power of 8.
4. A method of rendering ocean waves as defined in claim 1, wherein said intercepting said real-time strip-like mask to form a real-time ocean wave line comprises:
taking the difference between the real-time strip-shaped mask and the adjustable parameter of the sea wave line width as a parameter, and calling a rounding function Ceil (FlowMask- _ WaveLineWidth), wherein the FlowMask is the real-time strip-shaped mask, and the WaveLineWidth is the adjustable parameter of the sea wave line width;
calling a second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask _ WaveLineWidth)) with a return value of power (FlowMask x, 4), 0, Ceil (FlowMask x, 4) as a parameter, wherein the power (FlowMask x, 4) represents raising FlowMask x to 4 th power;
adding a return value of the second truncation function Lerp (power (FlowMask x, 4), 0, Ceil (FlowMask-WaveLineWidth)) to a part of the real-time strip-shaped mask to obtain the real-time wave line, wherein the part of the real-time strip-shaped mask is the product of the FlowMask and a preset decimal.
5. A method of rendering ocean waves as defined in claim 1, wherein the moving ocean wave texture is produced by:
calling a first cut-off function Saturate (1- (SceneDepth-PixelDepth)/500 by taking 1- (SceneDepth-PixelDepth)/500 as a parameter, wherein the SceneDepth-PixelDepth is the difference value between the scene depth and the pixel depth;
sampling textures of sea waves based on sea wave circulation speed adjusting parameters to obtain sea wave texture sampling values;
and multiplying the return value of the first cut-off function Saturate (1- (scenDEpth-PixelDepth)/500) by the sea wave texture sampling value to obtain the moving sea wave texture.
6. A method for rendering sea waves as defined in claim 5, wherein the step of sampling the texture of the sea waves based on the sea wave cycle speed adjustment parameter to obtain sea wave texture sampling values comprises:
and calling texture sampling functions tex2D (TexWave, sin (Time) wave loopspeed) + TexCoord0) by taking texture of the sea wave and sin (Time _ wave loopspeed) and TexCoord0 as parameters, taking a return value of the texture sampling functions tex2D (TexWave, sin (Time _ wave loopspeed) + TexCoord0) as a sea wave texture sampling value, wherein the TexWave is texture of the sea wave, the _ wave loopspeed is a sea wave circulation speed regulation parameter, the Time is the current Time, and the sin (Time _ wave loopspeed) represents that a sine value is obtained by multiplying the Time and the wave loopspeed, and the TexCoord0 is a sampling coordinate of the texture.
7. A method of rendering ocean waves according to any one of claims 1 to 6, wherein the method further comprises:
and controlling the display range of the sea waves according to the sampling value of the mask texture and the real-time sea wave rendering effect moving relative to the coast.
8. A method of rendering ocean waves as defined in claim 7, wherein the controlling the display range of the ocean waves according to the sampled values of the mask texture and the rendering effect of the ocean waves moving relative to the coast in real time comprises:
obtaining a first Mask range value Mask01 through a first operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture;
obtaining a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture;
and limiting the first Mask range value Mask01 and/or the second Mask range value Mask02 by adopting an interval limiting function to obtain the display range of the sea wave.
9. The method for rendering sea waves according to claim 8, wherein the obtaining a first Mask range value Mask01 through a first operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampled value of the Mask texture comprises: calculating to obtain the first Mask range value Mask01 according to a calculation formula Mask01 ═ (tex, area Mask-0.5) + sin (Time _ Speed) _ Mask intensity, wherein tex, area Mask represents a sampling value of the Mask texture, Speed represents the sea wave movement Speed adjusting parameter, Time represents the current Time, Mask intensity represents the Mask intensity adjusting parameter, and sin (Time _ Speed) represents that a sine function value is obtained for Time _ Speed;
the obtaining of a second Mask range value Mask02 through a second operation according to the sea wave moving speed adjusting parameter, the Mask strength adjusting parameter and the sampling value of the Mask texture comprises: the second Mask range value Mask02 is calculated according to the calculation formula Mask02 ═ (tex. area Mask-0.5) -sin (Time _ Speed) _ Mask intensity.
10. An apparatus for rendering ocean waves, the apparatus comprising:
the acquiring module is used for acquiring a real-time strip-shaped mask parallel to a coastline according to the scene depth and the pixel depth of a preset water surface patch;
the sea wave line forming module is used for intercepting the real-time strip-shaped shade to form a real-time sea wave line;
the middle effect forming module is used for mapping the prefabricated moving sea wave textures to the real-time strip-shaped shade to obtain a real-time sea wave rendering effect moving relative to the coast;
and the wave effect forming module is used for superposing the real-time wave effect moving relative to the coast and the real-time wave line to obtain the final rendering effect of the waves.
11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method of rendering ocean waves according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of rendering ocean waves according to any one of claims 1 to 9.
CN202110580640.4A 2021-05-26 2021-05-26 Method, device, equipment and computer-readable storage medium for rendering sea waves Active CN113345066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110580640.4A CN113345066B (en) 2021-05-26 2021-05-26 Method, device, equipment and computer-readable storage medium for rendering sea waves

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110580640.4A CN113345066B (en) 2021-05-26 2021-05-26 Method, device, equipment and computer-readable storage medium for rendering sea waves

Publications (2)

Publication Number Publication Date
CN113345066A true CN113345066A (en) 2021-09-03
CN113345066B CN113345066B (en) 2022-07-22

Family

ID=77472183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110580640.4A Active CN113345066B (en) 2021-05-26 2021-05-26 Method, device, equipment and computer-readable storage medium for rendering sea waves

Country Status (1)

Country Link
CN (1) CN113345066B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181382A1 (en) * 2003-03-14 2004-09-16 Yaohua Hu Visualizing the surface of a liquid
US20050228625A1 (en) * 2004-04-12 2005-10-13 Lachman Lawrence M Method and system for modeling ocean waves
CN102789650A (en) * 2012-07-19 2012-11-21 中国科学院软件研究所 Sea surface track parallel simulation method based on particle system
CN103021010A (en) * 2012-12-01 2013-04-03 王爽 Wave effect realtime rendering method based on graphics processing unit (GPU)
US20130321441A1 (en) * 2012-06-05 2013-12-05 Aroon Pahwa Method, system and apparatus for rendering a map according to texture masks
CN104574518A (en) * 2014-12-26 2015-04-29 浙江大学 Semi-physical drawing method for large-scale ocean scene with rich details
CN106530411A (en) * 2016-11-17 2017-03-22 姜雪伟 GPGPU-rendering-based simulation method and simulation system for 3D sea water
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN107292961A (en) * 2017-06-30 2017-10-24 浙江科澜信息技术有限公司 A kind of method for realizing that earth ocean water is imitated in three-dimensional scenic
CN107918949A (en) * 2017-12-11 2018-04-17 网易(杭州)网络有限公司 Rendering intent, storage medium, processor and the terminal of virtual resource object
CN108230436A (en) * 2017-12-11 2018-06-29 网易(杭州)网络有限公司 The rendering intent of virtual resource object in three-dimensional scenic
CN109876441A (en) * 2019-03-13 2019-06-14 网易(杭州)网络有限公司 Rendering method and device, storage medium and electronic equipment in game
US20210094173A1 (en) * 2019-01-03 2021-04-01 Lucomm Technologies, Inc. System for Physical-Virtual Environment Fusion
CN112734891A (en) * 2021-01-08 2021-04-30 中国船舶重工集团公司第七0七研究所 Water body rendering implementation system and method based on Unity3D
CN112819941A (en) * 2021-03-05 2021-05-18 网易(杭州)网络有限公司 Method, device, equipment and computer-readable storage medium for rendering water surface

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181382A1 (en) * 2003-03-14 2004-09-16 Yaohua Hu Visualizing the surface of a liquid
US20050228625A1 (en) * 2004-04-12 2005-10-13 Lachman Lawrence M Method and system for modeling ocean waves
US20130321441A1 (en) * 2012-06-05 2013-12-05 Aroon Pahwa Method, system and apparatus for rendering a map according to texture masks
CN102789650A (en) * 2012-07-19 2012-11-21 中国科学院软件研究所 Sea surface track parallel simulation method based on particle system
CN103021010A (en) * 2012-12-01 2013-04-03 王爽 Wave effect realtime rendering method based on graphics processing unit (GPU)
CN104574518A (en) * 2014-12-26 2015-04-29 浙江大学 Semi-physical drawing method for large-scale ocean scene with rich details
CN106530411A (en) * 2016-11-17 2017-03-22 姜雪伟 GPGPU-rendering-based simulation method and simulation system for 3D sea water
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN107292961A (en) * 2017-06-30 2017-10-24 浙江科澜信息技术有限公司 A kind of method for realizing that earth ocean water is imitated in three-dimensional scenic
CN107918949A (en) * 2017-12-11 2018-04-17 网易(杭州)网络有限公司 Rendering intent, storage medium, processor and the terminal of virtual resource object
CN108230436A (en) * 2017-12-11 2018-06-29 网易(杭州)网络有限公司 The rendering intent of virtual resource object in three-dimensional scenic
US20210094173A1 (en) * 2019-01-03 2021-04-01 Lucomm Technologies, Inc. System for Physical-Virtual Environment Fusion
CN109876441A (en) * 2019-03-13 2019-06-14 网易(杭州)网络有限公司 Rendering method and device, storage medium and electronic equipment in game
CN112734891A (en) * 2021-01-08 2021-04-30 中国船舶重工集团公司第七0七研究所 Water body rendering implementation system and method based on Unity3D
CN112819941A (en) * 2021-03-05 2021-05-18 网易(杭州)网络有限公司 Method, device, equipment and computer-readable storage medium for rendering water surface

Non-Patent Citations (9)

* Cited by examiner, † Cited by third party
Title
张维: "海洋场景绘制关键技术研究及实现", 《实验科学与技术》, no. 05, 28 October 2016 (2016-10-28) *
彭晶等: "基于投影网格算法的海面波浪模拟", 《武汉工程大学学报》, no. 05, 15 October 2018 (2018-10-15) *
朱安宏: "基于分形理论与纹理映射的3D海浪仿真", 《现代电子技术》, no. 18, 15 September 2009 (2009-09-15) *
李起成等: "动态天空环境下的实时海洋渲染", 《计算机辅助设计与图形学学报》, no. 02, 20 February 2007 (2007-02-20) *
罗玉等: "基于海浪谱的3D海浪模拟", 《武汉理工大学学报(交通科学与工程版)》, no. 02, 15 April 2008 (2008-04-15) *
谢攀等: "基于Perlin噪声的海面仿真在Vega Prime中的应用", 《计算机应用研究》, no. 11, 15 November 2009 (2009-11-15) *
金文标等: "基于频谱的海浪实时模拟", 《重庆邮电大学学报(自然科学版)》, no. 03, 15 June 2009 (2009-06-15) *
陆兴华等: "基于Android系统的自适应跟踪场景渲染技术", 《计算机与网络》, no. 18, 26 September 2015 (2015-09-26) *
陆晓: "基于OpenGL的海面波浪模拟研究", 《无线电通信技术》, no. 06, 22 October 2018 (2018-10-22) *

Also Published As

Publication number Publication date
CN113345066B (en) 2022-07-22

Similar Documents

Publication Publication Date Title
JP7386153B2 (en) Rendering methods and terminals that simulate lighting
CN108470369B (en) Water surface rendering method and device
CN111508052B (en) Rendering method and device of three-dimensional grid body
CN107680042B (en) Rendering method, device, engine and storage medium combining texture and convolution network
CN110211218B (en) Picture rendering method and device, storage medium and electronic device
JP2017521766A (en) 3D model rendering method and apparatus, and terminal device
CN106898040B (en) Virtual resource object rendering method and device
CN107527322B (en) Rendering method, device, engine and storage medium combined with convolutional neural network
CN104574495A (en) Method and device for rendering image
CN112819941B (en) Method, apparatus, device and computer readable storage medium for rendering water surface
CN107742317B (en) Rendering method, device and system combining light sensation and convolution network and storage medium
GB2531427A (en) Graphics processing systems
CN108074285B (en) Volume cloud simulation method and volume cloud simulation device
CN114742931A (en) Method and device for rendering image, electronic equipment and storage medium
CN113052923B (en) Tone mapping method, tone mapping apparatus, electronic device, and storage medium
CN112516595B (en) Magma rendering method, device, equipment and storage medium
CN113345066B (en) Method, device, equipment and computer-readable storage medium for rendering sea waves
WO2024002064A1 (en) Method and apparatus for constructing three-dimensional model, and electronic device and storage medium
CN110136262B (en) Water body virtual visualization method and device
CN110599576A (en) File rendering system and method and electronic equipment
CN109658495B (en) Rendering method and device for ambient light shielding effect and electronic equipment
CN114549732A (en) Model rendering method and device and electronic equipment
EP3437072A1 (en) System and method for rendering points without gaps
CN115641402A (en) Water body rendering method and device and electronic equipment
CN117557710B (en) Texture rendering method and device, terminal equipment and storage medium

Legal Events

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