Published on February 11, 2008
Notes: Notes These slides were exported from Apple Keynote. Much of the beauty of the original layout & transitions has been lost in the conversion. There are three mpeg movies accompanying the slides, which have not been embedded in the interests of file size. You may be able to download them from wherever you obtained the slides. The Primal™ SeasWater on PlayStation®2: The Primal™ Seas Water on PlayStation®2 Andrew Ostler Senior Programmer Sony Computer Entertainment Europe Cambridge Studio Overview: Overview Context – Primal™ and the PS2 Water simulation Water rendering Context - about Primal™: Context - about Primal™ PlayStation®2 game Launched earlier this year in the US, Europe and Russia; Japanese version in beta now Context - about Primal™: Context - about Primal™ Rich landscapes an important aspect of the game A quarter of the game is set in a ‘watery’ realm Context – about PS2: Context – about PS2 4 year old game console No programmable shaders Single texture unit 4MB VRAM Effects can only occupy a part of the frame time (33ms @ 30Hz) Water simulation: Water simulation Two types in Primal™ Dynamic physical simulation Closed-form solution Physical simulation: Physical simulation Standard technique using a 2D grid of height values Refer to e.g.: Mathematics for 3D Game Programming & Computer Graphics, Eric Lengyel Game Programming Gems, Mark DeLoura (Editor) Physical simulation video: Physical simulation video Closed-form solution: Closed-form solution In our case, simply sum sine waves Used because: Simulation too expensive over the huge surfaces required Easier to apply level-of-detail (LOD) Quadtree LOD: Quadtree LOD Each quad at the final level is sampled to produce a grid of heights, which looks the same to the renderer as the physical simulation • Start with full surface Water rendering: Water rendering Common renderer Reflection and refraction via portals Can be layered for more complex effects VU1 renderer: Runs on coprocessor (Vector Unit 1) in parallel with main CPU Heightfields generated on main CPU Transferred to VU1 by DMA VU1 generates triangle strips VU1 renderer VU1 renderer cont.: VU1 renderer cont. Input data is heights only VU1 calculates: Vertex positions Normals (for lighting/environment map) Texture coordinates (and perturbations) Colours/transparency Triangle strips passed to common landscape renderer Slide15: Transparent dynamic surface Fixed (though animating) texture Screen space processing to enhance feel of ‘volume’ Water level can be raised/lowered ‘Shipwater’ Slide16: ‘Shipwater’ ‘Shipwater’ video: ‘Shipwater’ video Refraction: Refraction Important visual cue to a water surface Governed by Snell’s Law Air Water Refraction: Refraction Simulate with UV (texture coordinate) perturbations Assume water has constant depth Calculate difference between direct and refracted ray entering water and hitting the bottom Refraction: Refraction Portals: Portals Portals - construction: Portals - construction Portals - projection: Portals - projection • Underwater geometry is rendered as a texture applied to water surface • This texture is rendered to a p-buffer • Projection used is aligned in the space defined by the water surface Portals - projection: Portals - projection Portals – texture mapping: Portals – texture mapping Sea surface: Sea surface Three layers Refracted view of ‘underwater’ Basic surface Reflection Sea surface layers: Sea surface layers Layer 1: Refractive portal: Layer 1: Refractive portal Layer 2: Base texture: Layer 2: Base texture Layer 3: Environment map: Layer 3: Environment map Parabolic Environment Mapping: Parabolic Environment Mapping Reference: Heidrich 1999 Similar to well-known environment maps based on shiny spheres Shiny paraboloid captures one hemisphere. Pre-rendering a parabolic environment map: Pre-rendering a parabolic environment map Can do it in Maya Make a perfectly shiny paraboloid Place a camera above it Raytrace it Pre-rendered parabolic environment map: Pre-rendered parabolic environment map Looks great But – assumes that the environment is ‘at infinity’ or at least a long way from the shiny object We need to render our environment map each frame, based on the camera position How do we do that then?: How do we do that then? Need to capture the whole upper hemisphere, as seen from the camera position The game is restricted to rendering normal perspective projections With four cameras: With four cameras Render four views of the landscape Each has a 90° vertical field-of-view Arranged at 90° intervals around the vertical axis Assembling the environment map: Assembling the environment map Pre-rendered sky: Pre-rendered sky The sky does not depend on camera position, so can be pre-rendered Could pre-render as a final environment map, but choose to pre-render four views so it blends in better with landscape Draw process: Draw process Seriously constrained by VRAM 640x448 32bit double buffers plus z buffer leaves ~1MB for textures and offscreen buffers (p-buffers) Have to work mainly in the back buffer Complete scene: Complete scene Draw process: Draw process Render underwater view, to back buffer as normal, with skewed projection Copy back buffer to offscreen for later use as texture (reduced to 256x256) Clear screen and z Move texture back into back buffer to free up VRAM Underwater view: Underwater view Draw process: Draw process Copy fixed sky texture to screen Render four quadrant views over the top of the sky texture Copy underwater view back offscreen Assemble envmap into offscreen area Clear screen areas used Partially assembled envmap: Partially assembled envmap Draw process: Draw process Render heightfield textured with underwater view Render sea surface itself, blending around underwater portal Then render everything above water Draw process: Draw process Video: Video The sea surfaces in the ‘Aquis’ realm End: End firstname.lastname@example.org http://www.technology.scee.net/sceesite/presentations.html www.primalgame.com
Whether you are looking to become a licensed PlayStation® developer, join us at SCEE, connect to our academic programmes, or get the latest news, you’ll ...
New gameplay footage of the PS2 build is up. I haven't have the time to look and compare, so I couldn't tell if the enviroments have been cut down. It...