O'Reilly logo

Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming by Paul Varcholik

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

Chapter 16. Materials

In this chapter, you develop a set of types to encapsulate and simplify the interactions with effects. Then you exercise these types through a set of demo applications. You also create a reusable component for rendering skyboxes.

Motivation

If you examine the last several demos (the triangle demo, the cube demo, and the two model demos), you’ll see quite a bit of duplicated code: the shader compilation, the effect object creation, the technique, pass and variable lookup, input layout creation, and vertex and index buffer creation—all this code is repeated. If you’re like me, you’re itching to modularize this code. Furthermore, the types and data members for interfacing with the BasicEffect shader (the BasicEffectVertex ...

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