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 ...

Get Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.