2
\$\begingroup\$

What is the game design lingo for the computer's ability to render shiny water? I am new to game design and I'm trying to write a formal paper to a colleague.

\$\endgroup\$
  • \$\begingroup\$ Realistic water rendering? I don't think there's a separate term for this \$\endgroup\$ – Bálint Oct 23 '17 at 12:57
  • \$\begingroup\$ Its a very general term and has to do with how on the last gen consoles (360,3) could finally render running water and shiny slime. \$\endgroup\$ – Hiltnflite Oct 23 '17 at 13:01
  • \$\begingroup\$ I don't recall ever seeing a term for this specific ability, because this was just one of a whole package of abilities that went mainstream roundabout 2002 or so. \$\endgroup\$ – Maximus Minimus Oct 23 '17 at 19:30
3
\$\begingroup\$

It sounds like you're looking for "per-pixel lighting"

Previous/lower-spec shading modes often used "vertex lighting" where the shading function was evaluated only at the vertices of each triangle and interpolated in between. This made it impossible to get crisp specular highlights (the sharp bright spots you see on shiny objects that move with your view angle) or other forms of specular reflection (like reflection maps)

This is often paired up with techniques like Phong/Blinn-Phong shading (particular shading formulas that were popular for calculating specular highlights, before physically-based/inspired models became more prevalent) and normal mapping (a technique using textures to add fine surface detail smaller than the rendered triangles, which gives specular highlights and reflections more edges to catch and glint off of)

This is also related to consoles supporting a programmable fragment stage in their programmable pipeline, allowing developers to write custom pixel shaders / fragment shaders to implement these lighting and reflection models. Early rendering hardware (ones with a "fixed function pipeline") lacked a programmable fragment stage, limiting games to combinations of pre-configured shading options.

\$\endgroup\$
0
\$\begingroup\$

Depends on the tech you use.

For a mostly flat water surface you can use bump mapping (adjusting the normal vector based on location on the mesh and some algo to create waves) to add reflective highlights to give appearance of waves. This means sampling a non-color texture in the fragment shader.

For bigger movement you'll need to actually change the surface geometry. This can be done with tesselation shading or it's predecessor geometry shading. Or you can just send a lot of triangles to the gpu. Doing the per-vertex displacement+normal manipulation requires sampling a texture in the vertex stages.

\$\endgroup\$
0
\$\begingroup\$

That would depend on how good you want it to look. If you just want to look wet and shiny and reflect only the light, look for Phong model lighting. If you want to the water to reflect everything else, look for reflection mapping.

Phong model lighting performs lighting calculations per pixel, which makes for reasonably accurate lighting effects

Reflection mapping requires rendering to a temporary texture then sampling later when rendering the water. This can either by static, i.e. a skybox, or dynamic, which is a version of a skybox which is redrawn each frame.

Combining both of these effects along with some messing around with surface normals, and some refraction computation, can create a reasonably convincing water effect. This video, which I made a few years ago demonstrates this reasonably well.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.