开发者

vertex shaders vs vertex

开发者 https://www.devze.com 2023-03-18 07:45 出处:网络
I have a question - I am learning OpenGL ES 2.0 from this tutorial and moving across this websit开发者_如何学Goe, I have build nice app, with spinning polygon.

I have a question - I am learning OpenGL ES 2.0 from this tutorial and moving across this websit开发者_如何学Goe, I have build nice app, with spinning polygon. 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. 1.1 used the fixed-function pipeline to do all of its rendering, while 2.0 exclusively uses shaders.

All of those matrix functions? glLoadIdentity, glFrustum, glRotate? They're gone in 2.0. Instead, you write a program (shader) that executes on the GPU itself. 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. There are some things you just can't do in 1.1.

OpenGL ES 1.1 and 2.0 are completely mutually incompatible, so choose wisely.

There is much more material out there to learn 1.1 than there is for 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. Vertex Shaders run on your video card (gpu), so you can perform many actions in parallel (e.g. perform the same function on all of the vertices in your scene)- this takes a lot of burden off of your cpu.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号