SlideShare a Scribd company logo
1 of 156
Download to read offline
Water Technology of Uncharted


Carlos Gonzalez Ochoa
Graphics Programmer – Naughty Dog

Doug Holder
Fx Artist – Naughty Dog
                                    1
Contributors

Eben Cook         Matt Morgan
Michal Iwanicki   Jerome Durand
Ryan Broner       Peter Field
Vincent Marxen    Junki Saita
Jacob Minkoff     Marshall Robin


                                   2
Action and Adventure

                                                 Not a “water” game

                                                                                                            3
Uncharted is an action adventure game. Game play is combat and exploration. Itʼs not about water gameplay

There are tons of environments: Jungle, temples, cities, caverns, ruins, etc
In each we generally add some water element. puddles, streams, rivers, pools, lakes, and lastly the ocean
Water has been a major design element and we have improved it through the series
4
well, not always...




                      4
5
Water in many forms




                      6
From small to large bodies of water
                                      7
Interaction with the water. Clothes get wet


                                              8
Fast moving




              Slow and hard to
              navigate

                                 9
10
The game has a very particular art style and the water had to be able to match it

Water has to move
Has to look better
Previous work... lots of it

     Crysis, Kameo, Resistance, Bioshock, Halo and
       many, many others
     Perfect storm, Cast Away, Poseidon, Surf’s Up,...
     Tech demos
     Scientific visualization
     SIGGRAPH, IEEE, I3D papers

                                                                                                                                       11
We saw lots of reference work in games, films and other scientific papers. The work in Scientific visualization was key for the work in
flow
river level




                                                                                                                                    12
Complex refraction/reflection model
Flow: Scroll uvs (per pixel/vertex) of normal map by a vector field
Refraction: depth based jitter and coloring
Foam movement using a threshold operation on a gradient field
Churn: further depth based coloring.Use foam texture to modulate water depth, blend again. Pseudo-volumetric effect
All parameters are artist controlled!
river level




                                                                                                                                    12
Complex refraction/reflection model
Flow: Scroll uvs (per pixel/vertex) of normal map by a vector field
Refraction: depth based jitter and coloring
Foam movement using a threshold operation on a gradient field
Churn: further depth based coloring.Use foam texture to modulate water depth, blend again. Pseudo-volumetric effect
All parameters are artist controlled!
Shader


                                                                                 Geometric                  Bumped
                                                                                  Normal                    Normal
                    Foam modulated                                                                                                        Reflection w/
                     by wave height                                                                                                           jitter
                                                                                                                                                                                         Flow

                              Wave
                              height                                                                                                                                          Depth color
                                                                            Churn color and                                                                                  attenuation by
                                                                           depth color mixed                                                                                 distance to bg
                                                                                                                                              Depth distance
                                                                            by wave height
                                                                                     §       =                                                        Refraction w/ jitter




                                                                                                                                                                                                13
The water shading uses already used ideas:
Use a bump map to jitter the normal of the surface.
Use a fresnel term using the jittered normal to blend between a refraction and reflection contribution.

In addition, we use other ideas to modulate the coloring of each contribution
We add foam that get lit on top of the reflection and refraction. We can also choose to mix the foam w/ the refraction, this can create muck

We use churn to simulate a volumetric effect

Refraction. We color the refraction depending on the distance between the surface of the water and the background
 The depth coloring can be a linear or exponential function
 The depth coloring can be affected by churn. We take one channel of the foam texture to blend between the depth coloring and the "churn" coloring.
 As the foam moves (which it also gets modulated by the waves), the coloring changes with the waves and the foam scrolling

The reflection can also be added on top the refraction instead of just blended.
All fresnel coefficients, start-end are artist controlled
Water shader by layers




                         14
Reflection - no bump




                       15
Reflection - with bump




                         16
Refraction




                                                           17
The reflection and refraction are blended using a fresnel
coefficient
Reflection - depth based color - no bump




                                                                                                    18
Depth based function is used to blend a base color and the refraction color. Here no jittering is
applied.
Reflection - depth based color - with bump




                                               19
The jitter factor is also modulated by the
depth
Soft shadows




               20
Foam - modulated by wave’s amplitude




                                                     21
Foam and churn which add a texture above and below
The foam is also moving by the flow
Specular lighting




                    22
Final




        23
Bumped
                                                          Geometric
                                                           Normal              Normal
               Foam modulated                                                           Reflection w/
                by wave height                                                              jitter
                                                                                                                                   Flow
                      Wave
                      height                                                                                            Depth color
                                                       Churn color and                                                 attenuation by
                                                      depth color mixed                                                distance to bg
                                                                                            Depth distance
                                                       by wave height
                                                              §     =                           Refraction w/ jitter




                                                                                                                                          24
We will look into how we moved the normal maps, this is the key of the water
shader
Flow shader
         Vector field used to advect mesh properties
            UV scrolling
            Displacement


         Shader based on scientific visualization work:
            N. Max, B. Becker, “Flow Visualization using Moving Textures”, 96
            F. Neyret. “Advected Textures”, 03


                                                                                 25
The flow shader was originally created by C. Gonzalez-Ochoa at ND for Uncharted
1.
Blend value
                                                                                                                 1

                                                                                                                 0
                                                                                                                     0   1     2      3    4   5
                                                                                                                                time


                                                                                                                     UV distance movement
                                                                                                                 1

                                                                                                                 0
                                                                                                                                   time

                                                                                                                               Texture 1
                                                                                                                               Texture 2

                                                                                                                                                   26
Here is an example of flow using a vertex shader to compute the blend values for triangles (instead of pixels).

Remember, to scroll in the right direction the uvs should move OPPOSITE to the intended direction
Blend value
                                                                                                                 1

                                                                                                                 0
                                                                                                                     0   1     2      3    4   5
                                                                                                                                time


                                                                                                                     UV distance movement
                                                                                                                 1

                                                                                                                 0
                                                                                                                                   time

                                                                                                                               Texture 1
                                                                                                                               Texture 2

                                                                                                                                                   26
Here is an example of flow using a vertex shader to compute the blend values for triangles (instead of pixels).

Remember, to scroll in the right direction the uvs should move OPPOSITE to the intended direction
27
We can use several other effects besides using the basic flow. Here we use a second fetch (feedback) to give extra
fluidity
Blend between two “flow” textures, one offset in
             phase by τ/2


          Ways to improve it:
             Offset the placement after each cycle
             Offset uv starting position to minimize distortion
             Offset in space the phase
             Use texture feedback (ping back) to get extra motion




                                                                                                                                    28
There are many ways to improve flow.
Since the texture moves in cycles of Tau seconds, the improvements come from where the texture starts moving from (1 and 2 above)
The offset in space, is when using flow on a vertex shader and we want each pixel to blend at a different rate.
Be careful because one does not want to big discontinuities across the whole texture.
Flow shader
                   half3 result, tx1, tx2;
                   half s = .1; // small value

                   float                     timeInt                      = (g_time) / (interval * 2);
                   float2                    fTime =                      frac(float2(timeInt, timeInt + .5));
                   float2                    flowUV1                      = uv - (flowDir/2) + fTime.x * flowDir.xy;
                   float2                    flowUV2                      = uv - (flowDir/2) + fTime.y * flowDir.xy;

                   tx1 = FetchTexture(flowUV1);
                   tx2 = FetchTexture(flowUV2);
                   tx1 = FetchTexture(flowUV1 + s*tx1.xy); //[optional] Fetch 2nd
                   tx2 = FetchTexture(flowUV2 + s*tx2.xy); //time for extra motion
                   result = lerp(tx1,tx2, abs((2*frac(timeInt))-1);

                                                                                                                                                                                     29
This is the most basic flow shader.

There are many ways to improve it. By adding an offset to where the texture starts:

float2 offset1 = float2(floor(timeInt) .1);
float2 offset2 = float2 (floor(timeInt + .5) * .1 + .5);

flowUV2 = uv + offset1 - (flowDir/2) + fTime.x * flowDir,xy;
flowUV2 = uv + offset2 - (flowDir/2) + fTime.y * flowDir.xy;

-----------
Offset the uv starting position to minimize distortion. One wants the uv coordinates to have less distortion (that mean their displacement is 0) when the blend is at its maximum.
         float timeInt = (g_time) / (interval * 2);
          float2 fTime = frac(float2(timeInt, timeInt + .5));
          float2 flowUV1 = uv - (flowDir/2) + fTime.x * flowDir.xy + .5 * flowDir.xy;
          float2 flowUV2 = uv - (flowDir/2) + fTime.y * flowDir.xy + .5 * flowDir.xy;

-----------

You can spread around where the phase changes, this is easy to do if the flow is done on a pixel shader (not on triangles)
      float timeInt = (g_time) / (interval * 2);
      float offsetPhase = phaseScale * FetchPhaseTexture(u,v); // texture goes from 0..1
       float2 fTime = frac(offsetPhase + float2(timeInt, timeInt + .5));
      ------------
      You can think on many other ways to use flow.

         Scientific visualization results can be handy to do cool shader effects.
Easy to author
         ND Maya tool
                                                                                       Start
          Dir, velocity
          Foam, phase
                                                                                                                    End
         Flow gives players
         a direction to where
         to go.
                                                                                                          sunken ruins level
                                                                                                                           30
This is the Maya tool used in all the Uncharted games.
The tool uses splines to define the direction and color maps to control the magnitude of the velocities.
Also,we can generate foam maps, and phase (for displacement).
Later we will talk more about the basic flow displacement
sunken ruins level
                 31
Flow based displacement
                 Each vertex moves on                                                                                                          Global axis
                 a circular pattern at a
                 different phase φ


                                                                                                                                           Flow
   x1’=x1+cos(αt +φ1)                                     x2’=x2+cos(αt +φ2)                                                           direction
   y1’=y1 +sin(αt +φ1)                                    y2’=y2 +sin(αt +φ2)
                                                                                                                                                         32
Flow can also be used for displacement.
In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's.
In addition to a vector field, we encoded a a phase field over the mesh.
Every vertex moves in a anisotropic scaled circle.

So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves.
Of course these waves will not be as dramatic nor complex as the one in U3
Flow based displacement
                 Each vertex moves on                                                                              Local axis
                 a circular pattern at a
                 different phase φ


                                                                                                                                           Flow
   x1’=x1+cos(αt +φ1)                                     x2’=x2+cos(αt +φ2)                                                           direction
   y1’=y1 +sin(αt +φ1)                                    y2’=y2 +sin(αt +φ2)
                                                                                                                                                   32
Flow can also be used for displacement.
In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's.
In addition to a vector field, we encoded a a phase field over the mesh.
Every vertex moves in a anisotropic scaled circle.

So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves.
Of course these waves will not be as dramatic nor complex as the one in U3
Flow based displacement
                                                                                                                    Rotated
                 Each vertex moves on                                                                              Local axis
                 a circular pattern at a
                 different phase φ


                                                                                                                                               Circular
   x1’=x1+cos(αt +φ1)                                     x2’=x2+cos(αt +φ2)                                                                    Motion
   y1’=y1 +sin(αt +φ1)                                    y2’=y2 +sin(αt +φ2)
                                                                                                                                                          32
Flow can also be used for displacement.
In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's.
In addition to a vector field, we encoded a a phase field over the mesh.
Every vertex moves in a anisotropic scaled circle.

So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves.
Of course these waves will not be as dramatic nor complex as the one in U3
33
Flow

            Useful for lots of other effects

            Clouds, sand, snow, psychedelic effects...

            See Keith Guerrette’s GDC 2012 talk
            “The Tricks Up Our Sleves....”

                                                                                                       34
We have used flow for sand moving on top of the dunes, the psychedelic effects in U3, cloud movement.
FX artists even use it for fire and trails
Water good enough for




What is next?




                        35
early 2009 idea


                      “What if we have a ship in a storm...
                     and we turn it 180 degrees and sink it?
                          Wouldn’t that be awesome?”

                                                                                   Jacob Minkof
                                                                                    Lead Designer

                                                                                                    36


Simple displacement mesh with a shader will not be enough for this idea
The cruise ship


                                        37
Nor for this rough ocean
Ship graveyard


                                                                                                                                                        38
This one was crazy. There is so much detail that we needed to capture on the ocean. All the action on the ship graveyard would be close to the water.
We would smoothly transition from a calm ocean to a stormier and stormier ocean
*




    39
*




* Thanks, we truly appreciate the challenge
                                              39
Ocean
         Render challenges
            Open ocean, big waves (100 meters+)


         Waves drive boats and barges
            Animation loops were considered but not used


         Swimming
                                                                                                                                                                          40
Initially designers thought about using a can animation for the cruise boat
(silly designers, we can do better)
One problem was that once we are on the boat is hard to read the scale of the waves.
We are high on the boat and the camera attached to the player smooths out the waves.To compensate we have to exaggerated the amplitude of the waves to read as a storm.
Ocean

Wave System
Procedural
Parametric
Deterministic
LOD


                41
Procedural


                           Simulation = too expensive
                      Perlin like noise = not that good visually




                                                                                                                      42
Procedural geometry and animation are good if we can find a good model.
Simulation would be too expensive to compute (even in SPUs) and hard to control by designers
Perlin noise results are not that great visually, tend to look very artificial
The FFT technique is great, but the parameters are hard to control and tweak by artists. Also is hard to get right.
Parametric
         Evaluate at any point in R domain                                                       2



                                       F(<u,v>, t, parameters) → <x,y,z>

                                 Vector displacement, not a heightfield




                                                                                                        43
Since we would have an ocean any point should be able to be computed.
The ocean was not restricted to a fixed grid and had to be compatible with other parametric equations.
This way we could do a compositing wave system

It’s important to note we are generating a vector displacement.
One would need a super fine mesh to have by sharp wave peaks with a heightfield.
Its easier with a vector displacement, one does not need a fine mesh for it.
Deterministic
         Evaluate at any point in R space and time                                             2



                                      F(<u,v>, t, parameters) → <x,y,z>

                                 Needed for cutscenes and multiplayer




                                                                                                                        44
For FMA scenes we needed to be able to rewind the ocean, so we cannot "advance" the state. So our system is stateless
Our system is completely stateless
Waves
          Gerstner waves
           - Simple but not enough high frequency detail
           - Can only use few [big swells] before it’s too expensive


               




                                                                                                                                                                         45
So all these requirements force us to certain techniques to use to evaluate waves.
So the easiest ones are the Gerstner waves. These are the workhorse of waves, any one uses them. However, they get expensive to evaluate to get a good number (20+) of them.

The FFT technique is the most realistic one. But is hard to get the right parameters, the artists have to spend lot of time searching for the “correct” values
We also found some tiling artifacts when one has small grid resolutions (64 side)
Waves
            Gerstner waves
             - Simple but not enough high frequency detail
             - Can only use few [big swells] before it’s too expensive


            FFT Waves - Tessendorf “Simulating Ocean Water”, 1999
              + Realistic, more detail
              - Spectrum of frequencies - hard for artists to control
                   ½           Tiling visual artifacts at low resolution grids


                                                                                                                                                            46
So all these requirements force us to certain techniques to use to evaluate waves.
So the easiest is Gerstner waves. The work horse of waves, any one uses them. However, they get expensive to evaluate to get a good number (20+) of them.
FFT again the most realistic ones. But as we said, hard to get right parameters. We found some tiling artifacts
Wave Particles
         Yuksel, House, Keyser, SIGGRAPH 2007
                Waves            from point sources

                                                                                             http://www.cemyuksel.com/research/waveparticles/



                Ours   -> Don’t use point sources
                  Instead, in a toroidal domain place a random distribution of
                  particles to approximate the chaotic motion of open water
               
                Random positions and velocities within a some speed bounds
               →       Yields a tileable vector displacement field


                                                                                                                                                47
This is the main idea to get our open ocean waves. It's easy to implement and to optimize.
See the Wave Particle paper for more details
β=0
β=.5
β=1




       48
49
Wave Particles
+ Intuitive for artists to control
+ No tiling artifacts
+ Fast! Good for SPU vectorization
      [Optimization by Michal Iwanicki]

+ Deterministic in time. No need to move particles
  New position is derived from initial position,
     velocity and time

                                                     50
Composition of displacement grids at different scales ≈ octaves



                                                                  51
Composition of displacement grids at different scales ≈ octaves
               Can also be translated over time
                     Fade out by distance
                                                                  52
Wave field

         Gerstner waves (x4)

                                                                                 +
         Wave particles
              (1 grid used x4)

                                                                                   =


                                                                                                   53
At this point , the displacement field, evaluates 4 gerstner waves plus 4 wave-particle grids per
vertex
Flow grid: Encode flow, foam, amplitude multipliers in a grid




     Base grid with flow curves

                                                                54
Flow grid: Encode flow, foam, amplitude multipliers in a grid




     Flow vectors (direction and magnitude)

                                                                55
Flow grid: Encode flow, foam, amplitude multipliers in a grid




     Wave amplitude

                                                                56
Wave’s amplitude


            modulates foam




                                                                              57
The foam modulation is outputed as a vertex color when we generate the final
mesh
58
59
Hey, we need this!




                     59
Addition of simpler waves

         Gerstner waves (x4)
                                                                             +
         Wave particles (x4)

         Big wave                                                            +

                                                                               =


                                                                                                                                 60
In addition to the previous waves, we add a custom artist wave.

This type of wave will be used for the crash wave scene and to also keep the player from swimming away from the game play area
v
                                                                                                                    Π
                                u                                                                              <x,y> → <u,v>

                             Big wave - Orient a square region Π over domain
                                                                                                                               61
The wave is quite easier to construct. We need to reparametrize a rectangular domain over the plane.
The rectangle can be though as the base of a NURBS patch.
We can use the (u,v)->(0..1, -1..1) domain or the normalized one(0..1, 0..1), depending where is the center.
The u is used to parameterize a Bspline curve. The v we extrude the curve and tapper it.

The subdomain can be scaled and translate over time to animate the wave
v
u                                  <x,y> → <u,v>

Big wave - Create a Bspline curve oriented in the u direction
                                                                62
v
u


Big wave - Extrude the Bspline along v direction
                                                   63
v
u
                     y = ½ (cos(2πv-π)+1) · bspline(u)

Big wave - Taper on the sides
                                                         64
v
u
                         y = cos(π(2v - ½)) · bspline(u,t)

Big wave - Translate, scale region or curve over time
                                                             65
66
67
68
This is a partial formula of the whole wave system.
The bspline is a uniform, non-rational bspline. We could have used a Bezier but it requires more code.

The grid(u,v) function returns a scalar value given the u,v, coordinates. In this case, we have a multiplier for the wave scale
LOD

Many ways to create the water mesh

Screen projected grid → aliasing artifacts
Quasi projected grid → issues handling large
                       displacements

                                               69
Irregular Geometry Clipmaps

             Based on:
              Losasso, Hoppe, “Geometry Clipmaps: Terrain
              Rendering Using Nested Regular Grids”
              SIGGRAPH 04


         Modified for water rendering

                                                                                    70
The irregular geometry clipmaps have different way to partition the rings and the
blocks.
Irregular Geometry Clipmaps

Different splits to fix T-joints across ring levels
Dynamic blending between levels
Patches lead to better SPU utilization




                                                      71
72
As the camera moves, the rings will move quads from one side to the other.

Any point in a ring will always be sampled from the same place. This way, we don’t have any jittering and aliasing problems
Ring 1

Ring 2

Ring 3

Ring 3
...

         73
74
75
76
77
78
79
80
81
Single
  Ring




         82
Normal
Patches


Fixer
Patches




          83
84
This is the general patch divisions. On a ring there are 16 patches.
The lowest level ring would have an additional patch in the center
Splits will always
avoid T-joints with next
ring




Fixer patches give
“space” between this
and previous ring

                           85
Border triangulation fixing
                              Ring 2
      T-corner fixes

                              Ring 1
           Skipped
            indices




                                       86
Border blending
                       Ring 2
     Vertex blending
                area
                       Ring 1




                                87
T-joint fixes
                Vertex blending




                                  88
Culling

         Cull out patches that are
          outside frustum


         Frustum-bbox test




                                                                                                                               89
2 pass culling. First we generate bounding boxes with some extra slack from 4 corners and perform a quick intersection test.

After we generate the displaced surface, we have a tighter bbox, and can perform another intersection test.
90
91
Video of the ocean clipmap rendering. In wireframe is easier to see how the clipmap levels are
rendered
Into the lion’s den




                                                                                                                                                                         92
Although we are inside the ballroom, we can see out the ocean. Furthermore the waves are moving the boat, so the chandeliers are being driven indirectly by the waves.

To heighten the drama we are closer to the water level
93
Culling
         Use portals to show patches seen from windows
         For waves intersecting ballroom:
          Use box aligned with ballroom to clamp down vertices




                                                                                                               94
Another problem is that the ballroom is too low to the water line and we had clipping issues with big waves.
The solution is simple, test the points to a box, oriented to the ballroom, and push the vertices down
So something happens to the ship...




                                                                                                95
There is a sequence in U3, the Drakes goes from the top of the cruise-ship to the cargo hold.
At the cargo hold, Drake does what he does best: destroy everything
96
The ocean system is used in all the water in this sequence, we just change the shader and
parameters.
96
The ocean system is used in all the water in this sequence, we just change the shader and
parameters.
97
97
and we come back to the ballroom




                                   98
Ballroom
●Intersection   with water




                             99
100
We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship.

We would switch parameters and shader of the water. At some points between 2 frames.

The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game.
We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage.

We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane.
At some point we thought of using a curved glass, but we ran out of time.
Above and below water line
                                                                 Ocean waves lapping on the windows
                                                                                               Flood




                                                                                                                                       100
We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship.

We would switch parameters and shader of the water. At some points between 2 frames.

The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game.
We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage.

We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane.
At some point we thought of using a curved glass, but we ran out of time.
Above and below water line
                                                                 Ocean waves lapping on the windows
                                                                                               Flood




                                                                             See Eben Cooks’ GDC 2012 talk
                                                                            “Creating the Flood Effects in U3”


                                                                                                                                       100
We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship.

We would switch parameters and shader of the water. At some points between 2 frames.

The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game.
We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage.

We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane.
At some point we thought of using a curved glass, but we ran out of time.
Skylight scene




                 skylight [top down view]
                                            101
Skylight scene
Cull out patches that are
 outside frustum
Frustum-bbox test




                            skylight [top down view]
                                                       101
Skylight scene
Cull out patches that are
 outside frustum
Frustum-bbox test



Cull out patches outside skylight
Plane-bbox test


                                    skylight [top down view]
                                                               101
These ones still remain
Skylight scene
Cull out patches that are
 outside frustum
Frustum-bbox test



Cull out patches outside skylight
Plane-bbox test


                                    skylight [top down view]
                                                               101
Skylight scene
               For rendering use shader discard operation to do plane
               clipping
               For evaluation clamp down points inside ballroom bbox




        skylight
                                                                        102
The culling using the shader was simple a plane culling
Skylight scene (90 degree cruise-ship)
           Fake underwater fog with a polygon “curtain” driven by the
          water movement (Eben’s Cook hack)




                                                                                                                                               103
Faking the underwater fog was more complicated.
Eben Cook did an awesome job figuring out a way to realize the effect without multipasses.
He used a polygon skirt that is driven by the waves and it covers the back of the glass. The skirt shader simulates the fog effect of water.
104
104
105
105
106
Floating objects
         Sample points and best fit a plane for orientation
         On intersection areas, multiply down amplitude




                                                                                   107
Depending on object, we can sample some points and best fit a plane to orient the
object
Attaching objects
Sample points and best fit a plane for orientation
On intersection areas, multiply down amplitude




                                              Amplitude
 1
                                              multiplier
 0                                                     108
Cruise ship
Sample points along length of the boat
Don’t sample all waves (filter out high frequencies)
Use a spring to allow movement of bow




       point set      Average of points
   average & normal     and normals
                                                       109
Point queries

   Player swimming
   Cameras
   Floating objects                                                      ?


   Collision probes


                                                                         p


                                                                             110
Sampling a vector displacement field is not as trivial as a heightfield.
Point queries                                                                               ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                                   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                             1
         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                                   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                             1
         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                                   p      1




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                             1
         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                                   p      1




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                             1
         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                                   p      1




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                             1
         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   p      1




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               2

                                                                                                          ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2       p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               2

                                                                                                          ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   2   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               2

                                                                                                          ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   2   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               2

                                                                                                          ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   2   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               2

                                                                                                           ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               2   23   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               3   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                          3


         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               3   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                          3


         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               3   p   3




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                          3


         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               3   p   3




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                          3


         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               3   p   3




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                                   ?
                                                                                                              3


         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               4   3   p   3




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               4   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                      4

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               4   p




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                      4

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               4   p
                                                                                                      4




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
Point queries                                                                               ?
                                                                                                      r
                                                                                                      4

         Cameras, player query:
         given point p <u,v> find
         water position r <u, y, v>                                                               4   p
                                                                                                      4




         Ryan Broner’s search method
         Similar to the Secant method,                                                   p    query <u,v>
         but use displacement in a
         R2→R3 map                                                                       q    result <u,v>+<x,y,z>
                                                                                          s   projection <u,v>+<0,y,0>
                                                                                          r   final result position
                                                                                                                         111
We use a search method to the wave field instead of building a mesh and then do some form of ray
casting.
112
Mesh computation                                                             0        1         2
          For each ring, run an SPU job to
                                                                                           8    9    10
          handle patches (i % 3):

                                                                                           11   16   12
             J1: (0,3,6,9,12,15)                                                       3                  4
             J2: (1,4,7,10,13,[16])
             J3: (2,5,8,11,14)                                                             13   14   15


                                                                                       5        6         7
          Minimize ring level computation
          Double buffer mesh output

                                                                                                              113
The job distribution per SPU is in round-robin order.

A job consists on a set of patches (indexed using a modulus 3) on a particular ring.
Wave evaluation
                                   SPU
                                                                                                              Mesh indices and fixes
                                   job 1
                                                                                                              Mesh buffer (double buffered)

                                   SPU
                                   job 2
        PPU                                     …                                                           Main memory
                                                                                                Buffer for meshes allocated per level



                                   SPU
                                   job n



                                                                                                                                              114
Since each job will create a perfectly seemed mesh, there is no need to stitch back the mesh.

The final mesh of the ocean, consists on multiple meshes
PPU

              Camera
                                    kick jobs                barrier                                                          wait jobs   render
             calculation




     SPUs



                                                     Wave particles               water point
                                                                                                            Clipmap   Rain
                                                                                surface queries

                                                                                    water ray
                                                                                     queries              Clipmap     Rain

                                                                                                               …      …


                                                                                                          Clipmap      Rain




                                                                                                                                                   115
We only have to be careful with time. The clipmaps need the wave particles at a particular time.

We only need a single wave-particles job. This job generates a displacement grid.

To synchronize the jobs we put a barrier to wait for the wave-particles job to have finished generating its mesh.
Performance
Ocean
 0.9 ms wave particles
 0.1 ms water query (point and ray)
 8.0 ms tessellation + wave displacement
      5 SPUs
              average 7 rings = 21 jobs
~2.7 ms rendering
        average 50+ visible patches
1 Mb double buffer memory
                                           116
117
Now, go and make some water



      Questions?

    cgonzoo@gmail.com




                                is Hiring!
                    jobs@naughtydog.com
                                             118
119
This is a shot of the first pond we generated for U1. This was out test bed for flow, foam and interaction of Drake’s
clothes

More Related Content

What's hot

스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)포프 김
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문noerror
 
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...Codemotion
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringElectronic Arts / DICE
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Johan Andersson
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunElectronic Arts / DICE
 
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...Colin Barré-Brisebois
 
모바일 게임 최적화
모바일 게임 최적화 모바일 게임 최적화
모바일 게임 최적화 tartist
 
Hierachical z Map Occlusion Culling
Hierachical z Map Occlusion CullingHierachical z Map Occlusion Culling
Hierachical z Map Occlusion CullingYEONG-CHEON YOU
 
Hill Stephen Rendering Tools Splinter Cell Conviction
Hill Stephen Rendering Tools Splinter Cell ConvictionHill Stephen Rendering Tools Splinter Cell Conviction
Hill Stephen Rendering Tools Splinter Cell Convictionozlael ozlael
 
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Unity Technologies
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture FetchMark Kilgard
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .YEONG-CHEON YOU
 
Z Buffer Optimizations
Z Buffer OptimizationsZ Buffer Optimizations
Z Buffer Optimizationspjcozzi
 
Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Jiho Choi
 
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014devCAT Studio, NEXON
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingElectronic Arts / DICE
 

What's hot (20)

스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문
 
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Stochastic Screen-Space Reflections
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space Reflections
 
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
 
모바일 게임 최적화
모바일 게임 최적화 모바일 게임 최적화
모바일 게임 최적화
 
Hierachical z Map Occlusion Culling
Hierachical z Map Occlusion CullingHierachical z Map Occlusion Culling
Hierachical z Map Occlusion Culling
 
Hill Stephen Rendering Tools Splinter Cell Conviction
Hill Stephen Rendering Tools Splinter Cell ConvictionHill Stephen Rendering Tools Splinter Cell Conviction
Hill Stephen Rendering Tools Splinter Cell Conviction
 
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture Fetch
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .
 
Z Buffer Optimizations
Z Buffer OptimizationsZ Buffer Optimizations
Z Buffer Optimizations
 
Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개
 
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014
이승재, 사례로 배우는 디스어셈블리 디버깅, NDC2014
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
 
TrieとLOUDS??
TrieとLOUDS??TrieとLOUDS??
TrieとLOUDS??
 

More from MinGeun Park

[CSStudy] 코딩인터뷰 완전 분석 #7.pdf
[CSStudy] 코딩인터뷰 완전 분석 #7.pdf[CSStudy] 코딩인터뷰 완전 분석 #7.pdf
[CSStudy] 코딩인터뷰 완전 분석 #7.pdfMinGeun Park
 
[Cs study] 코딩인터뷰 완전 분석 #6
[Cs study] 코딩인터뷰 완전 분석 #6[Cs study] 코딩인터뷰 완전 분석 #6
[Cs study] 코딩인터뷰 완전 분석 #6MinGeun Park
 
[Cs study] 코딩인터뷰 완전 분석 #5
[Cs study] 코딩인터뷰 완전 분석 #5[Cs study] 코딩인터뷰 완전 분석 #5
[Cs study] 코딩인터뷰 완전 분석 #5MinGeun Park
 
[Cs study] 코딩인터뷰 완전 분석 #3
[Cs study] 코딩인터뷰 완전 분석 #3[Cs study] 코딩인터뷰 완전 분석 #3
[Cs study] 코딩인터뷰 완전 분석 #3MinGeun Park
 
[Cs study] 코딩인터뷰 완전 분석 #2
[Cs study] 코딩인터뷰 완전 분석 #2[Cs study] 코딩인터뷰 완전 분석 #2
[Cs study] 코딩인터뷰 완전 분석 #2MinGeun Park
 
[Cs study] 코딩인터뷰 완전 분석
[Cs study] 코딩인터뷰 완전 분석[Cs study] 코딩인터뷰 완전 분석
[Cs study] 코딩인터뷰 완전 분석MinGeun Park
 
[데브루키_언리얼스터디_0525] 애니메이션 노티파이
[데브루키_언리얼스터디_0525] 애니메이션 노티파이[데브루키_언리얼스터디_0525] 애니메이션 노티파이
[데브루키_언리얼스터디_0525] 애니메이션 노티파이MinGeun Park
 
[데브루키] 이벤트 드리븐 아키텍쳐
[데브루키] 이벤트 드리븐 아키텍쳐[데브루키] 이벤트 드리븐 아키텍쳐
[데브루키] 이벤트 드리븐 아키텍쳐MinGeun Park
 
[데브루키 언리얼 스터디] PBR
[데브루키 언리얼 스터디] PBR[데브루키 언리얼 스터디] PBR
[데브루키 언리얼 스터디] PBRMinGeun Park
 
[데브루키 언리얼 스터디] 스터디 안내 OT
[데브루키 언리얼 스터디] 스터디 안내 OT[데브루키 언리얼 스터디] 스터디 안내 OT
[데브루키 언리얼 스터디] 스터디 안내 OTMinGeun Park
 
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.MinGeun Park
 
[데브루키] Color space gamma correction
[데브루키] Color space gamma correction[데브루키] Color space gamma correction
[데브루키] Color space gamma correctionMinGeun Park
 
유니티 팁&트릭 Unity Tip & Trick
유니티 팁&트릭 Unity Tip & Trick유니티 팁&트릭 Unity Tip & Trick
유니티 팁&트릭 Unity Tip & TrickMinGeun Park
 
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)MinGeun Park
 
[RAPA/C++] 1. 수업 내용 및 진행 방법
[RAPA/C++] 1. 수업 내용 및 진행 방법[RAPA/C++] 1. 수업 내용 및 진행 방법
[RAPA/C++] 1. 수업 내용 및 진행 방법MinGeun Park
 
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용 [Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용 MinGeun Park
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현MinGeun Park
 
[데브루키160409 박민근] UniRx 시작하기
[데브루키160409 박민근] UniRx 시작하기[데브루키160409 박민근] UniRx 시작하기
[데브루키160409 박민근] UniRx 시작하기MinGeun Park
 
[160404] 유니티 apk 용량 줄이기
[160404] 유니티 apk 용량 줄이기[160404] 유니티 apk 용량 줄이기
[160404] 유니티 apk 용량 줄이기MinGeun Park
 
[160402_데브루키_박민근] UniRx 소개
[160402_데브루키_박민근] UniRx 소개[160402_데브루키_박민근] UniRx 소개
[160402_데브루키_박민근] UniRx 소개MinGeun Park
 

More from MinGeun Park (20)

[CSStudy] 코딩인터뷰 완전 분석 #7.pdf
[CSStudy] 코딩인터뷰 완전 분석 #7.pdf[CSStudy] 코딩인터뷰 완전 분석 #7.pdf
[CSStudy] 코딩인터뷰 완전 분석 #7.pdf
 
[Cs study] 코딩인터뷰 완전 분석 #6
[Cs study] 코딩인터뷰 완전 분석 #6[Cs study] 코딩인터뷰 완전 분석 #6
[Cs study] 코딩인터뷰 완전 분석 #6
 
[Cs study] 코딩인터뷰 완전 분석 #5
[Cs study] 코딩인터뷰 완전 분석 #5[Cs study] 코딩인터뷰 완전 분석 #5
[Cs study] 코딩인터뷰 완전 분석 #5
 
[Cs study] 코딩인터뷰 완전 분석 #3
[Cs study] 코딩인터뷰 완전 분석 #3[Cs study] 코딩인터뷰 완전 분석 #3
[Cs study] 코딩인터뷰 완전 분석 #3
 
[Cs study] 코딩인터뷰 완전 분석 #2
[Cs study] 코딩인터뷰 완전 분석 #2[Cs study] 코딩인터뷰 완전 분석 #2
[Cs study] 코딩인터뷰 완전 분석 #2
 
[Cs study] 코딩인터뷰 완전 분석
[Cs study] 코딩인터뷰 완전 분석[Cs study] 코딩인터뷰 완전 분석
[Cs study] 코딩인터뷰 완전 분석
 
[데브루키_언리얼스터디_0525] 애니메이션 노티파이
[데브루키_언리얼스터디_0525] 애니메이션 노티파이[데브루키_언리얼스터디_0525] 애니메이션 노티파이
[데브루키_언리얼스터디_0525] 애니메이션 노티파이
 
[데브루키] 이벤트 드리븐 아키텍쳐
[데브루키] 이벤트 드리븐 아키텍쳐[데브루키] 이벤트 드리븐 아키텍쳐
[데브루키] 이벤트 드리븐 아키텍쳐
 
[데브루키 언리얼 스터디] PBR
[데브루키 언리얼 스터디] PBR[데브루키 언리얼 스터디] PBR
[데브루키 언리얼 스터디] PBR
 
[데브루키 언리얼 스터디] 스터디 안내 OT
[데브루키 언리얼 스터디] 스터디 안내 OT[데브루키 언리얼 스터디] 스터디 안내 OT
[데브루키 언리얼 스터디] 스터디 안내 OT
 
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.
[데브루키/페차쿠차] 유니티 프로파일링에 대해서 알아보자.
 
[데브루키] Color space gamma correction
[데브루키] Color space gamma correction[데브루키] Color space gamma correction
[데브루키] Color space gamma correction
 
유니티 팁&트릭 Unity Tip & Trick
유니티 팁&트릭 Unity Tip & Trick유니티 팁&트릭 Unity Tip & Trick
유니티 팁&트릭 Unity Tip & Trick
 
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)
Live2D with Unity - 그녀들을 움직이게 하는 기술 (알콜코더 박민근)
 
[RAPA/C++] 1. 수업 내용 및 진행 방법
[RAPA/C++] 1. 수업 내용 및 진행 방법[RAPA/C++] 1. 수업 내용 및 진행 방법
[RAPA/C++] 1. 수업 내용 및 진행 방법
 
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용 [Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용
[Unite17] 유니티에서차세대프로그래밍을 UniRx 소개 및 활용
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
 
[데브루키160409 박민근] UniRx 시작하기
[데브루키160409 박민근] UniRx 시작하기[데브루키160409 박민근] UniRx 시작하기
[데브루키160409 박민근] UniRx 시작하기
 
[160404] 유니티 apk 용량 줄이기
[160404] 유니티 apk 용량 줄이기[160404] 유니티 apk 용량 줄이기
[160404] 유니티 apk 용량 줄이기
 
[160402_데브루키_박민근] UniRx 소개
[160402_데브루키_박민근] UniRx 소개[160402_데브루키_박민근] UniRx 소개
[160402_데브루키_박민근] UniRx 소개
 

Recently uploaded

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Water technology-of-uncharted-gdc-2012

  • 1. Water Technology of Uncharted Carlos Gonzalez Ochoa Graphics Programmer – Naughty Dog Doug Holder Fx Artist – Naughty Dog 1
  • 2. Contributors Eben Cook Matt Morgan Michal Iwanicki Jerome Durand Ryan Broner Peter Field Vincent Marxen Junki Saita Jacob Minkoff Marshall Robin 2
  • 3. Action and Adventure Not a “water” game 3 Uncharted is an action adventure game. Game play is combat and exploration. Itʼs not about water gameplay There are tons of environments: Jungle, temples, cities, caverns, ruins, etc In each we generally add some water element. puddles, streams, rivers, pools, lakes, and lastly the ocean Water has been a major design element and we have improved it through the series
  • 4. 4
  • 6. 5
  • 7. Water in many forms 6
  • 8. From small to large bodies of water 7
  • 9. Interaction with the water. Clothes get wet 8
  • 10. Fast moving Slow and hard to navigate 9
  • 11. 10 The game has a very particular art style and the water had to be able to match it Water has to move Has to look better
  • 12. Previous work... lots of it Crysis, Kameo, Resistance, Bioshock, Halo and many, many others Perfect storm, Cast Away, Poseidon, Surf’s Up,... Tech demos Scientific visualization SIGGRAPH, IEEE, I3D papers 11 We saw lots of reference work in games, films and other scientific papers. The work in Scientific visualization was key for the work in flow
  • 13. river level 12 Complex refraction/reflection model Flow: Scroll uvs (per pixel/vertex) of normal map by a vector field Refraction: depth based jitter and coloring Foam movement using a threshold operation on a gradient field Churn: further depth based coloring.Use foam texture to modulate water depth, blend again. Pseudo-volumetric effect All parameters are artist controlled!
  • 14. river level 12 Complex refraction/reflection model Flow: Scroll uvs (per pixel/vertex) of normal map by a vector field Refraction: depth based jitter and coloring Foam movement using a threshold operation on a gradient field Churn: further depth based coloring.Use foam texture to modulate water depth, blend again. Pseudo-volumetric effect All parameters are artist controlled!
  • 15. Shader Geometric Bumped Normal Normal Foam modulated Reflection w/ by wave height jitter Flow Wave height Depth color Churn color and attenuation by depth color mixed distance to bg Depth distance by wave height § = Refraction w/ jitter 13 The water shading uses already used ideas: Use a bump map to jitter the normal of the surface. Use a fresnel term using the jittered normal to blend between a refraction and reflection contribution. In addition, we use other ideas to modulate the coloring of each contribution We add foam that get lit on top of the reflection and refraction. We can also choose to mix the foam w/ the refraction, this can create muck We use churn to simulate a volumetric effect Refraction. We color the refraction depending on the distance between the surface of the water and the background The depth coloring can be a linear or exponential function The depth coloring can be affected by churn. We take one channel of the foam texture to blend between the depth coloring and the "churn" coloring. As the foam moves (which it also gets modulated by the waves), the coloring changes with the waves and the foam scrolling The reflection can also be added on top the refraction instead of just blended. All fresnel coefficients, start-end are artist controlled
  • 16. Water shader by layers 14
  • 17. Reflection - no bump 15
  • 18. Reflection - with bump 16
  • 19. Refraction 17 The reflection and refraction are blended using a fresnel coefficient
  • 20. Reflection - depth based color - no bump 18 Depth based function is used to blend a base color and the refraction color. Here no jittering is applied.
  • 21. Reflection - depth based color - with bump 19 The jitter factor is also modulated by the depth
  • 23. Foam - modulated by wave’s amplitude 21 Foam and churn which add a texture above and below The foam is also moving by the flow
  • 25. Final 23
  • 26. Bumped Geometric Normal Normal Foam modulated Reflection w/ by wave height jitter Flow Wave height Depth color Churn color and attenuation by depth color mixed distance to bg Depth distance by wave height § = Refraction w/ jitter 24 We will look into how we moved the normal maps, this is the key of the water shader
  • 27. Flow shader Vector field used to advect mesh properties UV scrolling Displacement Shader based on scientific visualization work: N. Max, B. Becker, “Flow Visualization using Moving Textures”, 96 F. Neyret. “Advected Textures”, 03 25 The flow shader was originally created by C. Gonzalez-Ochoa at ND for Uncharted 1.
  • 28. Blend value 1 0 0 1 2 3 4 5 time UV distance movement 1 0 time Texture 1 Texture 2 26 Here is an example of flow using a vertex shader to compute the blend values for triangles (instead of pixels). Remember, to scroll in the right direction the uvs should move OPPOSITE to the intended direction
  • 29. Blend value 1 0 0 1 2 3 4 5 time UV distance movement 1 0 time Texture 1 Texture 2 26 Here is an example of flow using a vertex shader to compute the blend values for triangles (instead of pixels). Remember, to scroll in the right direction the uvs should move OPPOSITE to the intended direction
  • 30. 27 We can use several other effects besides using the basic flow. Here we use a second fetch (feedback) to give extra fluidity
  • 31. Blend between two “flow” textures, one offset in phase by τ/2 Ways to improve it: Offset the placement after each cycle Offset uv starting position to minimize distortion Offset in space the phase Use texture feedback (ping back) to get extra motion 28 There are many ways to improve flow. Since the texture moves in cycles of Tau seconds, the improvements come from where the texture starts moving from (1 and 2 above) The offset in space, is when using flow on a vertex shader and we want each pixel to blend at a different rate. Be careful because one does not want to big discontinuities across the whole texture.
  • 32. Flow shader half3 result, tx1, tx2; half s = .1; // small value float timeInt = (g_time) / (interval * 2); float2 fTime = frac(float2(timeInt, timeInt + .5)); float2 flowUV1 = uv - (flowDir/2) + fTime.x * flowDir.xy; float2 flowUV2 = uv - (flowDir/2) + fTime.y * flowDir.xy; tx1 = FetchTexture(flowUV1); tx2 = FetchTexture(flowUV2); tx1 = FetchTexture(flowUV1 + s*tx1.xy); //[optional] Fetch 2nd tx2 = FetchTexture(flowUV2 + s*tx2.xy); //time for extra motion result = lerp(tx1,tx2, abs((2*frac(timeInt))-1); 29 This is the most basic flow shader. There are many ways to improve it. By adding an offset to where the texture starts: float2 offset1 = float2(floor(timeInt) .1); float2 offset2 = float2 (floor(timeInt + .5) * .1 + .5); flowUV2 = uv + offset1 - (flowDir/2) + fTime.x * flowDir,xy; flowUV2 = uv + offset2 - (flowDir/2) + fTime.y * flowDir.xy; ----------- Offset the uv starting position to minimize distortion. One wants the uv coordinates to have less distortion (that mean their displacement is 0) when the blend is at its maximum. float timeInt = (g_time) / (interval * 2); float2 fTime = frac(float2(timeInt, timeInt + .5)); float2 flowUV1 = uv - (flowDir/2) + fTime.x * flowDir.xy + .5 * flowDir.xy; float2 flowUV2 = uv - (flowDir/2) + fTime.y * flowDir.xy + .5 * flowDir.xy; ----------- You can spread around where the phase changes, this is easy to do if the flow is done on a pixel shader (not on triangles) float timeInt = (g_time) / (interval * 2); float offsetPhase = phaseScale * FetchPhaseTexture(u,v); // texture goes from 0..1 float2 fTime = frac(offsetPhase + float2(timeInt, timeInt + .5)); ------------ You can think on many other ways to use flow. Scientific visualization results can be handy to do cool shader effects.
  • 33. Easy to author ND Maya tool Start Dir, velocity Foam, phase End Flow gives players a direction to where to go. sunken ruins level 30 This is the Maya tool used in all the Uncharted games. The tool uses splines to define the direction and color maps to control the magnitude of the velocities. Also,we can generate foam maps, and phase (for displacement). Later we will talk more about the basic flow displacement
  • 35. Flow based displacement Each vertex moves on Global axis a circular pattern at a different phase φ Flow x1’=x1+cos(αt +φ1) x2’=x2+cos(αt +φ2) direction y1’=y1 +sin(αt +φ1) y2’=y2 +sin(αt +φ2) 32 Flow can also be used for displacement. In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's. In addition to a vector field, we encoded a a phase field over the mesh. Every vertex moves in a anisotropic scaled circle. So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves. Of course these waves will not be as dramatic nor complex as the one in U3
  • 36. Flow based displacement Each vertex moves on Local axis a circular pattern at a different phase φ Flow x1’=x1+cos(αt +φ1) x2’=x2+cos(αt +φ2) direction y1’=y1 +sin(αt +φ1) y2’=y2 +sin(αt +φ2) 32 Flow can also be used for displacement. In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's. In addition to a vector field, we encoded a a phase field over the mesh. Every vertex moves in a anisotropic scaled circle. So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves. Of course these waves will not be as dramatic nor complex as the one in U3
  • 37. Flow based displacement Rotated Each vertex moves on Local axis a circular pattern at a different phase φ Circular x1’=x1+cos(αt +φ1) x2’=x2+cos(αt +φ2) Motion y1’=y1 +sin(αt +φ1) y2’=y2 +sin(αt +φ2) 32 Flow can also be used for displacement. In the case of U1, I encoded flow into the vertices. And we could do displacement in the SPU's. In addition to a vector field, we encoded a a phase field over the mesh. Every vertex moves in a anisotropic scaled circle. So if we set the phase field nicely spaced not only in the direction of flow, but also perpendicular to it, we can get some interesting waves. Of course these waves will not be as dramatic nor complex as the one in U3
  • 38. 33
  • 39. Flow Useful for lots of other effects Clouds, sand, snow, psychedelic effects... See Keith Guerrette’s GDC 2012 talk “The Tricks Up Our Sleves....” 34 We have used flow for sand moving on top of the dunes, the psychedelic effects in U3, cloud movement. FX artists even use it for fire and trails
  • 40. Water good enough for What is next? 35
  • 41. early 2009 idea “What if we have a ship in a storm... and we turn it 180 degrees and sink it? Wouldn’t that be awesome?” Jacob Minkof Lead Designer 36 Simple displacement mesh with a shader will not be enough for this idea
  • 42. The cruise ship 37 Nor for this rough ocean
  • 43. Ship graveyard 38 This one was crazy. There is so much detail that we needed to capture on the ocean. All the action on the ship graveyard would be close to the water. We would smoothly transition from a calm ocean to a stormier and stormier ocean
  • 44. * 39
  • 45. * * Thanks, we truly appreciate the challenge 39
  • 46. Ocean Render challenges Open ocean, big waves (100 meters+) Waves drive boats and barges Animation loops were considered but not used Swimming 40 Initially designers thought about using a can animation for the cruise boat (silly designers, we can do better) One problem was that once we are on the boat is hard to read the scale of the waves. We are high on the boat and the camera attached to the player smooths out the waves.To compensate we have to exaggerated the amplitude of the waves to read as a storm.
  • 48. Procedural Simulation = too expensive Perlin like noise = not that good visually 42 Procedural geometry and animation are good if we can find a good model. Simulation would be too expensive to compute (even in SPUs) and hard to control by designers Perlin noise results are not that great visually, tend to look very artificial The FFT technique is great, but the parameters are hard to control and tweak by artists. Also is hard to get right.
  • 49. Parametric Evaluate at any point in R domain 2 F(<u,v>, t, parameters) → <x,y,z> Vector displacement, not a heightfield 43 Since we would have an ocean any point should be able to be computed. The ocean was not restricted to a fixed grid and had to be compatible with other parametric equations. This way we could do a compositing wave system It’s important to note we are generating a vector displacement. One would need a super fine mesh to have by sharp wave peaks with a heightfield. Its easier with a vector displacement, one does not need a fine mesh for it.
  • 50. Deterministic Evaluate at any point in R space and time 2 F(<u,v>, t, parameters) → <x,y,z> Needed for cutscenes and multiplayer 44 For FMA scenes we needed to be able to rewind the ocean, so we cannot "advance" the state. So our system is stateless Our system is completely stateless
  • 51. Waves Gerstner waves - Simple but not enough high frequency detail - Can only use few [big swells] before it’s too expensive  45 So all these requirements force us to certain techniques to use to evaluate waves. So the easiest ones are the Gerstner waves. These are the workhorse of waves, any one uses them. However, they get expensive to evaluate to get a good number (20+) of them. The FFT technique is the most realistic one. But is hard to get the right parameters, the artists have to spend lot of time searching for the “correct” values We also found some tiling artifacts when one has small grid resolutions (64 side)
  • 52. Waves Gerstner waves - Simple but not enough high frequency detail - Can only use few [big swells] before it’s too expensive FFT Waves - Tessendorf “Simulating Ocean Water”, 1999 + Realistic, more detail - Spectrum of frequencies - hard for artists to control ½ Tiling visual artifacts at low resolution grids 46 So all these requirements force us to certain techniques to use to evaluate waves. So the easiest is Gerstner waves. The work horse of waves, any one uses them. However, they get expensive to evaluate to get a good number (20+) of them. FFT again the most realistic ones. But as we said, hard to get right parameters. We found some tiling artifacts
  • 53. Wave Particles Yuksel, House, Keyser, SIGGRAPH 2007  Waves from point sources http://www.cemyuksel.com/research/waveparticles/  Ours -> Don’t use point sources Instead, in a toroidal domain place a random distribution of particles to approximate the chaotic motion of open water  Random positions and velocities within a some speed bounds → Yields a tileable vector displacement field 47 This is the main idea to get our open ocean waves. It's easy to implement and to optimize. See the Wave Particle paper for more details
  • 55. 49
  • 56. Wave Particles + Intuitive for artists to control + No tiling artifacts + Fast! Good for SPU vectorization [Optimization by Michal Iwanicki] + Deterministic in time. No need to move particles New position is derived from initial position, velocity and time 50
  • 57. Composition of displacement grids at different scales ≈ octaves 51
  • 58. Composition of displacement grids at different scales ≈ octaves Can also be translated over time Fade out by distance 52
  • 59. Wave field Gerstner waves (x4) + Wave particles (1 grid used x4) = 53 At this point , the displacement field, evaluates 4 gerstner waves plus 4 wave-particle grids per vertex
  • 60. Flow grid: Encode flow, foam, amplitude multipliers in a grid Base grid with flow curves 54
  • 61. Flow grid: Encode flow, foam, amplitude multipliers in a grid Flow vectors (direction and magnitude) 55
  • 62. Flow grid: Encode flow, foam, amplitude multipliers in a grid Wave amplitude 56
  • 63. Wave’s amplitude modulates foam 57 The foam modulation is outputed as a vertex color when we generate the final mesh
  • 64. 58
  • 65. 59
  • 66. Hey, we need this! 59
  • 67. Addition of simpler waves Gerstner waves (x4) + Wave particles (x4) Big wave + = 60 In addition to the previous waves, we add a custom artist wave. This type of wave will be used for the crash wave scene and to also keep the player from swimming away from the game play area
  • 68. v Π u <x,y> → <u,v> Big wave - Orient a square region Π over domain 61 The wave is quite easier to construct. We need to reparametrize a rectangular domain over the plane. The rectangle can be though as the base of a NURBS patch. We can use the (u,v)->(0..1, -1..1) domain or the normalized one(0..1, 0..1), depending where is the center. The u is used to parameterize a Bspline curve. The v we extrude the curve and tapper it. The subdomain can be scaled and translate over time to animate the wave
  • 69. v u <x,y> → <u,v> Big wave - Create a Bspline curve oriented in the u direction 62
  • 70. v u Big wave - Extrude the Bspline along v direction 63
  • 71. v u y = ½ (cos(2πv-π)+1) · bspline(u) Big wave - Taper on the sides 64
  • 72. v u y = cos(π(2v - ½)) · bspline(u,t) Big wave - Translate, scale region or curve over time 65
  • 73. 66
  • 74. 67
  • 75. 68 This is a partial formula of the whole wave system. The bspline is a uniform, non-rational bspline. We could have used a Bezier but it requires more code. The grid(u,v) function returns a scalar value given the u,v, coordinates. In this case, we have a multiplier for the wave scale
  • 76. LOD Many ways to create the water mesh Screen projected grid → aliasing artifacts Quasi projected grid → issues handling large displacements 69
  • 77. Irregular Geometry Clipmaps Based on: Losasso, Hoppe, “Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids” SIGGRAPH 04 Modified for water rendering 70 The irregular geometry clipmaps have different way to partition the rings and the blocks.
  • 78. Irregular Geometry Clipmaps Different splits to fix T-joints across ring levels Dynamic blending between levels Patches lead to better SPU utilization 71
  • 79. 72 As the camera moves, the rings will move quads from one side to the other. Any point in a ring will always be sampled from the same place. This way, we don’t have any jittering and aliasing problems
  • 80. Ring 1 Ring 2 Ring 3 Ring 3 ... 73
  • 81. 74
  • 82. 75
  • 83. 76
  • 84. 77
  • 85. 78
  • 86. 79
  • 87. 80
  • 88. 81
  • 91. 84 This is the general patch divisions. On a ring there are 16 patches. The lowest level ring would have an additional patch in the center
  • 92. Splits will always avoid T-joints with next ring Fixer patches give “space” between this and previous ring 85
  • 93. Border triangulation fixing Ring 2 T-corner fixes Ring 1 Skipped indices 86
  • 94. Border blending Ring 2 Vertex blending area Ring 1 87
  • 95. T-joint fixes Vertex blending 88
  • 96. Culling Cull out patches that are outside frustum Frustum-bbox test 89 2 pass culling. First we generate bounding boxes with some extra slack from 4 corners and perform a quick intersection test. After we generate the displaced surface, we have a tighter bbox, and can perform another intersection test.
  • 97. 90
  • 98. 91 Video of the ocean clipmap rendering. In wireframe is easier to see how the clipmap levels are rendered
  • 99. Into the lion’s den 92 Although we are inside the ballroom, we can see out the ocean. Furthermore the waves are moving the boat, so the chandeliers are being driven indirectly by the waves. To heighten the drama we are closer to the water level
  • 100. 93
  • 101. Culling Use portals to show patches seen from windows For waves intersecting ballroom: Use box aligned with ballroom to clamp down vertices 94 Another problem is that the ballroom is too low to the water line and we had clipping issues with big waves. The solution is simple, test the points to a box, oriented to the ballroom, and push the vertices down
  • 102. So something happens to the ship... 95 There is a sequence in U3, the Drakes goes from the top of the cruise-ship to the cargo hold. At the cargo hold, Drake does what he does best: destroy everything
  • 103. 96 The ocean system is used in all the water in this sequence, we just change the shader and parameters.
  • 104. 96 The ocean system is used in all the water in this sequence, we just change the shader and parameters.
  • 105. 97
  • 106. 97
  • 107. and we come back to the ballroom 98
  • 108. Ballroom ●Intersection with water 99
  • 109. 100 We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship. We would switch parameters and shader of the water. At some points between 2 frames. The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game. We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage. We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane. At some point we thought of using a curved glass, but we ran out of time.
  • 110. Above and below water line Ocean waves lapping on the windows Flood 100 We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship. We would switch parameters and shader of the water. At some points between 2 frames. The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game. We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage. We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane. At some point we thought of using a curved glass, but we ran out of time.
  • 111. Above and below water line Ocean waves lapping on the windows Flood See Eben Cooks’ GDC 2012 talk “Creating the Flood Effects in U3” 100 We could only render one ocean at a time, so we constantly had to change between all the different water elements in the cruiseship. We would switch parameters and shader of the water. At some points between 2 frames. The skylight section (the ballroom tilted 90 degrees) is technically the most difficult section of the whole game. We needed to render water outside, and could be seen from above and below. Also there would be a flooding stage. We had to limit the movement of the boat to one plane, so we could clip the water using a simple plane. At some point we thought of using a curved glass, but we ran out of time.
  • 112. Skylight scene skylight [top down view] 101
  • 113. Skylight scene Cull out patches that are outside frustum Frustum-bbox test skylight [top down view] 101
  • 114. Skylight scene Cull out patches that are outside frustum Frustum-bbox test Cull out patches outside skylight Plane-bbox test skylight [top down view] 101
  • 115. These ones still remain Skylight scene Cull out patches that are outside frustum Frustum-bbox test Cull out patches outside skylight Plane-bbox test skylight [top down view] 101
  • 116. Skylight scene For rendering use shader discard operation to do plane clipping For evaluation clamp down points inside ballroom bbox skylight 102 The culling using the shader was simple a plane culling
  • 117. Skylight scene (90 degree cruise-ship) Fake underwater fog with a polygon “curtain” driven by the water movement (Eben’s Cook hack) 103 Faking the underwater fog was more complicated. Eben Cook did an awesome job figuring out a way to realize the effect without multipasses. He used a polygon skirt that is driven by the waves and it covers the back of the glass. The skirt shader simulates the fog effect of water.
  • 118. 104
  • 119. 104
  • 120. 105
  • 121. 105
  • 122. 106
  • 123. Floating objects Sample points and best fit a plane for orientation On intersection areas, multiply down amplitude 107 Depending on object, we can sample some points and best fit a plane to orient the object
  • 124. Attaching objects Sample points and best fit a plane for orientation On intersection areas, multiply down amplitude Amplitude 1 multiplier 0 108
  • 125. Cruise ship Sample points along length of the boat Don’t sample all waves (filter out high frequencies) Use a spring to allow movement of bow point set Average of points average & normal and normals 109
  • 126. Point queries Player swimming Cameras Floating objects ? Collision probes p 110 Sampling a vector displacement field is not as trivial as a heightfield.
  • 127. Point queries ? Cameras, player query: given point p <u,v> find water position r <u, y, v> p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 128. Point queries ? 1 Cameras, player query: given point p <u,v> find water position r <u, y, v> p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 129. Point queries ? 1 Cameras, player query: given point p <u,v> find water position r <u, y, v> p 1 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 130. Point queries ? 1 Cameras, player query: given point p <u,v> find water position r <u, y, v> p 1 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 131. Point queries ? 1 Cameras, player query: given point p <u,v> find water position r <u, y, v> p 1 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 132. Point queries ? 1 Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 p 1 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 133. Point queries ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 134. Point queries 2 ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 135. Point queries 2 ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 2 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 136. Point queries 2 ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 2 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 137. Point queries 2 ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 2 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 138. Point queries 2 ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 2 23 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 139. Point queries ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 3 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 140. Point queries ? 3 Cameras, player query: given point p <u,v> find water position r <u, y, v> 3 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 141. Point queries ? 3 Cameras, player query: given point p <u,v> find water position r <u, y, v> 3 p 3 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 142. Point queries ? 3 Cameras, player query: given point p <u,v> find water position r <u, y, v> 3 p 3 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 143. Point queries ? 3 Cameras, player query: given point p <u,v> find water position r <u, y, v> 3 p 3 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 144. Point queries ? 3 Cameras, player query: given point p <u,v> find water position r <u, y, v> 4 3 p 3 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 145. Point queries ? Cameras, player query: given point p <u,v> find water position r <u, y, v> 4 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 146. Point queries ? 4 Cameras, player query: given point p <u,v> find water position r <u, y, v> 4 p Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 147. Point queries ? 4 Cameras, player query: given point p <u,v> find water position r <u, y, v> 4 p 4 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 148. Point queries ? r 4 Cameras, player query: given point p <u,v> find water position r <u, y, v> 4 p 4 Ryan Broner’s search method Similar to the Secant method, p query <u,v> but use displacement in a R2→R3 map q result <u,v>+<x,y,z> s projection <u,v>+<0,y,0> r final result position 111 We use a search method to the wave field instead of building a mesh and then do some form of ray casting.
  • 149. 112
  • 150. Mesh computation 0 1 2 For each ring, run an SPU job to 8 9 10 handle patches (i % 3): 11 16 12 J1: (0,3,6,9,12,15) 3 4 J2: (1,4,7,10,13,[16]) J3: (2,5,8,11,14) 13 14 15 5 6 7 Minimize ring level computation Double buffer mesh output 113 The job distribution per SPU is in round-robin order. A job consists on a set of patches (indexed using a modulus 3) on a particular ring.
  • 151. Wave evaluation SPU Mesh indices and fixes job 1 Mesh buffer (double buffered) SPU job 2 PPU … Main memory Buffer for meshes allocated per level SPU job n 114 Since each job will create a perfectly seemed mesh, there is no need to stitch back the mesh. The final mesh of the ocean, consists on multiple meshes
  • 152. PPU Camera kick jobs barrier wait jobs render calculation SPUs Wave particles water point Clipmap Rain surface queries water ray queries Clipmap Rain … … Clipmap Rain 115 We only have to be careful with time. The clipmaps need the wave particles at a particular time. We only need a single wave-particles job. This job generates a displacement grid. To synchronize the jobs we put a barrier to wait for the wave-particles job to have finished generating its mesh.
  • 153. Performance Ocean 0.9 ms wave particles 0.1 ms water query (point and ray) 8.0 ms tessellation + wave displacement 5 SPUs average 7 rings = 21 jobs ~2.7 ms rendering average 50+ visible patches 1 Mb double buffer memory 116
  • 154. 117
  • 155. Now, go and make some water Questions? cgonzoo@gmail.com is Hiring! jobs@naughtydog.com 118
  • 156. 119 This is a shot of the first pond we generated for U1. This was out test bed for flow, foam and interaction of Drake’s clothes