O'Reilly logo

3D Graphics with XNA Game Studio 4.0 by Sean James

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a reflective water effect

The final example in this chapter will demonstrate how to create a water effect that reflects the environment above it. It will also make use of normal mapping to create a ripple effect, and we'll finish it off with some specular highlights.

Creating a reflective water effect

Let's start with the basics. We'll need a class to represent our effect with a model and effect inside.

class Water { CModel waterMesh; Effect waterEffect; ContentManager content; GraphicsDevice graphics; public WaterEffect(ContentManager content, GraphicsDevice graphics, Vector3 position, Vector2 size) { this.content = content; this.graphics = graphics; waterMesh = new CModel(content.Load<Model>("plane"), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required