-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
722 lines (430 loc) · 19.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="http://learnopengl.com 系列教程的简体中文翻译">
<link rel="canonical" href="https://learnopengl-cn.github.io/">
<link rel="shortcut icon" href="./img/favicon.ico">
<title>主页 - LearnOpenGL CN</title>
<link href="./css/bootstrap-custom.min.css" rel="stylesheet">
<link href="./css/font-awesome-4.0.3.css" rel="stylesheet">
<link rel="stylesheet" href="./css/highlight.css">
<link href="./css/base.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/admonition_fix.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-80323542-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href=".">LearnOpenGL CN</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="active">
<a href=".">主页</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">目录 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="intro/">简介</a>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">入门</a>
<ul class="dropdown-menu">
<li >
<a href="01%20Getting%20started/01%20OpenGL/">OpenGL</a>
</li>
<li >
<a href="01%20Getting%20started/02%20Creating%20a%20window/">创建窗口</a>
</li>
<li >
<a href="01%20Getting%20started/03%20Hello%20Window/">你好,窗口</a>
</li>
<li >
<a href="01%20Getting%20started/04%20Hello%20Triangle/">你好,三角形</a>
</li>
<li >
<a href="01%20Getting%20started/05%20Shaders/">着色器</a>
</li>
<li >
<a href="01%20Getting%20started/06%20Textures/">纹理</a>
</li>
<li >
<a href="01%20Getting%20started/07%20Transformations/">变换</a>
</li>
<li >
<a href="01%20Getting%20started/08%20Coordinate%20Systems/">坐标系统</a>
</li>
<li >
<a href="01%20Getting%20started/09%20Camera/">摄像机</a>
</li>
<li >
<a href="01%20Getting%20started/10%20Review/">复习</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">光照</a>
<ul class="dropdown-menu">
<li >
<a href="02%20Lighting/01%20Colors/">颜色</a>
</li>
<li >
<a href="02%20Lighting/02%20Basic%20Lighting/">基础光照</a>
</li>
<li >
<a href="02%20Lighting/03%20Materials/">材质</a>
</li>
<li >
<a href="02%20Lighting/04%20Lighting%20maps/">光照贴图</a>
</li>
<li >
<a href="02%20Lighting/05%20Light%20casters/">投光物</a>
</li>
<li >
<a href="02%20Lighting/06%20Multiple%20lights/">多光源</a>
</li>
<li >
<a href="02%20Lighting/07%20Review/">复习</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">模型加载</a>
<ul class="dropdown-menu">
<li >
<a href="03%20Model%20Loading/01%20Assimp/">Assimp</a>
</li>
<li >
<a href="03%20Model%20Loading/02%20Mesh/">网格</a>
</li>
<li >
<a href="03%20Model%20Loading/03%20Model/">模型</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">高级OpenGL</a>
<ul class="dropdown-menu">
<li >
<a href="04%20Advanced%20OpenGL/01%20Depth%20testing/">深度测试</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/02%20Stencil%20testing/">模板测试</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/03%20Blending/">混合</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/04%20Face%20culling/">面剔除</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/05%20Framebuffers/">帧缓冲</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/06%20Cubemaps/">立方体贴图</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/07%20Advanced%20Data/">高级数据</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/08%20Advanced%20GLSL/">高级GLSL</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/09%20Geometry%20Shader/">几何着色器</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/10%20Instancing/">实例化</a>
</li>
<li >
<a href="04%20Advanced%20OpenGL/11%20Anti%20Aliasing/">抗锯齿</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">高级光照</a>
<ul class="dropdown-menu">
<li >
<a href="05%20Advanced%20Lighting/01%20Advanced%20Lighting/">高级光照</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/02%20Gamma%20Correction/">Gamma校正</a>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">阴影</a>
<ul class="dropdown-menu">
<li >
<a href="05%20Advanced%20Lighting/03%20Shadows/01%20Shadow%20Mapping/">阴影映射</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/03%20Shadows/02%20Point%20Shadows/">点阴影</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/03%20Shadows/03%20CSM/">CSM</a>
</li>
</ul>
</li>
<li >
<a href="05%20Advanced%20Lighting/04%20Normal%20Mapping/">法线贴图</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/05%20Parallax%20Mapping/">视差贴图</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/06%20HDR/">HDR</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/07%20Bloom/">泛光</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/08%20Deferred%20Shading/">延迟着色法</a>
</li>
<li >
<a href="05%20Advanced%20Lighting/09%20SSAO/">SSAO</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">PBR</a>
<ul class="dropdown-menu">
<li >
<a href="07%20PBR/01%20Theory/">理论</a>
</li>
<li >
<a href="07%20PBR/02%20Lighting/">光照</a>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">IBL</a>
<ul class="dropdown-menu">
<li >
<a href="07%20PBR/03%20IBL/01%20Diffuse%20irradiance/">漫反射辐照</a>
</li>
<li >
<a href="07%20PBR/03%20IBL/02%20Specular%20IBL/">镜面IBL</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">实战</a>
<ul class="dropdown-menu">
<li >
<a href="06%20In%20Practice/01%20Debugging/">调试</a>
</li>
<li >
<a href="06%20In%20Practice/02%20Text%20Rendering/">文本渲染</a>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">2D游戏</a>
<ul class="dropdown-menu">
<li >
<a href="06%20In%20Practice/2D-Game/01%20Breakout/">Breakout</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/02%20Setting%20up/">准备工作</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/03%20Rendering%20Sprites/">渲染精灵</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/04%20Levels/">关卡</a>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">碰撞</a>
<ul class="dropdown-menu">
<li >
<a href="06%20In%20Practice/2D-Game/05%20Collisions/01%20Ball/">球</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/05%20Collisions/02%20Collision%20detection/">碰撞检测</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/05%20Collisions/03%20Collision%20resolution/">碰撞处理</a>
</li>
</ul>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/06%20Particles/">粒子</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/07%20Postprocessing/">后期处理</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/08%20Powerups/">道具</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/09%20Audio/">音效</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/10%20Render%20Text/">渲染文本</a>
</li>
<li >
<a href="06%20In%20Practice/2D-Game/11%20Final%20thoughts/">结语</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">Guest Articles</a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">2020</a>
<ul class="dropdown-menu">
<li >
<a href="08%20Guest%20Articles/2020/01%20Skeletal%20Animation/">骨骼动画</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" class="nav-title">2022</a>
<ul class="dropdown-menu">
<li >
<a href="08%20Guest%20Articles/2022/03%20Area%20Lights/">区域光</a>
</li>
</ul>
</li>
</ul>
</li>
<li >
<a href="legacy/">历史存档</a>
</li>
</ul>
</li>
<li >
<a href="code_repo/">代码仓库</a>
</li>
</ul>
<!-- Search, Navigation and Repo links -->
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> 搜索
</a>
</li>
<li class="disabled">
<a rel="next" >
<i class="fa fa-arrow-left"></i> 上一节
</a>
</li>
<li >
<a rel="prev" href="intro/">
下一节 <i class="fa fa-arrow-right"></i>
</a>
</li>
<li>
<a href="https://github.com/LearnOpenGL-CN/LearnOpenGL-CN">
<i class="fa fa-github"></i>
GitHub
</a>
</li>
<li>
<a href="https://www.paypal.me/learnopengl/">
<img class="paypal" src="/img/paypal_logo.png" alt="">
支持原作者
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="main active"><a href="#opengl">欢迎来到OpenGL的世界</a></li>
<li><a href="#_1">为什么要阅读这些教程呢?</a></li>
<li><a href="#_2">你将学会什么呢?</a></li>
<li><a href="#_3">关于中文翻译</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="opengl">欢迎来到OpenGL的世界</h1>
<p>欢迎来到OpenGL的世界。这个工程只是我(<a href="http://joeydevries.com/">Joey de Vries</a>)的一次小小的尝试,希望能够建立起一个完善的OpenGL教学平台。无论你学习OpenGL是为了学业,找工作,或仅仅是因为兴趣,这个网站都将能够教会你<strong>现代</strong>(Core-profile) OpenGL从基础,中级,到高级的知识。LearnOpenGL的目标是使用易于理解的形式,使用清晰的例子,展现现代OpenGL的所有知识点,并与此同时为你以后的学习提供有用的参考。</p>
<p>如果您喜欢这个系列教程的话,不妨向Joey de Vries的<a href="https://www.paypal.me/learnopengl/">Paypal</a>进行捐赠,支持一下作者,让这个教程能够持续完善并更新。</p>
<h2 id="_1">为什么要阅读这些教程呢?</h2>
<p><img alt="Image of smiling textured containers in OpenGL" src="img/index_image2.png" class="right medium" /></p>
<p>在互联网上,有关学习OpenGL的有成千上万的文档与资源,然而其中大部分的资源仅仅讨论了OpenGL的立即渲染模式(Immediate Mode,通常会说旧OpenGL),亦或是不完整,缺少适当的文档,甚至是仅仅不适合你的口味。所以,我的目标是提供一个既完整,又易懂的平台供人们学习。</p>
<p>如果你很享受那些提供手把手指导的教程,那些提供清晰例子的教程,以及那些不会一下将你淹没在细节中的教程,那么我的这些教程很可能就很适合你。我的教程旨在让那些没有图形编程经验的人们能够理解,又让那些有经验的读者有阅读下去的兴趣。我的教程同样也讨论了一些常用的概念,只需要你再有一点创造力,就能将你的想法变成真正的3D程序。如果如果你觉得前面这些讲的都是你,欢迎继续阅读我的教程。</p>
<h2 id="_2">你将学会什么呢?</h2>
<p>我这些教程的核心是现代OpenGL。学习(和使用)现代OpenGL需要用户对图形编程以及OpenGL的幕后运作有非常好的理解才能在编程中有很好的发挥。所以,我们会首先讨论核心的图形学概念,OpenGL怎样将像素绘制到屏幕上,以及如何利用黑科技做出一些很酷的效果。</p>
<p>除了核心概念之外,我们还会讨论许多有用的技巧,它们都可以用在你的程序中,比如说在场景中移动,做出漂亮的光照,加载建模软件导出的自定义模型,做一些很酷的后期处理技巧等。最后,我们也将会使用我们已学的知识从头开始做一个小游戏,让你真正体验一把图形编程的魅力。</p>
<h2 id="_3">关于中文翻译</h2>
<p>这里是LearnOpenGL教程的中文翻译,英文版的地址为:<a href="https://learnopengl.com/">https://learnopengl.com/</a></p>
<p>由于翻译可能无法做到精确表达原文意思,我们推荐您在对问题有疑惑的时候去阅读一下英文版的教程。如果您对翻译有更好的建议,可以去我们的<a href="https://github.com/LearnOpenGL-CN/LearnOpenGL-CN">GitHub工程</a>上提交Issue或者Pull Request。如果是对教程的内容有问题,请先查看原文,如果不是翻译错误的话,请直接在原网站评论区向作者(JoeyDeVries)反馈。</p>
<p>如果教程中的源码无法打开的话,可以到教程的<a href="https://github.com/JoeyDeVries/LearnOpenGL">GitHub页面</a>上去寻找所需的代码,每一节教程的源码以及练习都位于 <code>src</code> 目录下的对应章节目录中。</p>
<div id="disqus_thread"></div>
<script>
(function() {
var d = document, s = d.createElement('script');
s.src = '//learnopengl-cn.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>请启用JavaScript以浏览<a href="https://disqus.com/?ref_noscript" rel="nofollow">Disqus评论。</a></noscript></div>
</div>
<footer class="col-md-12">
<hr>
<center>Powered by <a href="http://www.mkdocs.org/">MkDocs</a> and <a href="http://bootswatch.com/yeti/">Yeti</a></center>
</footer>
<script src="./js/jquery-1.10.2.min.js"></script>
<script src="./js/bootstrap-3.0.3.min.js"></script>
<script src="./js/highlight.pack.js"></script>
<script>var base_url = '.';</script>
<script src="./js/base.js"></script>
<script src="mathjax/MathJax.js?config=TeX-AMS_HTML"></script>
<script src="search/main.js"></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
<h4 class="modal-title" id="exampleModalLabel">搜索</h4>
</div>
<div class="modal-body">
<p>
请在下面输入你要搜索的文本(仅支持英文):
</p>
<form role="form">
<div class="form-group">
<input type="text" class="form-control" placeholder="搜索..." id="mkdocs-search-query">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>