Contents A Gentle Introduction to Computer Graphics (Programming)

在计算机内存表示一个盒子

顶点坐标;
对象(模型)的拓扑(拓扑学指点如何相互连接形成面);
用一个系统创建盒子的图像(透视投影);

透视投影后的坐标:

投影点的坐标不在(0,1)范围内。这些坐标在NDC空间中定义,NDC空间表示规范化的设备坐标。这很方便,因为不管画布(或屏幕)的原始大小如何(根据使用的设置可能不同),我们现在都在公共空间中定义了所有的点坐标。“正常化”这个术语很常见。这意味着您可以以某种方式将值从它们最初所在的范围重新映射到[0,1]

您知道您的屏幕的分辨率或尺寸(以像素为单位)是多少吗?

512x512图像是一个数字图像有512行512像素,你更喜欢看它的另一种方式,512列512垂直对齐像素。**由于我们的坐标已经被归一化了,我们需要做的就是用像素来表示它们,就是将这些NDC坐标乘以图像维数(512)。**在这里,我们的画布是方形的,我们也将使用一个方形图像:

计算机图形学的一个很大的领域是用来模拟流体(水、火、烟)、织物、头发等的运动。

渲染在计算上也是很昂贵的任务。花费多少取决于你的场景有多少几何图形,以及你想要的最终图像有多真实。在渲染中,我们区分了离线和实时两种模式。**实时是用于视频游戏的(这实际上是一个要求),其中3D场景的内容需要至少以每秒30帧的速度渲染(通常每秒60帧被认为是一个标准)。大多数实时渲染都是在GPU上进行的,GPU是一种专门设计用来以最快速度渲染3D场景的处理器。**实时渲染技术将在实时部分进行讨论。离线渲染通常用于不需要实时的电影CGI制作(图像在以24、30或60帧每秒的速度显示之前预先计算并存储)。它可能需要几秒钟到几个小时才能完成一个图像,但它通常处理更多的几何图形,并产生比实时渲染更高质量的图像。然而,实时或离线渲染往往重叠越来越多的这些天,与视频游戏将可以处理的几何量以及质量和离线渲染引擎试图利用CPU技术领域的最新进展极大地提高他们的表演。

Computer Graphics Programming in OpenGL with C++ by V. Scott Gordon, John L. Clevenger English | 2019 | ISBN: 1683922216 | 384 Pages | EPUB | 29 MB This book provides step-by-step instruction on modern 3D graphics shader programming in OpenGL with C++, along with its theoretical foundations. It is appropriate both for computer science graphics courses and for professionals interested in mastering 3D graphics skills. It has been designed in a 4-color, “teach-yourself” format with numerous examples and detailed explanations. Every shader stage is explored, starting with the basics of modeling, lighting, textures, etc., up through advanced techniques such as tessellation, soft shadows, and generating realistic materials and environments. The book includes companion files with all of the source code, models, textures, skyboxes and normal maps used in the book. Features: Covers modern OpenGL 4.0+ shader programming in C++, with instructions for both PC/Windows and Macintosh. Illustrates every technique with running code examples. Everything needed to install the libraries, and complete source code for each example is provided and fully explained. Includes step-by-step instruction for using each GLSL programmable pipeline stage (vertex, tessellation, geometry, and fragment). Explores practical examples for modeling, lighting and shadows (including soft shadows), terrain, and 3D materials such as wood and marble. Explains how to optimize code for performance, and use modern development tools such as the NVIDIA® Nsight™ debugger. Includes companion files with all of the code, object models, figures, textures, skyboxes and skydomes, height and normal maps used throughout the book.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值