about

更新时间: 2023-12-01 14:45:27

# 写给自己的话

为了学习英语和shader,我打算坚定的看英文版! 本书原版: The Book of Shaders (opens new window)

# 原书引用

The images above were made in different ways. The first one was made by Van Gogh's hand applying layer over layer of paint. It took him hours. The second was produced in seconds by the combination of four matrices of pixels: one for cyan, one for magenta, one for yellow and one for black. The key difference is that the second image is produced in a non-serial way (that means not step-by-step, but all at the same time).

单词

  • combination
    n. 结合体,联合体;结合,联合;(用于开锁的)数码组合;化合作用;两用(或多用的)物品;<旧>衫裤相连的内衣;组合;<英>附边车的摩托车 复数 combinations
    例句:The second was produced in seconds by the combination of four matrices of pixels:
    第二种是通过四个像素矩阵的组合在几秒钟内产生的:

  • matrices
    n. [数]矩阵;模型;[生物][地质]基质;母岩(matrix 的复数) 例句: However, Laplace expansion is efficient for small matrices only.
    但是,拉普拉斯展开仅对小型矩阵有效。

  • cyan
    n. 蓝绿色,青色(用于印刷) adj. 青色的

  • magenta
    n.品红;洋红;红色苯胺染料
    adj. 洋红色的;品红色的

  • non-serial
    非串行,非序列

This book is about the revolutionary computational technique, fragment shaders, that is taking digitally generated images to the next level. You can think of it as the equivalent of Gutenberg's press for graphics.

单词

  • revolutionary
    adj. 革命的;革命性的,突破性的
    n. 革命者,革命家

  • equivalent
    adj. 等同的,等效的
    n. 对等的人(或事物),对应的人(或事物);当量(equivalent weight)

难句

You can think of it as the equivalent of Gutenberg's press for graphics.
你可以把它看做当年的古腾堡印刷术

Fragment shaders give you total control over the pixels rendered on the screen at a super fast speed. This is why they're used in all sort of cases, from video filters on cellphones to incredible 3D video games.

单词

  • all sort of
    各种各样的

  • incredible
    adj. 不可思议的,难以置信的;惊人的,极大的,极多的;了不起的,极好的

In the following chapters you will discover how incredibly fast and powerful this technique is and how to apply it to your professional and personal work.

# Who is this book for?

This book is written for creative coders, game developers and engineers who have coding experience, a basic knowledge of linear algebra and trigonometry, and who want to take their work to an exciting new level of graphical quality. (If you want to learn how to code, I highly recommend you start with Processing and come back later when you are comfortable with it.)

单词

  • creative
    adj.创造(性)的,创作的;有创造力的,有想象力的
    n.创作者;创意,创作素材

  • algebra
    n.代数;代数学

  • trigonometry
    n. 三角学
    三角学 /三角 /三角函数

This book will teach you how to use and integrate shaders into your projects, improving their performance and graphical quality. Because GLSL (OpenGL Shading Language) shaders compile and run on a variety of platforms, you will be able to apply what you learn here to any enviroment that uses OpenGL, OpenGL ES or WebGL. In other words, you will be able to apply and use your knowledge with Processing sketches, openFrameworks applications, Cinder interactive installations, Three.js websites or iOS/Android games.

单词

  • integrate
    v. (使)合并,成为一体;(使)加入,融入群体;(使)取消种族隔离;求……的积分;表示(面积、温度等)的总和,表示……的平均值
    adj. 整合的

  • variety
    n. 多样化,变化;种类,品种;(人或物的)各式各样;综艺表演,杂耍表演

# What does this book cover?

This book will focus on the use of GLSL pixel shaders. First we'll define what shaders are; then we'll learn how to make procedural shapes, patterns, textures and animations with them. You'll learn the foundations of shading language and apply it to more useful scenarios such as: image processing (image operations, matrix convolutions, blurs, color filters, lookup tables and other effects) and simulations (Conway's game of life, Gray-Scott's reaction-diffusion, water ripples, watercolor effects, Voronoi cells, etc.). Towards the end of the book we'll see a set of advanced techniques based on Ray Marching.

单词

  • procedural
    adj. 程序上的

  • patterns
    n. 模式(pattern 的复数形式)
    v. 摹制;用图案装饰;复写(pattern 的第三人称单数形式)
    网络 花样 /模型 /木模 /形态

  • foundations
    n. [建]基础(foundation 的复数);房基

  • scenarios
    n. 情节;脚本;情景介绍(scenario 的复数)
    网络 场景 /情节 /场景战役

  • convolutions
    卷积

难句

You'll learn the foundations of shading language and apply it to more useful scenarios such as: image processing (image operations, matrix convolutions, blurs, color filters, lookup tables and other effects) and simulations (Conway's game of life, Gray-Scott's reaction-diffusion, water ripples, watercolor effects, Voronoi cells, etc.).

您将学习shader语言的基础,并将其应用于更有用的场景,如:图像处理(图像操作,矩阵卷积,模糊,彩色过滤器,查找表和其他效果)和模拟(康威的生活游戏,格雷-斯科特的反应扩散,水波纹,水彩效果,Voronoi细胞等)。

There are interactive examples for you to play with in every chapter. When you change the code, you will see the changes immediately. The concepts can be abstract and confusing, so the interactive examples are essential to helping you learn the material. The faster you put the concepts into motion the easier the learning process will be.

单词

  • concepts
    n. 概念,观念;思想(concept 复数形式)

  • abstract
    adj. 抽象的,纯概念的;(艺术)抽象派的;理论上的,不切实际的
    n. 摘要,梗概;抽象画,抽象派艺术作品;抽象的概念
    v. 抽象化,从理论上(或孤立地)考虑;提取,使分离;写……的摘要;偷走,窃取;退出

  • confusing
    adj. 令人费解的,令人迷惑的
    v. 使迷惑,使困惑;使混乱,使混淆;使更难于理解(confuse 的现在分词)

  • essential
    adj. 必不可少的,非常重要的;基本的,精髓的;(氨基酸、脂肪酸)必需的;(疾病)自发的,原发的
    n. 必不可少的东西,必需品;要素,本质;(某学科的)基础,基本知识

  • into motion
    付出行动

What this book doesn't cover:

This is not an openGL or webGL book. OpenGL/webGL is a bigger subject than GLSL or fragment shaders. To learn more about openGL/webGL I recommend taking a look at: OpenGL Introduction, the 8th edition of the OpenGL Programming Guide (also known as the red book) or WebGL: Up and Running

This is not a math book. Although we will cover a number of algorithms and techniques that rely on an understanding of algebra and trigonometry, we will not explain them in detail. For questions regarding the math I recommend keeping one of the following books nearby: 3rd Edition of Mathematics for 3D Game Programming and computer Graphics or 2nd Edition of Essential Mathematics for Games and Interactive Applications.

# What do you need to start?

Not much! If you have a modern browser that can do WebGL (like Chrome, Firefox or Safari) and a internet connection, click the “Next” Chapter button at the end of this page to get started.