简体   繁体   English

顶点着色器与顶点

[英]vertex shaders vs vertex

I have a question - I am learning OpenGL ES 2.0 from this tutorial and moving across this website, I have build nice app, with spinning polygon.我有一个问题 - 我正在从本教程中学习 OpenGL ES 2.0 并在这个网站上移动,我已经构建了一个不错的应用程序,带有旋转多边形。 I find another guide where he used vertex shaders.我找到了另一个他使用顶点着色器的指南 What are the differences between them.它们之间有什么区别。 What else I can make with shaders?我还能用着色器做什么?

The difference is that the first tutorial uses OpenGL ES 1.1, and the second uses OpenGL ES 2.0.不同的是,第一个教程使用 OpenGL ES 1.1,第二个使用 OpenGL ES 2.0。 1.1 used the fixed-function pipeline to do all of its rendering, while 2.0 exclusively uses shaders. 1.1 使用固定功能管道进行所有渲染,而 2.0 专门使用着色器。

All of those matrix functions?所有这些矩阵函数? glLoadIdentity, glFrustum, glRotate? glLoadIdentity、glFrustum、glRotate? They're gone in 2.0.它们在 2.0 中消失了。 Instead, you write a program (shader) that executes on the GPU itself.相反,您编写一个在 GPU 本身上执行的程序(着色器)。 The shader responsible for transforming vertex positions is called the "vertex shader".负责变换顶点位置的着色器称为“顶点着色器”。

So the vertex shader replaces all of the automatic matrix transforms with a much more flexible, user-driven, computation system.因此,顶点着色器用一个更灵活、用户驱动的计算系统代替了所有的自动矩阵变换。

In a nutshell, OpenGL ES 1.1 is (much) easier to get into, while OpenGL ES 2.0 is much more flexible and probably potentially a lot faster.简而言之,OpenGL ES 1.1 更容易进入,而 OpenGL ES 2.0 更灵活,可能更快。 There are some things you just can't do in 1.1.有些事情在 1.1 中是无法做到的。

OpenGL ES 1.1 and 2.0 are completely mutually incompatible, so choose wisely. OpenGL ES 1.1 和 2.0 完全互不兼容,所以要明智地选择。

There is much more material out there to learn 1.1 than there is for 2.0. 1.1 的学习材料比 2.0 的要多得多。

From my understanding of it, Vertices are representations of points on the 3D things you render, while Vertex Shaders are a means to temporarily modify a Vertex before rendering.根据我的理解,顶点是您渲染的 3D 事物上的点的表示,而顶点着色器是在渲染之前临时修改顶点的一种方法。 Vertex Shaders run on your video card (gpu), so you can perform many actions in parallel (eg perform the same function on all of the vertices in your scene)- this takes a lot of burden off of your cpu.顶点着色器在您的视频卡 (gpu) 上运行,因此您可以并行执行许多操作(例如,在场景中的所有顶点上执行相同的 function)——这会减轻您的 cpu 负担。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM