Deprecated OpenGL features

后端 未结 2 1479
陌清茗
陌清茗 2021-01-03 10:07

I recently read this list and I noticed that almost everything I studied from the OpenGL Red Book is considered deprecated. I\'m talking about pixel transfer operations, pix

2条回答
  •  春和景丽
    2021-01-03 10:11

    In my opinion its for the better. But this so called Immediate Mode is indeed deprecated in OpenGL 3.0 mainly because its performance is not optimal.

    In immediate mode you use calls like glBegin and glEnd. So the rendering of primitives depends on the program's commands, OpenGL can't advance until it gets the appropiate command from the CPU. Instead you can use buffer objects to store all your vertices and data. And then tell OpenGL to render its primitives using this buffer with commands like glDrawArrays or glDrawElements or even more specialized commands like glDrawElementsInstanced. While the GPU is busy executing those commands and drawing the buffer to the target FrameBuffer (basically a render target). The program can go off and issue some other commands. This way both the CPU and the GPU are busy at the same time, and no time is wasted.

    Not the best explanation ever, but my advice: try to learn this new rendering pipeline instead. It's superior to immediate mode by far. I recommend tutorials like:

    http://www.arcsynthesis.org/gltut/index.html

    http://www.opengl-tutorial.org/

    http://ogldev.atspace.co.uk/

    Literally try to forget what you know so far, immediate mode is long deprecated and shouldn't be used anymore, instead, focus on the new technology ;)

    Edit Excuse me if I used 'intermediate' instead of 'immediate', I think its actually called 'immediate', I tend to mix them up.

提交回复
热议问题