实例介绍
Graphics programming is the magic behind video games, film, and scientific simulation. Every explosion, dust particle, and lens flare you see on a computer screen is processed through a graphics card. In addition, because modern operating systems use the graphics processing unit (GPU) to draw their
Introduction Graphics programming is the magic behind video games, film, and scientific simulation. Every explosion, dust particle, and lens flare you see on a computer screen is processed through a graphics card. In addition, because modern operating systems use the graphics processing unit (GPu to draw their content, every pixel you see is rendered through the GPU and through software developed by a graphics programmer. It's a broad topic, but one that has traditionally been the province of a select few. Even to experienced software developers, rendering is often considered a dark art, full of complex mathematics and esoteric tools. Furthermore the rapid pace of advancement makes modern graphics programming a moving target, and establishing a foothold can be difficult That's where this book comes in. In these pages, you'll find an introduction to real-time 3d rendering. I've presented this material in a straightforward and practical way but it doesn't shy away from more complex topics. Indeed, this book takes you far beyond drawing simple objects to the screen and introduces intermediate and advanced subjects in modern rendering. It is my sincere wish that you find the material in this book approachable, applicable, and up-to-date with modern graphics techniques Intended Audience This book is intended for experienced software engineers new to graphics programming. The text often uses terminology from the video game industry but you need not be a game developer to make use of this book Indeed, the topic of modern rendering reaches well beyond video games and is becoming ever more pervasive in a variety of software-related fields. Regardless of the specific type of software you develop if you are interested in learning about modern rendering this book is for you This text also assists existing graphics programmers who are new to directX or who are familiar with an older version of the library. We cover Directx, and the library has seen major changes over the last few years. this book also applies to students, hobbyists and technical artists interested in real-time rendering If you are new to programming, not specifically graphics programming, this book might not be what you're looking for. In particular, Part Ill,"Rendering with DirectX ,develops a C++ rendering engine and expects a familiarity with that language Why This Book? Several excellent books on the market explore graphics programming. However, most of these texts focus on only one area: either shader programming or the rendering api (such as directx or openGL). mention of the other topic, the other side of the same coin, is often given short shrift--perhaps just a chapter or two Modern rendering doesnt exist without shaders, but shaders aren't executed without an underlying graphics application I know of few books that incorporate both topics in a thorough integrated fashion nor one that balances introductory material with intermediate and advanced topics. a sticking point with many books is that they are either so novice that they leave the reader wanting or so advanced that even experienced software engineers have trouble absorbing the material You can also find a number of good books on general-purpose game or engine programming. These texts often include material on graphics programming or approaches to organizing 3D models and materials. But these books often have such a broad scope that rendering gets lost in the pages The approaches I've mentioned are all valid, and again, you can find many wonderful books on the market Yet I'm seeing a gap where an experienced developer who wants to tackle graphics programming is missing a text that offers a full, focused treatment of rendering from both the CPU and GPu sides of the topic. This book aims to fill this gap How This Book Is Organized This book is organized into four parts a Part I,An Introduction to 3D Rendering, provides an introduction to graphics programming. It ncludes a discussion about the history of DirectX up to version 11. 1(the version were using in this book and looks at the direct3d graphics pipeline. Chapter 2 includes a primer on 3D math, along with a detailed look at the DirectX Math API. If you are already familiar with linear algebra and 3d mathematics, you might consider skipping or skimming Chapter 2. However, I encourage you to read the section on DirectX Math (Microsoft's latest revision of an impressive SIMD-friendly math library focused on graphics-related mathematics). Part I ends with an exploration of best-of-breed tools for authoring and debugging shaders and graphics applications a Part II,Shader Authoring with HLSL, is all about shaders and programming using the High-Level Shader Language(HLSL). This section begins with the most introductory vertex and pixel shaders and a discussion of semantics and annotations. Chapter 5 examines texture mapping and texture filtering and rapping modes. Chapter 6 introduces basic lighting models, including ambient lighting, diffuse(Lambert) lighting, and specular highlighting. Chapter 7 details point lights, spot lights and multiple lights. In Chapter 8, you write shaders involving cube maps, including shaders for skyboxes and environment mapping. Part Il concludes with a potpourri of shaders for fog, color blending, normal mapping and displacement mapping In Part III, Rendering with Directx, we discuss the application side of the house. Throughout this section, you develop a C++ rendering engine and incorporate the shaders you authored in Part II. Chapters 10-14 introduce the core components of the engine: the game loop, time, components and Windows and DirectX initialization We also cover mouse and keyboard input cameras, and text rendering. In Chapter 15 you dive into the topic of 3D models: asset loading and model rendering. And in Chapter 16, you develop a flexible effect and material system to integrate your shaders. Part III ends with a chapter on CPU-side structures for directional, point and spot lights a Part IV,Intermediate-Level Rendering Topics, raises the bar a bit and moves to intermediate-level rendering topics. the section begins with a discussion of post-processing techniques (effects ty pically applied to the entire scene after its initial rendering). this includes shaders for color filtering, gaussian blurring bloom and distortion mapping. In Chapter 19, you implement systems for projective texture mapping and shadow mapping. Then in Chapter 20, you develop a skeletal animation system for importing and rendering animated models. Chapter 21 details geometry and tessellation shaders; you implement a point sprite shader and explore hardware tessellation a powerful addition to the directx 11 graphics pipeline. The book ends with a survey of additional topics in modern rendering including rendering optimization deferred rendering global illumination, compute shaders and data-driven engine architecture Prerequisites This book has no expectation that you are already a game or graphics developer, nor does it expect you to be fluent in 3D mathematics. It simply requires you to be interested in graphics programming and already be familiar with the C++ programming language. If you are an experienced programmer but you are coming from a different language you may have no trouble with the material in Parts Ill and Iv. However there is no concerted effort to discuss C++ syntax. Furthermore, all code samples are provided for the microsoft Windows operating system and are packaged for Visual Studio 2012 or 2013. these samples require a graphics card that supports(at least) shader Model 4. Some of the samples (particularly the demonstrations on compute shaders and tessellation require a graphics card that supports Shader Model 5 Companion Website Thisbookhasacompanionwebsiteathttp://www.varcholik.org/.thereyoullfindallcodesamplesand errata, along with a forum for questions and discussion about the book. Conventions in This Book This book uses a number of conventions for source code, notes and warnings Note When something needs additional explanation it is called out in a note"that looks like this Warning: Warnings Look Like This A warning" points out something that might not be obvious and could cause problems if you did not know about it When code appears inside the text, it looks like this You will also find exercises at the end of chapters 3-22 (all but the first two chapters. These exercises reinforce the material discussed in the text and encourage you to experiment Part I: An Introduction to 3D Rendering 1 Introducing DirectX 2 A 3D/ Math Primer 3 Tools of the trade 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论