Opengl что это за программа в windows

Узнаем про OpenGL — что это такое и для чего используется в ОС. Также требуется ли что то настраивать для его эксплуатации.

Здравствуйте, дорогие читатели! Сегодня мы с вами разберем OpenGL — что это такое, для чего используется, требуется ли что то настраивать для его эксплуатации.

Что это за программа

И сразу же хочу уточнить, что это вовсе не программа в привычном понимании, не драйвер, не протокол и не служба.

OpenGL — спецификация, которой определяется программный интерфейс для написания приложений, использующих 2D и 3D графику. По сути, это инструмент, который регулирует рендеринг изображения видеокартой.

Название расшифровывается как Open Graphics Library, то есть «Открытая графическая библиотека». Открытость инструмента означает, что им может воспользоваться любой разработчик без всякой маржи и лицензионных отчислений.

Инструмент кроссплатформенный: созданные с его помощью приложения будут работать в любой среде, которые осуществляют его поддержку.

При этом работать будут одинаково все в зависимости от мощности рабочей станции. Такая реализация освобождает разработчика от необходимости писать код под каждую конкретную платформу, что позволяет полностью сосредоточиться на графической составляющей.

Основные области применения OpenGL — видеоигры, системы автоматизированного проектирования, поддержка виртуальной реальности и визуализация различных проектов. На платформе Windows главным конкурентом технологии является DirectX.

О том, что такое DirectX и зачем он нужен, вы можете почитать вот тут.

Концепция OpenGL была разработана в 1982 году в университете Стэнфорда. Аппаратно прототип технологии впервые реализовала компания Silicon Graphics, создавшая конвейер для рендеринга. Ее разработки стали основой библиотек OpenGL.

Как работает OpenGL

Если смотреть с точки зрения разработчика, то OpenGL — программный интерфейс, который управляет работой видеокарты. Всего есть чуть более 150 команд, с помощью которых программист определяет, какие именно объекты будут отправлены на рендеринг.Этим же стандартом определяются более тонкие настройки: например, тройная буферизация, трассировка лучей или сглаживание в играх.

Нет необходимости создавать разные версии графических объектов для отображения в различных режимах качества графики: все подстраивается «на автомате», исходя из заданных программистов параметров.

Проще говоря, программист определяет отображаемые объекты в трехмерном пространстве, их взаимное положение и взаимодействие, масштабирование, угол обзора и т.д., а также цвет и текстуру, а OpenGL уже заботится об их рендеринге.

Можно утверждать, что этот инструмент только воспроизводит объекты, но не взаимодействует с устройствами ввода — мышью, клавиатурой, геймпадом или игровым рулем. За это, а также за работу менеджера окон, отвечают уже другие компоненты.

Несмотря на кажущуюся сложность, OpenGL имеет четко продуманную структуру и простой процедурный интерфейс. При этом с помощью этого инструмента можно создавать действительно сложные сцены, состоящие из множества компонентов. Вычислительных мощностей требуется меньше по сравнению с другими библиотеками.

Некоторые версии OpenGL поддерживают работу по сети: объекты рендерятся на сервере, а клиентское приложение получает только их отображение. Благодаря этому можно создавать мощные воспроизводящие комплексы, состоящие из множества компьютеров.

Следует отметить, что в отличие от главного конкурента OpenGL можно считать универсальным инструментом. Главный конкурент, DirectX, «заточен» именно под игры. Многие игры поддерживают обе технологии.

Нужно ли переключаться между ними? На мой взгляд, нет никакой разницы, что именно вы используете, Независимо от технологии существенной разницы в производительности не замечено, если речь идет о платформе Windows.

Если же вы используете эмулятор Андроид на ПК, в этом случае рекомендую переключиться OpenGL: для систем семейства Unix этот инструмент подходит больше.

Также рекомендую ознакомиться с публикациями «Что делать, если видеокарта не поддерживает DirectX» и «Как посмотреть параметры видеокарты». Буду признателен, если вы расшарите этот пост в социальных сетях. До скорой встречи!

С уважением, автор блога Андрей Андреев.

Автор: Роман Подобедов

Введение

Сейчас трёхмерные изображения можно увидеть везде, начиная от компьютерных игр и заканчивая системами моделлирования в реальном времени. Раньше, когда трёхмерная графика существовала только на суперкомпьютерах, не существовало единого стандарта в области графики. Все программы писались с «нуля» или с использованием накопленного опыта, но в каждой программе реализовывались свои методы для отображения графической информации. С приходом мощных процессоров и графических ускорителей трёхмерная графика стала реальностью для персональных компьютеров. Но в тоже время производители программного обеспечения столкнулись с серьёзной проблемой — это отсутствие каких-либо стандартов, которые позволяли писать программы, независимые от оборудования и операционной системы. Одним из первых таких стандартов, существующий и по сей день является OpenGL.

OpenGL — это графический стандарт в области компьютерной графики. На данный момент он является одним из самых популярных графических стандартов во всём мире. Ещё в 1982 г. в Стенфордском университете была разработана концепция графической машины, на основе которой фирма Silicon Graphics в своей рабочей станции Silicon IRIS реализовала конвейер рендеринга. Таким образом была разработана графическая библиотека IRIS GL. На основе библиотеки IRIS GL, в 1992 году был разработан и утверждён графический стандарт OpenGL. Разработчики OpenGL — это крупнейшие фирмы разработчики как оборудования так и программного обеспечения: Silicon Graphics, Inc., Microsoft, IBM Corporation, Sun Microsystems, Inc., Digital Equipment Corporation (DEC), Evans & Sutherland, Hewlett-Packard Corporation, Intel Corporation и Intergraph Corporation.

OpenGL переводится как Открытая Графическая Библиотека (Open Graphics Library), это означает, что OpenGL — это открытый и мобильный стандарт. Программы, написанные с помощью OpenGL можно переносить практически на любые платформы, получая при этом одинаковый результат, будь это графическая станция или суперкомпьютер. OpenGL освобождает программиста от написания программ для конкретного оборудования. Если устройство поддерживает какую-то функцию, то эта функция выполняется аппаратно, если нет, то библиотека выполняет её программно.

Что же представляет из себя OpenGL? С точки зрения программиста OpenGL — это программный интерфейс для графических устройств, таких как графические ускорители. Он включает в себя около 150 различных команд, с помощью которых программист может определять различные объекты и производить рендеринг. Говоря более простым языком, вы определяете объекты, задаёте их местоположение в трёхмерном пространстве, определяете другие параметры (поворот, масштаб, …), задаёте свойства объектов (цвет, текстура, материал, …), положение наблюдателя, а библиотека OpenGL позаботится о том чтобы отобразить всё это на экране. Поэтому можно сказать, что библиотека OpenGL является только воспроизводящей (Rendering), и занимается только отображением 3Д обьектов, она не работает с устройствами ввода (клавиатуры, мыши). Также она не поддерживает менеджер окон.

OpenGL имеет хорошо продуманную внутреннюю структуру и довольно простой процедурный интерфейс. Несмотря на это с помощью OpenGL можно создавать сложные и мощные программные комплексы, затрачивая при этом минимальное время по сравнению с другими графическими библиотеками.

В некоторых библиотеках OpenGL (например под X Windows) имеется возможность изображать результат не только на локальной машине, но также и по сети. Приложение, которое вырабатывает команды OpenGL называется клиентом, а приложение, которое получает эти команды и отображает результат — сервером. Таким образом можно строить очень мощные воспроизводящие комплексы на основе нескольких рабочих станций или серверов, соединённых сетью.

Основные возможности OpenGL.

Что предоставляет библиотека в распоряжение программиста? Основные возможности:

  • Геометрические и растровые примитивы. На основе геометрических и растровых примитивов строятся все объекты. Из геометрических примитивов библиотека предоставляет: точки, линии, полигоны. Из растровых: битовый массив(bitmap) и образ(image)
  • Использование В-сплайнов. B-сплайны используются для рисования кривых по опорным точкам.
  • Видовые и модельные преобразования. С помощью этих преобразований можно располагать обьекты в пространстве, вращать их, изменять форму, а также изменять положение камеры из которой ведётся наблюдение.
  • Работа с цветом. OpenGL предоставляет программисту возможность работы с цветом в режиме RGBA (красный-зелёный-синий-альфа) или используя индексный режим, где цвет выбирается из палитры.
  • Удаление невидимых линий и поверхностей. Z-буферизация.
  • Двойная буферизация. OpenGL предоставляет как одинарную так и двойную буферизацию. Двойная буферизация используется для того, чтобы устранить мерцание при мультипликации, т.е. изображение каждого кадра сначала рисуется во втором(невидимом) буфере, а потом, когда кадр полностью нарисован, весь буфер отображается на экране.
  • Наложение текстуры. Позволяет придавать объектам реалистичность. На объект, например шар, накладывается текстура(просто какое-то изображение), в результате чего наш объект теперь выглядит не просто как шар, а как разноцветный мячик.
  • Сглаживание. Сглаживание позволяет скрыть ступенчатость, свойственную растровым дисплеям. Сглаживание изменяет интенсивность и цвет пикселей около линии, при этом линия смотрится на экране без всяких зигзагов.
  • Освещение. Позволяет задавать источники света, их расположение, интенсивность, и т.д.
  • Атмосферные эффекты. Например туман, дым. Всё это также позволяет придать объектам или сцене реалистичность, а также «почувствовать» глубину сцены.
  • Прозрачность объектов.
  • Использование списков изображений.

Дополнительные библиотеки OpenGL

Несмотря на то, что библиотека OpenGL (сокращённо GL) предоставляет практически все возможности для моделирования и воспроизведения трёхмерных сцен, некоторые из функций, которые требуются при работе с графикой, отсутствуют в стандартной библиотеке OpenGL.. Например, чтобы задать положение и направление камеры, с которой будет наблюдаться сцена, нужно самому рассчитывать модельную матрицу, а это далеко не все умеют. Поэтому для OpenGL существуют так называемые вспомогательные библиотеки.

Первая из этих библиотек называется GLU. Эта библиотека уже стала стандартом и поставляется вместе с главной библиотекой OpenGL. В состав этой библиотеки вошли более сложные функции, например для того чтобы определить цилиндр или диск потребуется всего одна команда. Также в библиотеку вошли функции для работы со сплайнами, реализованы дополнительные операции над матрицами и дополнительные виды проекций.

Следующая библиотека, также широко используемая — это GLUT. Это также независимая от платформы библиотека. Она реализует не только дополнительные функции OpenGL, но и предоставляет функции для работы с окнами, клавиатурой и мышкой. Для того чтобы работать с OpenGL в конкретной операционной системе (например Windows или X Windows), надо провести некоторую предварительную настройку и эта предварительная настройка зависит от конкретной операционной системы. С библиотекой GLUT всё намного упрощается, буквально несколькими командами можно определить окно, в котором будет работать OpenGL, определить прерывание от клавиатуры или мышки и всё это не будет зависеть от операционной системы. Библиотека предоставляет также некоторые функции, с помощью которых можно определять некоторые сложные фигуры, такие как конусы, тетраэдры, и даже можно с помощью одной команды определить чайник!

Есть ещё одна библиотека похожая на GLUT, называется она GLAUX. Это библиотека разработана фирмой Microsoft для операционной системы Windows. Она во многом схожа с библиотекой GLUT, но немного отстаёт от неё по своим возможностям. И ещё один недостаток заключается в том, что библиотека GLAUX предназначена только для Windows, в то время как GLUT поддерживает очень много операционных систем.

Существуют и другие дополнительные библиотеки для OpenGL. Все они добавляют что-то своё или ориентированы на какую-то платформу. Например существует такая библиотека как GLX — это расширение для X Windows, позволяющее использовать в X Windows OpenGL. GLX предоставляет не только локальный рендеринг, но и рендеринг по сети.

Альтернативы OpenGL

Хотя библиотека OpenGL и считается одной из лучших библиотек как для профессионального применения так и для игр, у неё существуют и конкуренты.

Одним из главных конкурентов считается Direct3D из пакета DirectX, разработанный фирмой Microsoft. Direct3D создавался исключительно для игровых приложений. Если сравнивать эти две библиотеки, то нельзя сказать, что одна из них лучше, а другая хуже, у каждой библиотеки имеются свои особенности. Например, если сравнивать их в плане переносимости программ с одной платформы на другую, то Direct3D будет работать только на Intel платформах под управлением операционной системы Windows, в то время программы, написанные с помощью OpenGL можно успешно перенести на такие платформы как Unix, Linux, SunOS, IRIX, Windows, MacOS и многие другие. А вот в плане объектно-ориентированного подхода OpenGL уступает Direct3D. OpenGL работает по принципу конечного автомата, переходя из одного состояния в другое, совершая при этом какие-то преобразования. Ещё одним преимуществом Direct3D является поддержка дешёвого оборудования, OpenGL же поддерживается не на всех графических картах, но для профессиональных ускорителей OpenGL является стандартом де-факто. И ещё, OpenGL легче чем Direct3D для изучения основ графики, OpenGL можно применять например для начального изучения трёхмерной графики.

GLide до недавнего времени тоже являлся довольно широко используемым стандартом для игровых приложений. Этот стандарт создала фирма 3Dfx и библиотека GLide создавалась исключительно для видео ускорителей фирмы 3Dfx Voodoo и была оптимизирована исключительно под них. GLide является более низкоуровневым по отношению к OpenGL и по своим командам похож на него. GLide мало чем отличается от OpenGL по своим возможностям, за исключением некоторых функций, которые специально предназначались для Voodoo ускорителей. Но к сожалению 3Dfx отказалась от этого стандарта, передав его в руки разработчиков открытого программного обеспечения.

Есть ещё несколько библиотек, среди них можно отметить Heidi. Heidi это библиотека или даже лучше сказать драйвер для визуализации трёхмерных сцен, используемый только в 3D Studio Max и только под Windows NT.

Стоит также отметить совместную разработку двух гигантов — Microsoft и Silicon Graphics в области стандартизации компьютерной графики. Этот проект носит название Fahrenheit и сейчас находится в стадии разработки.

Заключение

Заканчивая вводный рассказ про OpenGL хочется подвести некоторые итоги. Итак OpenGL представляет собой единый стандарт для разработки трёхмерных приложений, сочетает в себе такие качества как мощь и в то же время простоту. Мультиплатформенность позволяет без труда переносить программное обеспечение с одной операционной системы в другую. OpenGL предоставляет вам в распоряжение всю мощь аппаратных возможностей, которые вы имеете на данном компьютере и при написании программ вам не нужно будет беспокоится о конкретных деталях используемого оборудования, за вас побеспокоится драйвер OpenGL. OpenGL прекрасно подходит как для профессионалов так и для новичков в области компьютерной графики.

Дополнительные материалы:

DirectX от WinG до Fahrenheit
DirectX7 vs DirectX6
Коротко о DirectX7
OpenGL 2.0: программируемый, масштабируемый и расширяемый
OpenML. Первый взгляд

Если Вы заметили ошибку — выделите ее мышью и нажмите CTRL+ENTER.

Современные компьютеры становятся все мощнее, и, соответственно, для их нормального функционирования необходимо качественное программное обеспечение. Все чаще для игр, 3D-моделирования и видеомонтажа используются графические библиотеки OpenGL. Сегодня я расскажу, для чего они нужны в операционной системе, как определить, поддерживается ли данная технология на компьютере, и опишу несколько способов установки в Windows 7 и Windows 10.

OpenGL расшифровывается как Open Graphics Library и представляет собой интерфейс прикладного программирования API с открытым исходным кодом. Данное ПО используется для масштабирования 2D и 3D графики векторного типа, программирования, создания компьютерных игр, а также обеспечения качественного рендеринга.

Как определить, какая версия OpenGL установлена в Windows

В любой современной операционной системе, не только Windows, поддержка OpenGL встроена. Но даже несмотря на это, необходимо убедиться, действительно ли данное ПО установлено на компьютере. Проверить это очень легко — скачивать сторонние программы пользователю не придется. Нужно лишь открыть настройки видеокарты и перейти в раздел с основными сведениями. Обычно данный раздел отображается в контекстном меню рабочего стола или в скрытых значках на панели задач.

Как узнать версию OpenGL в настройках графической карты Intel

Вот так отображается версия OpenGL в настройках видеокарты Intel

Как определить версию OpenGL в видеокарте компании AMD

В разделе «Настройки» графических карт AMD тоже отображается установленная на данный момент версия OpenGL

Как установить OpenGL на разные видеокарты

Для установки или обновления OpenGL необходимо просто своевременно загрузить последнюю версию драйвера видеокарты. И сделать это можно как через официальный сайт производителя чипсета, так и с помощью встроенной в систему утилиты «Диспетчер устройств».

AMD

Скачивать обновления драйверов видеокарты желательно именно с официального сайта компании AMD. На нем можно подобрать конкретный тип процессора и серию. После автоматически начнется скачивание обновления. Но стоит учитывать, что на этой странице может не оказаться драйверов устаревших моделей видеокарт, но на самом сайте они есть, их лишь нужно найти. Для этого стоит вводить запрос напрямую в поисковике, а затем открывать официальную страницу и скачивать софт.

Скачивание и обновление OpenGL на сайте AMD

На сайте AMD предлагаются обновления отдельно для ОС Windows 7 и 10

Intel

На сайте центра загрузки компании Intel можно настроить автоматическое обновление драйверов, вручную искать программное обеспечение на нем неудобно. Поэтому в данном случае тоже можно вводить прямой запрос в поисковике по конкретной модели, чтобы не искать ее вручную на сайте. Правда, в этом случае выйдет страница поддержки, но особой разницы нет. Там точно так же будут указаны версии для конкретных операционных систем.

Загрузка драйверов и ПО OpenGL через официальный сайт компании Intel

Здесь предлагаются обновления драйверов на официальном сайте Intel

Скачивание драйверов и обновление OpenGL через Центр загрузки Intel

Доступно также скачивание с Центра загрузки компании, причем здесь есть фильтр по операционным системам

NVIDIA GeForce

На сайте NVIDIA поиск производится куда проще. Можно указать тип устройства, его серию, операционную систему, язык и даже вид драйвера. Есть еще вариант автоматического поиска, в котором сначала будет проведено сканирование, а уже затем при необходимости будет предложена оптимальная версия драйвера.

Как скачать OpenGL с обновлениями драйвера на видеокарту NVIDIA

Компания NVIDIA предусматривает два варианта загрузки с официального сайта

Диспетчер устройств

Еще один вариант, более упрощенный и доступный, особенно в Windows 10 – поискать обновления через «Диспетчер устройств». Открыть его можно, нажав на комбинацию клавиш Win + X и найдя в контекстном меню соответствующий пункт.

Как открыть «Диспетчер устройств», обновить драйверы видеокарты и версию OpenGL

Для начала я открою «Диспетчер устройств» через контекстное меню иконки «Пуск»

В новом окне открываю раздел «Видеоадаптеры», жму правой кнопкой мыши по нужному графическому процессу, затем выбираю пункт «Обновить драйвер». Система предложит установить их с компьютера или скачать онлайн. Во втором случае начнется поиск обновлений.

Как обновить драйверы и версию OpenGL через «Диспетчер устройств»

Жму правой кнопкой мыши по нужному видеоадаптеру и обновляю драйвера

Загрузка установщика из Интернета

Допустим еще вариант скачивания установщика OpenGL из сети Интернет. Правда, официального сайта в этом случае нет, поэтому данная процедура проводится на страх и риск пользователя. Если источники проверенные, можно скачать и установить приложение без особых колебаний и помех.

Заключение

Обычно OpenGL заранее бывает установлен в системе, вне зависимости от ее версии и новизны аппаратной части компьютера. Если в каких-то играх или программах требуется обновление данного ПО, можно для начала попробовать скачать и установить новую версию драйверов. После этого проблема обычно исчезает. Есть также вариант загрузки через «Диспетчер устройств» или инсталляция приложения, скачанного из сети Интернет. 

Post Views: 23 934

OpenGL

Знакомство с OpenGL нужно начать с того, что OpenGL — это спецификация. Т.е. OpenGL лишь определяет набор обязательных возможностей. Реализация же зависит от конкретной платформы.
OpenGL является кроссплатформенным, независимым от языка программирования API для работы с графикой. OpenGL — низкоуровневый API, поэтому для работы с ним неплохо иметь некоторое представление о графике в целом и знать основы линейной алгебры.

Именования

Скажем пару слов об именовании функций в OpenGL. Во-первых имена всех функций, предоставляемых непосредственно OpenGL, начинаются с приставки gl. Во-вторых функции, задающие некоторый параметр, характеризующийся набором чисел (например координату или цвет), имеют суффикс вида [число параметров + тип параметров + представление параметров].

  • Число параметров — указывает число принимаемых параметров. Принимает следующие значения: 1, 2, 3, 4
  • Тип параметров — указывает тип принимаемых параметров. Возможны следующие значения: b, s, i, f, d, ub, us, ui. Т.е. byte (char в C, 8-битное целое число), short (16-битное целое число), int (32-битное целое число), float (число с плавающей запятой), double (число с плавающей запятой двойной точности), unsigned byte, unsigned short, unsigned int (последние три — беззнаковые целые числа)
  • Представление параметров — указывает в каком виде передаются параметры, если каждое число по отдельности, то ничего не пишется, если же параметры передаются в виде массива, то к названию функции дописывается буква v

Пример: glVertex3iv задает координату вершины, состоящую из трех целых чисел, передаваемых в виде указателя на массив.

Графика

Все графические объекты в OpenGL представляют собой набор точек, линий и многоугольников. Существует 10 различных примитивов, при помощи которых строятся все объекты. Как двухмерные, так и трехмерные. Все примитивы в свою очередь задаются точками — вершинами.

  • GL_POINTS — каждая вершина задает точку
  • GL_LINES — каждая отдельная пара вершин задает линию
  • GL_LINE_STRIP — каждая пара вершин задает линию (т.е. конец предыдущей линии является началом следующей)
  • GL_LINE_LOOP — аналогично предыдущему за исключением того, что последняя вершина соединяется с первой и получается замкнутая фигура
  • GL_TRIANGLES — каждая отдельная тройка вершин задает треугольник
  • GL_TRIANGLE_STRIP — каждая следующая вершина задает треугольник вместе с двумя предыдущими (получается лента из треугольников)
  • GL_TRIANGLE_FAN — каждый треугольник задается первой вершиной и последующими парами (т.е. треугольники строятся вокруг первой вершины, образуя нечто похожее на диафрагму)
  • GL_QUADS — каждые четыре вершины образуют четырехугольник
  • GL_QUAD_STRIP — каждая следующая пара вершин образует четырехугольник вместе с парой предыдущих
  • GL_POLYGON — задает многоугольник с количеством углов равным количеству заданных вершин

Для задания примитива используется конструкция glBegin (тип_примитива)…glEnd (). Вершины задаются glVertex*. Вершины задаются против часовой стрелки. Координаты задаются от верхнего левого угла окна. Цвет вершины задается командой glColor*. Цвет задается в виде RGB или RGBA. Команда glColor* действует на все вершины, что идут после до тех пор, пока не встретится другая команда glColor* или же на все, если других команд glColor* нет.
Вот код рисующий квадрат с разноцветными вершинами:

  1. glBegin(GL_QUADS);
  2. glColor3f(1.0, 1.0, 1.0);
  3. glVertex2i(250, 450);
  4. glColor3f(0.0, 0.0, 1.0);
  5. glVertex2i(250, 150);
  6. glColor3f(0.0, 1.0, 0.0);
  7. glVertex2i(550, 150);
  8. glColor3f(1.0, 0.0, 0.0);
  9. glVertex2i(550, 450);
  10. glEnd();

Основы программы на OpenGL

Для платформонезависимой работы с окнами можно использовать библиотеку GLUT. GLUT упрощает работу с OpenGL.
Для инициализации GLUT в начале программы надо вызвать glutInit (&argc, argv). Для задания режима дисплея вызывается glutInitDisplayMode (режим), где режим может принимать следующие значения:

  • GLUT_RGBA — включает четырехкомпонентный цвет (используется по умолчанию)
  • GLUT_RGB — то же, что и GLUT_RGBA
  • GLUT_INDEX — включает индексированный цвет
  • GLUT_DOUBLE — включает двойной экранный буфер
  • GLUT_SINGLE — включает одиночный экранный буфер (по умолчанию)
  • GLUT_DEPTH — включает Z-буфер (буфер глубины)
  • GLUT_STENCIL — включает трафаретный буфер
  • GLUT_ACCUM — включает буфер накопления
  • GLUT_ALPHA — включает альфа-смешивание (прозрачность)
  • GLUT_MULTISAMPLE — включает мультисемплинг (сглаживание)
  • GLUT_STEREO — включает стерео-изображение

Для выбора нескольких режимов одновременно нужно использовать побитовое ИЛИ ‘|’. Например: glutInitDisplayMode (GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH) включает двойную буферизацию, Z-буфер и четырехкомпонентный цвет. Размеры окна задаются glutInitWindowSize (ширина, высота). Его позиция — glutInitWindowPosition (х, у). Создается окно функцией glutCreateWindow (заголовок_окна).
GLUT реализует событийно-управляемый механизм. Т.е. есть главный цикл, который запускается после инициализации, и в нем уже обрабатываются все объявленные события. Например нажатие клавиши на клавиатуре или движение курсора мыши и т.д. Зарегистрировать функции-обработчики событий можно при помощи следующих команд:

  • void glutDisplayFunc (void (*func) (void)) — задает функцию рисования изображения
  • void glutReshapeFunc (void (*func) (int width, int height)) — задает функцию обработки изменения размеров окна
  • void glutVisibilityFunc (void (*func)(int state)) — задает функцию обработки изменения состояния видимости окна
  • void glutKeyboardFunc (void (*func)(unsigned char key, int x, int y)) — задает функцию обработки нажатия клавиш клавиатуры (только тех, что генерируют ascii-символы)
  • void glutSpecialFunc (void (*func)(int key, int x, int y)) — задает функцию обработки нажатия клавиш клавиатуры (тех, что не генерируют ascii-символы)
  • void glutIdleFunc (void (*func) (void)) — задает функцию, вызываемую при отсутствии других событий
  • void glutMouseFunc (void (*func) (int button, int state, int x, int y)) — задает функцию, обрабатывающую команды мыши
  • void glutMotionFunc (void (*func)(int x, int y)) — задает функцию, обрабатывающую движение курсора мыши, когда зажата какая-либо кнопка мыши
  • void glutPassiveMotionFunc (void (*func)(int x, int y)) — задает функцию, обрабатывающую движение курсора мыши, когда не зажато ни одной кнопки мыши
  • void glutEntryFunc (void (*func)(int state)) — задает функцию, обрабатывающую движение курсора за пределы окна и его возвращение
  • void glutTimerFunc (unsigned int msecs, void (*func)(int value), value) — задает функцию, вызываемую по таймеру

Затем можно запускать главный цикл glutMainLoop ().

Первая программа

Теперь мы знаем основы работы с OpenGL. Можно написать простую программу для закрепления знаний.
Начнем с того, что нужно подключить заголовочный файл GLUT:

  1. #if defined(linux) || defined(_WIN32)
  2. #include <GL/glut.h>    /*Для Linux и Windows*/
  3. #else
  4. #include <GLUT/GLUT.h>  /*Для Mac OS*/
  5. #endif

Теперь мы уже знаем, что писать в main. Зарегистрируем два обработчика: для рисования содержимого окна и обработки изменения его размеров. Эти два обработчика по сути используются в любой программе, использующей OpenGL и GLUT.

  1. int main (int argc, char * argv[])
  2. {
  3.         glutInit(&argc, argv);
  4.         glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA); /*Включаем двойную буферизацию и четырехкомпонентный цвет*/
  5.        
  6.         glutInitWindowSize(800, 600);
  7.         glutCreateWindow(«OpenGL lesson 1»);
  8.        
  9.         glutReshapeFunc(reshape);
  10.         glutDisplayFunc(display);
  11.        
  12.         glutMainLoop();
  13.  
  14.         return 0;
  15. }

Теперь надо написать функцию-обработчик изменений размеров окна. Зададим область вывода изображения размером со все окно при помощи команды glViewport (х, у, ширина, высота). Затем загрузим матрицу проекции glMatrixMode (GL_PROJECTION), заменим ее единичной glLoadIdentity () и установим ортогональную проекцию. И наконец загрузим модельно-видовую матрицу glMatrixMode (GL_MODELVIEW) и заменим ее единичной.
В итоге получим:

  1. void reshape(int w, int h)
  2. {
  3.         glViewport(0, 0, w, h);
  4.        
  5.         glMatrixMode(GL_PROJECTION);
  6.         glLoadIdentity();
  7.         gluOrtho2D(0, w, 0, h);
  8.        
  9.         glMatrixMode(GL_MODELVIEW);
  10.         glLoadIdentity();
  11. }

Осталось только написать функцию рисования содержимого окна. Рисовать будем тот квадрат, что я приводил выше в качестве примера. Добавить придется совсем немного кода. Во-первых перед рисованием надо очистить различные буфера при помощи glClear (режим). Используется также как и glutInitDisplayMode. Возможные значения:

  • GL_COLOR_BUFFER_BIT — для очистки буфера цвета
  • GL_DEPTH_BUFFER_BIT — для очистки буфера глубины
  • GL_ACCUM_BUFFER_BIT — для очистки буфера накопления
  • GL_STENCIL_BUFFER_BIT — для очистки трафаретного буфера

В нашем случае нужно очистить только буфер цвета, т.к. другие мы не используем. Во-вторых после рисования нужно попросить OpenGL сменить экранные буфера при помощи glutSwapBuffers (), ведь у нас включена двойная буферизация. Все рисуется на скрытом от пользователя буфере и затем происходит смена буферов. Делается это для получения плавной анимации и для того, чтобы не было эффекта мерцания экрана.
Получаем:

  1. void display()
  2. {
  3.         glClear(GL_COLOR_BUFFER_BIT);
  4.        
  5.         glBegin(GL_QUADS);
  6.         glColor3f(1.0, 1.0, 1.0);
  7.         glVertex2i(250, 450);
  8.         glColor3f(0.0, 0.0, 1.0);
  9.         glVertex2i(250, 150);
  10.         glColor3f(0.0, 1.0, 0.0);
  11.         glVertex2i(550, 150);
  12.         glColor3f(1.0, 0.0, 0.0);
  13.         glVertex2i(550, 450);
  14.         glEnd();
  15.        
  16.         glutSwapBuffers();
  17. }

Итог

Все! Можно компилировать. Должно получиться что-то вроде этого:
screen
Весь код целиком (для кто не осилил статью).
В принципе ничего сложного в этом нет, по крайней мере если вы уже сталкивались с графикой до этого.

OpenGL — удобный инструмент для создания кроссплатформенных приложений, использующий графику. OpenGL легко использовать с тем языком программирования, который вам более удобен. Привязки к OpenGL есть для множества популярных языков, таких как C, C++, C#, Java, Python, Perl, VB и других. Посмотреть информацию о них можно на официальном сайте OpenGL.

Not to be confused with OpenCL.

OpenGL

OpenGL logo.svg
Linux kernel and OpenGL video games.svg

Video games outsource real-time rendering calculations to the GPU over OpenGL. The rendered results are not sent back to main memory, but to the framebuffer of video memory instead. The display controller will then send this data to the display device.

Original author(s) Silicon Graphics
Developer(s) Khronos Group
(formerly ARB)
Initial release June 30, 1992; 30 years ago
Stable release

4.6
/ July 31, 2017; 5 years ago

Written in C[1]
Successor Vulkan
Type 3D graphics API
License
  • Open source license for use of the S.I.[clarification needed]: This is a Free Software License B closely modeled on BSD, X, and Mozilla licenses.
  • Trademark license for new licensees who want to use the OpenGL trademark and logo and claim conformance.[2]
Website opengl.org

OpenGL (Open Graphics Library[3]) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

Silicon Graphics, Inc. (SGI) began developing OpenGL in 1991 and released it on June 30, 1992;[4][5] applications use it extensively in the fields of computer-aided design (CAD), virtual reality, scientific visualization, information visualization, flight simulation, and video games. Since 2006, OpenGL has been managed by the non-profit technology consortium Khronos Group.[6]

Design[edit]

An illustration of the graphics pipeline process

The OpenGL specification describes an abstract API for drawing 2D and 3D graphics. Although it is possible for the API to be implemented entirely in software, it is designed to be implemented mostly or entirely in hardware.

The API is defined as a set of functions which may be called by the client program, alongside a set of named integer constants (for example, the constant GL_TEXTURE_2D, which corresponds to the decimal number 3553). Although the function definitions are superficially similar to those of the programming language C, they are language-independent. As such, OpenGL has many language bindings, some of the most noteworthy being the JavaScript binding WebGL (API, based on OpenGL ES 2.0, for 3D rendering from within a web browser); the C bindings WGL, GLX and CGL; the C binding provided by iOS; and the Java and C bindings provided by Android.

In addition to being language-independent, OpenGL is also cross-platform. The specification says nothing on the subject of obtaining and managing an OpenGL context, leaving this as a detail of the underlying windowing system. For the same reason, OpenGL is purely concerned with rendering, providing no APIs related to input, audio, or windowing.

Development[edit]

OpenGL is no longer in active development: whereas between 2001 and 2014 OpenGL specification was updated mostly on a yearly basis, with two releases (3.1 and 3.2) taking place in 2009 and three (3.3, 4.0 and 4.1) in 2010, the latest OpenGL specification 4.6 was released in 2017 after a three-year break and was limited to inclusion of eleven existing ARB and EXT extensions into the core profile.[7]

Active development of OpenGL was dropped in favor of Vulkan API released in 2016 and codenamed glNext during initial development. In 2017, Khronos Group announced that OpenGL ES will not have new versions[8] and has since concentrated on development of Vulkan and other technologies.[9][10] As a result, certain capabilities offered by modern GPUs, e.g. ray tracing, are not supported by OpenGL.

New versions of the OpenGL specifications are released by the Khronos Group, each of which extends the API to support various new features. The details of each version are decided by consensus between the Group’s members, including graphics card manufacturers, operating system designers, and general technology companies such as Mozilla and Google.[11]

In addition to the features required by the core API, graphics processing unit (GPU) vendors may provide additional functionality in the form of extensions. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Vendors can use extensions to expose custom APIs without needing support from other vendors or the Khronos Group as a whole, which greatly increases the flexibility of OpenGL. All extensions are collected in, and defined by, the OpenGL Registry.[12]

Each extension is associated with a short identifier, based on the name of the company which developed it. For example, Nvidia’s identifier is NV, which is part of the extension name GL_NV_half_float, the constant GL_HALF_FLOAT_NV, and the function glVertex2hNV().[13] If multiple vendors agree to implement the same functionality using the same API, a shared extension may be released, using the identifier EXT. In such cases, it could also happen that the Khronos Group’s Architecture Review Board gives the extension their explicit approval, in which case the identifier ARB is used.[14]

The features introduced by each new version of OpenGL are typically formed from the combined features of several widely implemented extensions, especially extensions of type ARB or EXT.

Documentation[edit]

The OpenGL Architecture Review Board released a series of manuals along with the specification which have been updated to track changes in the API. These are commonly referred to by the colors of their covers:

The Red Book
OpenGL Programming Guide, 9th Edition. ISBN 978-0-134-49549-1
The Official Guide to Learning OpenGL, Version 4.5 with SPIR-V
The Orange Book
OpenGL Shading Language, 3rd edition. ISBN 0-321-63763-1
A tutorial and reference book for GLSL.

Historic books (pre-OpenGL 2.0):

The Green Book
OpenGL Programming for the X Window System. ISBN 978-0-201-48359-8
A book about X11 interfacing and OpenGL Utility Toolkit (GLUT).
The Blue Book
OpenGL Reference manual, 4th edition. ISBN 0-321-17383-X
Essentially a hard-copy printout of the Unix manual (man) pages for OpenGL.
Includes a poster-sized fold-out diagram showing the structure of an idealised OpenGL implementation.
The Alpha Book (white cover)
OpenGL Programming for Windows 95 and Windows NT. ISBN 0-201-40709-4
A book about interfacing OpenGL with Microsoft Windows.

OpenGL’s documentation is also accessible via its official webpage.[15]

Associated libraries[edit]

The earliest versions of OpenGL were released with a companion library called the OpenGL Utility Library (GLU). It provided simple, useful features which were unlikely to be supported in contemporary hardware, such as tessellating, and generating mipmaps and primitive shapes. The GLU specification was last updated in 1998 and depends on OpenGL features which are now deprecated.

Context and window toolkits[edit]

Given that creating an OpenGL context is quite a complex process, and given that it varies between operating systems, automatic OpenGL context creation has become a common feature of several game-development and user-interface libraries, including SDL, Allegro, SFML, FLTK, and Qt. A few libraries have been designed solely to produce an OpenGL-capable window. The first such library was OpenGL Utility Toolkit (GLUT), later superseded by freeglut. GLFW is a newer alternative.[16]

  • These toolkits are designed to create and manage OpenGL windows, and manage input, but little beyond that.[17]
  • GLFW – A cross-platform windowing and keyboard-mouse-joystick handler; is more game-oriented
  • freeglut – A cross-platform windowing and keyboard-mouse handler; its API is a superset of the GLUT API, and it is more stable and up to date than GLUT
  • OpenGL Utility Toolkit (GLUT) – An old windowing handler, no longer maintained.
  • Several «multimedia libraries» can create OpenGL windows, in addition to input, sound and other tasks useful for game-like applications
  • Allegro 5 – A cross-platform multimedia library with a C API focused on game development
  • Simple DirectMedia Layer (SDL) – A cross-platform multimedia library with a C API
  • SFML – A cross-platform multimedia library with a C++ API and multiple other bindings to languages such as C#, Java, Haskell, and Go
  • Widget toolkits
  • FLTK – A small cross-platform C++ widget library
  • Qt – A cross-platform C++ widget toolkit. It provides many OpenGL helper objects, which even abstract away the difference between desktop GL and OpenGL ES
  • wxWidgets – A cross-platform C++ widget toolkit

Extension loading libraries[edit]

Given the high workload involved in identifying and loading OpenGL extensions, a few libraries have been designed which load all available extensions and functions automatically. Examples include OpenGL Easy Extension library (GLEE), OpenGL Extension Wrangler Library (GLEW) and glbinding. Extensions are also loaded automatically by most language bindings, such as JOGL and PyOpenGL.

Implementations[edit]

Screenshot of glxinfo, showing information of Mesa implementation of OpenGL on a system

Mesa 3D is an open-source implementation of OpenGL. It can do pure software rendering, and it may also use hardware acceleration on BSD, Linux, and other platforms by taking advantage of the Direct Rendering Infrastructure. As of version 20.0, it implements version 4.6 of the OpenGL standard.

History[edit]

In the 1980s, developing software that could function with a wide range of graphics hardware was a real challenge. Software developers wrote custom interfaces and drivers for each piece of hardware. This was expensive and resulted in multiplication of effort.

By the early 1990s, Silicon Graphics (SGI) was a leader in 3D graphics for workstations. Their IRIS GL API[18][19] became the industry standard, used more widely than the open standards-based PHIGS.[citation needed] This was because IRIS GL was considered easier to use,[by whom?] and because it supported immediate mode rendering. By contrast, PHIGS was considered difficult to use and outdated in functionality.

SGI’s competitors (including Sun Microsystems, Hewlett-Packard and IBM) were also able to bring to market 3D hardware supported by extensions made to the PHIGS standard, which pressured SGI to open source a version of IRIS GL as a public standard called OpenGL.

However, SGI had many customers for whom the change from IRIS GL to OpenGL would demand significant investment. Moreover, IRIS GL had API functions that were irrelevant to 3D graphics. For example, it included a windowing, keyboard and mouse API, in part because it was developed before the X Window System and Sun’s NeWS. And, IRIS GL libraries were unsuitable for opening due to licensing and patent issues[further explanation needed]. These factors required SGI to continue to support the advanced and proprietary Iris Inventor and Iris Performer programming APIs while market support for OpenGL matured.

One of the restrictions of IRIS GL was that it only provided access to features supported by the underlying hardware. If the graphics hardware did not support a feature natively, then the application could not use it. OpenGL overcame this problem by providing software implementations of features unsupported by hardware, allowing applications to use advanced graphics on relatively low-powered systems. OpenGL standardized access to hardware, pushed the development responsibility of hardware interface programs (device drivers) to hardware manufacturers, and delegated windowing functions to the underlying operating system. With so many different kinds of graphics hardware, getting them all to speak the same language in this way had a remarkable impact by giving software developers a higher-level platform for 3D-software development.

In 1992,[20] SGI led the creation of the OpenGL Architecture Review Board (OpenGL ARB), the group of companies that would maintain and expand the OpenGL specification in the future.

In 1994, SGI played with the idea of releasing something called «OpenGL++» which included elements such as a scene-graph API (presumably based on their Performer technology). The specification was circulated among a few interested parties – but never turned into a product.[21]

In 1996, Microsoft released Direct3D, which eventually became the main competitor of OpenGL. Over 50 game developers signed an open letter to Microsoft, released on June 12, 1997, calling on the company to actively support OpenGL.[22] On December 17, 1997,[23] Microsoft and SGI initiated the Fahrenheit project, which was a joint effort with the goal of unifying the OpenGL and Direct3D interfaces (and adding a scene-graph API too). In 1998, Hewlett-Packard joined the project.[24] It initially showed some promise of bringing order to the world of interactive 3D computer graphics APIs, but on account of financial constraints at SGI, strategic reasons at Microsoft, and a general lack of industry support, it was abandoned in 1999.[25]

In July 2006, the OpenGL Architecture Review Board voted to transfer control of the OpenGL API standard to the Khronos Group.[26][27]

Industry support[edit]

[icon]

This section needs expansion with: more historical background when support was being added. You can help by adding to it. (January 2023)

In June 2018, Apple deprecated OpenGL APIs on all of their platforms (iOS, macOS and tvOS), strongly encouraging developers to use their proprietary Metal API, which was introduced in 2014.[28]

id Software supported OpenGL in subsequent versions of id Tech game engines starting with the 1996 Quake II engine.[29] In 2016, they released an update for the id Tech 6 that added support for Vulkan, a succesor to OpenGL. ID Tech 7 eliminated support for OpenGL.[30]

Version history[edit]

The first version of OpenGL, version 1.0, was released on June 30, 1992, by Mark Segal and Kurt Akeley. Since then, OpenGL has occasionally been extended by releasing a new version of the specification. Such releases define a baseline set of features which all conforming graphics cards must support, and against which new extensions can more easily be written. Each new version of OpenGL tends to incorporate several extensions which have widespread support among graphics-card vendors, although the details of those extensions may be changed.

OpenGL version history

Version Release Date Features
1.1 1995[citation needed] Texture objects, Vertex Arrays
1.2 March 16, 1998 3D textures, BGRA and packed pixel formats,[31] introduction of the imaging subset useful to image-processing applications
1.2.1 October 14, 1998 A concept of ARB extensions
1.3 August 14, 2001 Multitexturing, multisampling, texture compression
1.4 July 24, 2002 Depth textures, GLSlang[32]
1.5 July 29, 2003 Vertex Buffer Object (VBO), Occlusion Queries[33]
2.0 September 7, 2004 GLSL 1.1, MRT, Non Power of Two textures, Point Sprites,[34] Two-sided stencil[33]
2.1 July 2, 2006 GLSL 1.2, Pixel Buffer Object (PBO), sRGB Textures[33]
3.0 August 11, 2008 GLSL 1.3, Texture Arrays, Conditional rendering, Frame Buffer Object (FBO)[35]
3.1 March 24, 2009 GLSL 1.4, Instancing, Texture Buffer Object, Uniform Buffer Object, Primitive restart[36]
3.2 August 3, 2009 GLSL 1.5, Geometry Shader, Multi-sampled textures[37]
3.3 March 11, 2010 GLSL 3.30, Backports as much function as possible from the OpenGL 4.0 specification
4.0 March 11, 2010 GLSL 4.00, Tessellation on GPU, shaders with 64-bit precision[38]
4.1 July 26, 2010 GLSL 4.10, Developer-friendly debug outputs, compatibility with OpenGL ES 2.0[39]
4.2 August 8, 2011[40] GLSL 4.20, Shaders with atomic counters, draw transform feedback instanced, shader packing, performance improvements
4.3 August 6, 2012[41] GLSL 4.30, Compute shaders leveraging GPU parallelism, shader storage buffer objects, high-quality ETC2/EAC texture compression, increased memory security, a multi-application robustness extension, compatibility with OpenGL ES 3.0[42]
4.4 July 22, 2013[43] GLSL 4.40, Buffer Placement Control, Efficient Asynchronous Queries, Shader Variable Layout, Efficient Multiple Object Binding, Streamlined Porting of Direct3D applications, Bindless Texture Extension, Sparse Texture Extension[43]
4.5 August 11, 2014[12][44] GLSL 4.50, Direct State Access (DSA), Flush Control, Robustness, OpenGL ES 3.1 API and shader compatibility, DX11 emulation features
4.6 July 31, 2017[7][45] GLSL 4.60, More efficient geometry processing and shader execution, more information, no error context, polygon offset clamp, SPIR-V, anisotropic filtering

OpenGL 2.0[edit]

Release date: September 7, 2004

OpenGL 2.0 was originally conceived by 3Dlabs to address concerns that OpenGL was stagnating and lacked a strong direction.[46] 3Dlabs proposed a number of major additions to the standard. Most of these were, at the time, rejected by the ARB or otherwise never came to fruition in the form that 3Dlabs proposed. However, their proposal for a C-style shading language was eventually completed, resulting in the current formulation of the OpenGL Shading Language (GLSL or GLslang). Like the assembly-like shading languages it was replacing, it allowed replacing the fixed-function vertex and fragment pipe with shaders, though this time written in a C-like high-level language.

The design of GLSL was notable for making relatively few concessions to the limits of the hardware then available. This harked back to the earlier tradition of OpenGL setting an ambitious, forward-looking target for 3D accelerators rather than merely tracking the state of currently available hardware. The final OpenGL 2.0 specification[47] includes support for GLSL.

Longs Peak and OpenGL 3.0[edit]

Before the release of OpenGL 3.0, the new revision had the codename Longs Peak. At the time of its original announcement, Longs Peak was presented as the first major API revision in OpenGL’s lifetime. It consisted of an overhaul to the way that OpenGL works, calling for fundamental changes to the API.

The draft introduced a change to object management. The GL 2.1 object model was built upon the state-based design of OpenGL. That is, to modify an object or to use it, one needs to bind the object to the state system, then make modifications to the state or perform function calls that use the bound object.

Because of OpenGL’s use of a state system, objects must be mutable. That is, the basic structure of an object can change at any time, even if the rendering pipeline is asynchronously using that object. A texture object can be redefined from 2D to 3D. This requires any OpenGL implementations to add a degree of complexity to internal object management.

Under the Longs Peak API, object creation would become atomic, using templates to define the properties of an object which would be created with one function call. The object could then be used immediately across multiple threads. Objects would also be immutable; however, they could have their contents changed and updated. For example, a texture could change its image, but its size and format could not be changed.

To support backwards compatibility, the old state based API would still be available, but no new functionality would be exposed via the old API in later versions of OpenGL. This would have allowed legacy code bases, such as the majority of CAD products, to continue to run while other software could be written against or ported to the new API.

Longs Peak was initially due to be finalized in September 2007 under the name OpenGL 3.0, but the Khronos Group announced on October 30 that it had run into several issues that it wished to address before releasing the specification.[48] As a result, the spec was delayed, and the Khronos Group went into a media blackout until the release of the final OpenGL 3.0 spec.

The final specification proved far less revolutionary than the Longs Peak proposal. Instead of removing all immediate mode and fixed functionality (non-shader mode), the spec included them as deprecated features. The proposed object model was not included, and no plans have been announced to include it in any future revisions. As a result, the API remained largely the same with a few existing extensions being promoted to core functionality.

Among some developer groups this decision caused something of an uproar,[49] with many developers professing that they would switch to DirectX in protest. Most complaints revolved around the lack of communication by Khronos to the development community and multiple features being discarded that were viewed favorably by many. Other frustrations included the requirement of DirectX 10 level hardware to use OpenGL 3.0 and the absence of geometry shaders and instanced rendering as core features.

Other sources reported that the community reaction was not quite as severe as originally presented,[50] with many vendors showing support for the update.[51][52]

OpenGL 3.0[edit]

Release date: August 11, 2008

OpenGL 3.0 introduced a deprecation mechanism to simplify future revisions of the API. Certain features, marked as deprecated, could be completely disabled by requesting a forward-compatible context from the windowing system. OpenGL 3.0 features could still be accessed alongside these deprecated features, however, by requesting a full context.

Deprecated features include:

  • All fixed-function vertex and fragment processing
  • Direct-mode rendering, using glBegin and glEnd
  • Display lists
  • Indexed-color rendering targets
  • OpenGL Shading Language versions 1.10 and 1.20

OpenGL 3.1[edit]

Release date: March 24, 2009

OpenGL 3.1 fully removed all of the features which were deprecated in version 3.0, with the exception of wide lines. From this version onwards, it’s not possible to access new features using a full context, or to access deprecated features using a forward-compatible context. An exception to the former rule is made if the implementation supports the ARB_compatibility extension, but this is not guaranteed.

Hardware: Mesa supports ARM Panfrost with Version 21.0.

OpenGL 3.2[edit]

Release date: August 3, 2009

OpenGL 3.2 further built on the deprecation mechanisms introduced by OpenGL 3.0, by dividing the specification into a core profile and compatibility profile. Compatibility contexts include the previously-removed fixed-function APIs, equivalent to the ARB_compatibility extension released alongside OpenGL 3.1, while core contexts do not. OpenGL 3.2 also included an upgrade to GLSL version 1.50.

OpenGL 3.3[edit]

Release date: March 11, 2010

Mesa supports software Driver SWR, softpipe and for older Nvidia cards with NV50.

OpenGL 4.0[edit]

Release date: March 11, 2010

OpenGL 4.0 was released alongside version 3.3. It was designed for hardware able to support Direct3D 11.

As in OpenGL 3.0, this version of OpenGL contains a high number of fairly inconsequential extensions, designed to thoroughly expose the abilities of Direct3D 11-class hardware. Only the most influential extensions are listed below.

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Ivy Bridge processors and newer.[53]

OpenGL 4.1[edit]

Release date: July 26, 2010

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Ivy Bridge processors and newer.[53]

  • Minimum «maximum texture size» is 16,384 × 16,384 for GPU’s implementing this specification.[54]

OpenGL 4.2[edit]

Release date: August 8, 2011[40]

  • Support for shaders with atomic counters and load-store-atomic read-modify-write operations to one level of a texture
  • Drawing multiple instances of data captured from GPU vertex processing (including tessellation), to enable complex objects to be efficiently repositioned and replicated
  • Support for modifying an arbitrary subset of a compressed texture, without having to re-download the whole texture to the GPU for significant performance improvements

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), and Intel HD Graphics in Intel Haswell processors and newer.[53] (Linux Mesa: Ivy Bridge and newer)

OpenGL 4.3[edit]

Release date: August 6, 2012[41]

  • Compute shaders leveraging GPU parallelism within the context of the graphics pipeline
  • Shader storage buffer objects, allowing shaders to read and write buffer objects like image load/store from 4.2, but through the language rather than function calls.
  • Image format parameter queries
  • ETC2/EAC texture compression as a standard feature
  • Full compatibility with OpenGL ES 3.0 APIs
  • Debug abilities to receive debugging messages during application development
  • Texture views to interpret textures in different ways without data replication
  • Increased memory security and multi-application robustness

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Haswell processors and newer.[53] (Linux Mesa: Ivy Bridge without stencil texturing, Haswell and newer), Nvidia GeForce 400 series and newer. VIRGL Emulation for virtual machines supports 4.3+ with Mesa 20.

OpenGL 4.4[edit]

Release date: July 22, 2013[43]

  • Enforced buffer object usage controls
  • Asynchronous queries into buffer objects
  • Expression of more layout controls of interface variables in shaders
  • Efficient binding of multiple objects simultaneously

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Broadwell processors and newer (Linux Mesa: Haswell and newer),[55] Nvidia GeForce 400 series and newer,[56] Tegra K1.

OpenGL 4.5[edit]

Release date: August 11, 2014[12][44]

  • Direct State Access (DSA) – object accessors enable state to be queried and modified without binding objects to contexts, for increased application and middleware efficiency and flexibility.[57]
  • Flush Control – applications can control flushing of pending commands before context switching – enabling high-performance multithreaded applications;
  • Robustness – providing a secure platform for applications such as WebGL browsers, including preventing a GPU reset affecting any other running applications;
  • OpenGL ES 3.1 API and shader compatibility – to enable the easy development and execution of the latest OpenGL ES applications on desktop systems.

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Broadwell processors and newer (Linux Mesa: Haswell and newer), Nvidia GeForce 400 series and newer,[56] Tegra K1, and Tegra X1.[58][59]

OpenGL 4.6[edit]

Release date: July 31, 2017[12][7][45]

  • more efficient, GPU-sided, geometry processing
  • more efficient shader execution (AZDO)
  • more information through statistics, overflow query and counters
  • higher performance through no error handling contexts
  • clamping of polygon offset function, solves a shadow rendering problem
  • SPIR-V shaders
  • Improved anisotropic filtering

Hardware support: AMD Radeon HD 7000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel Haswell and newer, Nvidia GeForce 400 series and newer.[56]

Driver support:

  • Mesa 19.2 on Linux supports OpenGL 4.6 for Intel Broadwell and newer.[60] Mesa 20.0 supports AMD Radeon GPUs,[61] while support for Nvidia Kepler+ is in progress. Zink as Emulation Driver with 21.1 and software driver LLVMpipe also support with Mesa 21.0.
  • AMD Adrenalin 18.4.1 Graphics Driver on Windows 7 SP1, 10 version 1803 (April 2018 update) for AMD Radeon™ HD 7700+, HD 8500+ and newer. Released April 2018.[62][63]
  • Intel 26.20.100.6861 graphics driver on Windows 10. Released May 2019.[64][65]
  • NVIDIA GeForce 397.31 Graphics Driver on Windows 7, 8, 10 x86-64 bit only, no 32-bit support. Released April 2018[66]

Alternative implementations[edit]

Apple deprecated OpenGL in iOS 12 and macOS 10.14 Mojave in favor of Metal, but it is still available as of macOS 13 Ventura (including Apple silicon devices).[67] The latest version supported for OpenGL is 4.1 from 2011.[68][69] A proprietary library from Molten – authors of MoltenVK – called MoltenGL, can translate OpenGL calls to Metal.[70]

There are several projects which attempt to implement OpenGL on top of Vulkan. The Vulkan backend for Google’s ANGLE achieved OpenGL ES 3.1 conformance in July 2020.[71] The Mesa3D project also includes such a driver, called Zink.[72]

Vulkan[edit]

Vulkan, formerly named the «Next Generation OpenGL Initiative» (glNext),[73][74] is a grounds-up redesign effort to unify OpenGL and OpenGL ES into one common API that will not be backwards compatible with existing OpenGL versions.[75][76][77]

The initial version of Vulkan API was released on February 16, 2016.

See also[edit]

  • ARB assembly language – OpenGL’s legacy low-level shading language
  • Comparison of OpenGL and Direct3D
  • Direct3D – main competitor of OpenGL
  • Glide (API) – a graphics API once used on 3dfx Voodoo cards
  • List of OpenGL applications
  • Metal (API) – a graphics API for iOS, macOS, tvOS, watchOS
  • OpenAL – cross-platform audio library, designed to resemble OpenGL
  • OpenGL ES – OpenGL for embedded systems
  • OpenSL ES – API for audio on embedded systems, developed by the Khronos Group
  • OpenVG – API for accelerated 2D graphics, developed by the Khronos Group
  • RenderMan Interface Specification (RISpec) – Pixar’s open API for photorealistic off-line rendering
  • VOGL – a debugger for OpenGL
  • Vulkan – low-overhead, cross-platform 2D and 3D graphics API, the «next generation OpenGL initiative»
  • Graphics pipeline
  • WebGPU

References[edit]

  1. ^
  2. ^ «Products: Software: OpenGL: Licensing and Logos». SGI. Archived from the original on November 1, 2012. Retrieved November 7, 2012.
  3. ^ «The OpenGL Graphics System: A Specification» (PDF). 4.0 (Core Profile). March 11, 2010.
  4. ^ «SGI – OpenGL Overview». Archived from the original on October 31, 2004. Retrieved February 16, 2007.
  5. ^ Peddie, Jon (July 2012). «Who’s the Fairest of Them All?». Computer Graphics World. Retrieved May 30, 2018.
  6. ^ «OpenGL ARB to Pass Control of OpenGL Specification to Khronos Group». The Khronos Group. July 31, 2006. Retrieved March 18, 2021.
  7. ^ a b c «Khronos Releases OpenGL 4.6 with SPIR-V Support». The Khronos Group Inc. July 31, 2017. Retrieved July 31, 2017.
  8. ^ «The Future of OpenGL (forum discussion)». Khronos Group. 2020.
  9. ^ «Khronos News Archives». Khronos Group. November 28, 2022.
  10. ^ «Khronos Blog». Khronos Group. November 28, 2022.
  11. ^ «Khronos Membership Overview and FAQ». Khronos.org. Retrieved November 7, 2012.
  12. ^ a b c d «Khronos OpenGL Registry». Khronos Group. Retrieved July 31, 2017.
  13. ^ «NV_half_float». OpenGL Registry. Khronos Group.
  14. ^ «How to Create Khronos API Extensions». Khronos Group. Retrieved July 31, 2017.
  15. ^ «OpenGL — The Industry’s Foundation for High Performance Graphics». The Khronos Group. July 19, 2011. Retrieved March 18, 2021.
  16. ^ «A list of GLUT alternatives, maintained by». Khronos Group. Retrieved May 2, 2013.
  17. ^ «Related toolkits and APIs». www.opengl.org. OpenGL. Retrieved October 8, 2014.
  18. ^ «IRIS GL, SGI’s property».
  19. ^ Kilgard, Mark (2008). «OpenGL Prehistory: IRIS GL (slide)». www.slideshare.net.
  20. ^ «Creation of the OpenGL ARB». Archived from the original on February 22, 2007. Retrieved February 16, 2007.
  21. ^ «End of OpenGL++». Khronos Group.
  22. ^ «Top Game Developers Call on Microsoft to Actively Support OpenGL». Next Generation. No. 32. Imagine Media. August 1997. p. 17.
  23. ^ «Announcement of Fahrenheit». Archived from the original on September 27, 2007.
  24. ^ «Members of Fahrenheit. 1998». Computergram International. 1998. Archived from the original on October 5, 2007.
  25. ^ «End of Fahrenheit». The Register.
  26. ^ «OpenGL ARB to pass control of OpenGL specification to Khronos Group». Khronos press release. July 31, 2006.
  27. ^ «OpenGL ARB to Pass Control of OpenGL Specification to Khronos Group». AccessMyLibrary Archive.
  28. ^ Smith, Ryan (June 5, 2018). «Apple Deprecates OpenGL Across All OSes; Urges Developers to use Metal». www.anandtech.com. Purch. Retrieved June 5, 2018.
  29. ^ «Technology Licensing: id Tech 2». Archived from the original on November 8, 2009. Retrieved September 17, 2008.
  30. ^ «Doom Wiki: id Tech 7». Retrieved October 26, 2021.
  31. ^ Astle, Dave (April 1, 2003). «Moving Beyond OpenGL 1.1 for Windows». gamedev.net. Retrieved November 15, 2007.
  32. ^ Isorna, J.M. (2015). Simulación visual de materiales : teoría, técnicas, análisis de casos. UPC Grau. Arquitectura, urbanisme i edificació (in Spanish). Universitat Politècnica de Catalunya. p. 191. ISBN 978-84-9880-564-2. Retrieved August 21, 2019.
  33. ^ a b c «The OpenGL Graphics System: A Specification» (PDF). 2.1. December 1, 2006.
  34. ^ «Point Primitive».
  35. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.0. September 23, 2008.
  36. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.1. May 28, 2009.
  37. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.2 (Core Profile). December 7, 2009.
  38. ^ «Khronos Unleashes Cutting-Edge, Cross-Platform Graphics Acceleration with OpenGL 4.0». March 11, 2010.
  39. ^ «Khronos Drives Evolution of Cross-Platform 3D Graphics with Release of OpenGL 4.1 Specification». July 26, 2010.
  40. ^ a b «Khronos Enriches Cross-Platform 3D Graphics with Release of OpenGL 4.2 Specification». August 8, 2011.
  41. ^ a b «Khronos Releases OpenGL 4.3 Specification with Major Enhancements». August 6, 2012.
  42. ^ «Khronos Releases OpenGL 4.3 Specification with Major Enhancements». August 6, 2012.
  43. ^ a b c «Khronos Releases OpenGL 4.4 Specification». July 22, 2013.
  44. ^ a b «Khronos Group Announces Key Advances in OpenGL Ecosystem – Khronos Group Press Release». The Khronos Group Inc. August 10, 2014. Retrieved April 17, 2015.
  45. ^ a b Kessenich, John; Baldwin, Dave. «The OpenGL® Shading Language, Version 4.60.7». The Khronos Group Inc. Retrieved August 21, 2019.
  46. ^ Abi-Chahla, Fedy (September 16, 2008). «OpenGL 3 (3DLabs And The Evolution Of OpenGL)». Tom’s Hardware. Retrieved October 24, 2010.
  47. ^ «The OpenGL Graphics System: A Specification» (PDF). 2.0. October 22, 2004.
  48. ^ «OpenGL ARB announces an update on OpenGL 3.0». October 30, 2007. Retrieved October 31, 2007.
  49. ^ «OpenGL 3.0 Released, Developers Furious – Slashdot». Tech.slashdot.org. Retrieved November 7, 2012.
  50. ^ «OpenGL BOF went over well, no pitch forks seen».
  51. ^ «The Industry Standard for High Performance Graphics». OpenGL. August 18, 2008. Retrieved July 31, 2017.
  52. ^ «NVIDIA provides early OpenGL 3.0 driver now».
  53. ^ a b c d «Intel Iris and HD Graphics Driver for Windows 7/8/8.1 64bit». Intel Download Center. Archived from the original on April 2, 2015.
  54. ^ «Expected maximum texture size — Graphics and GPU Programming». GameDev.net.
  55. ^ «Intel Skylake-S CPUs and 100-series Chipsets Detailed in Apparent Leak». NDTV Gadgets. April 17, 2015.
  56. ^ a b c Larabel, Michael (July 31, 2017). «NVIDIA Releases 381.26.11 Linux Driver With OpenGL 4.6 Support». Phoronix.
  57. ^ «OpenGL 4.5 released—with one of Direct3D’s best features». Ars Technica. August 11, 2014. Retrieved April 17, 2015.
  58. ^ «SG4121: OpenGL Update for NVIDIA GPUs». Ustream. Archived from the original on May 17, 2015. Retrieved April 17, 2015.
  59. ^ Kilgard, Mark (August 12, 2014). «OpenGL 4.5 Update for NVIDIA GPUs». Retrieved April 17, 2015.
  60. ^ Larabel, Michael (August 21, 2019). «Intel’s OpenGL Linux Driver Now Has OpenGL 4.6 Support For Mesa 19.2». Phoronix.
  61. ^ Larabel, Michael (November 27, 2019). «AMD’s RadeonSI Driver Finally Enables OpenGL 4.6». Phoronix.
  62. ^ «AMD Adrenalin 18.4.1 Graphics Driver Released (OpenGL 4.6, Vulkan 1.1.70) – Geeks3D». www.geeks3d.com. Retrieved May 10, 2018.
  63. ^ «Radeon™ Software Adrenalin Edition 18.4.1 Release Notes». support.amd.com. Retrieved May 10, 2018.
  64. ^ «Intel Graphics Driver 25.20.100.6861 Released (OpenGL 4.6 + Vulkan 1.1.103) | Geeks3D». Retrieved May 16, 2019.
  65. ^ «Windows® 10 DCH Drivers». Intel DownloadCenter. Retrieved August 21, 2019.
  66. ^ «NVIDIA GeForce 397.31 Graphics Driver Released (OpenGL 4.6, Vulkan 1.1, RTX, CUDA 9.2) – Geeks3D». www.geeks3d.com. Retrieved May 10, 2018.
  67. ^ «Apple Developer Documentation». developer.apple.com.
  68. ^ Cunningham, Andrew (October 7, 2019). «macOS 10.15 Catalina: The Ars Technica review». Ars Technica.
  69. ^ Axon, Samuel (June 6, 2018). «The end of OpenGL support, plus other updates Apple didn’t share at the keynote». Ars Technica. Retrieved October 19, 2020.
  70. ^ «Vulkan, and faster OpenGL ES, on iOS and macOS». Molten. Retrieved October 19, 2020.
  71. ^ The ANGLE Project Authors (October 14, 2020). «google/angle: A conformant OpenGL ES implementation for Windows, Mac, Linux, iOS and Android». GitHub. Retrieved December 17, 2020.
  72. ^ «Zink». The Mesa 3D Graphics Library latest documentation.
  73. ^ Dingman, Hayden (March 3, 2015). «Meet Vulkan, the powerful, platform-agnostic gaming tech taking aim at DirectX 12». PC World. Retrieved March 3, 2015.
  74. ^ Bright, Peter (March 3, 2015). «Khronos unveils Vulkan: OpenGL built for modern systems». Ars Technica. Retrieved March 3, 2015.
  75. ^ «Khronos Announces Next Generation OpenGL Initiative». AnandTech. Retrieved August 20, 2014.
  76. ^ «OpenGL 4.5 released, next-gen OpenGL unveiled: Cross-platform Mantle killer, DX12 competitor». Retrieved August 20, 2014.
  77. ^ «Khronos Publishes Its Slides About OpenGL-Next». Phoronix. Retrieved August 22, 2014.

Further reading[edit]

  • Shreiner, Dave; Sellers, Graham; et al. (March 30, 2013). OpenGL Programming Guide: The Official Guide to Learning OpenGL. Version 4.3 (8th ed.). Addison-Wesley. ISBN 978-0-321-77303-6.
  • Sellers, Graham; Wright, Richard S.; Haemel, Nicholas (July 31, 2013). OpenGL SuperBible: Comprehensive Tutorial and Reference (6th ed.). Addison-Wesley. ISBN 978-0-321-90294-8.
  • Rost, Randi J. (July 30, 2009). OpenGL Shading Language (3rd ed.). Addison-Wesley. ISBN 978-0-321-63763-5.
  • Lengyel, Eric (2003). The OpenGL Extensions Guide. Charles River Media. ISBN 1-58450-294-0.
  • OpenGL Architecture Review Board; Shreiner, Dave (2004). OpenGL Reference Manual: The Official Reference Document to OpenGL. Version 1.4. Addison-Wesley. ISBN 0-321-17383-X.
  • OpenGL Architecture Review Board; Shreiner, Dave; et al. (2006). OpenGL Programming Guide: The Official Guide to Learning OpenGL. Version 2 (5th ed.). Addison-Wesley. ISBN 0-321-33573-2.

External links[edit]

Wikimedia Commons has media related to OpenGL.

  • Official website Edit this at Wikidata
  • OpenGL Overview and OpenGL.org’s Wiki with more information on OpenGL Language bindings
  • SGI’s OpenGL website
  • OpenGL at Curlie
  • Khronos Group, Inc.

Not to be confused with OpenCL.

OpenGL

OpenGL logo.svg
Linux kernel and OpenGL video games.svg

Video games outsource real-time rendering calculations to the GPU over OpenGL. The rendered results are not sent back to main memory, but to the framebuffer of video memory instead. The display controller will then send this data to the display device.

Original author(s) Silicon Graphics
Developer(s) Khronos Group
(formerly ARB)
Initial release June 30, 1992; 30 years ago
Stable release

4.6
/ July 31, 2017; 5 years ago

Written in C[1]
Successor Vulkan
Type 3D graphics API
License
  • Open source license for use of the S.I.[clarification needed]: This is a Free Software License B closely modeled on BSD, X, and Mozilla licenses.
  • Trademark license for new licensees who want to use the OpenGL trademark and logo and claim conformance.[2]
Website opengl.org

OpenGL (Open Graphics Library[3]) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

Silicon Graphics, Inc. (SGI) began developing OpenGL in 1991 and released it on June 30, 1992;[4][5] applications use it extensively in the fields of computer-aided design (CAD), virtual reality, scientific visualization, information visualization, flight simulation, and video games. Since 2006, OpenGL has been managed by the non-profit technology consortium Khronos Group.[6]

Design[edit]

An illustration of the graphics pipeline process

The OpenGL specification describes an abstract API for drawing 2D and 3D graphics. Although it is possible for the API to be implemented entirely in software, it is designed to be implemented mostly or entirely in hardware.

The API is defined as a set of functions which may be called by the client program, alongside a set of named integer constants (for example, the constant GL_TEXTURE_2D, which corresponds to the decimal number 3553). Although the function definitions are superficially similar to those of the programming language C, they are language-independent. As such, OpenGL has many language bindings, some of the most noteworthy being the JavaScript binding WebGL (API, based on OpenGL ES 2.0, for 3D rendering from within a web browser); the C bindings WGL, GLX and CGL; the C binding provided by iOS; and the Java and C bindings provided by Android.

In addition to being language-independent, OpenGL is also cross-platform. The specification says nothing on the subject of obtaining and managing an OpenGL context, leaving this as a detail of the underlying windowing system. For the same reason, OpenGL is purely concerned with rendering, providing no APIs related to input, audio, or windowing.

Development[edit]

OpenGL is no longer in active development: whereas between 2001 and 2014 OpenGL specification was updated mostly on a yearly basis, with two releases (3.1 and 3.2) taking place in 2009 and three (3.3, 4.0 and 4.1) in 2010, the latest OpenGL specification 4.6 was released in 2017 after a three-year break and was limited to inclusion of eleven existing ARB and EXT extensions into the core profile.[7]

Active development of OpenGL was dropped in favor of Vulkan API released in 2016 and codenamed glNext during initial development. In 2017, Khronos Group announced that OpenGL ES will not have new versions[8] and has since concentrated on development of Vulkan and other technologies.[9][10] As a result, certain capabilities offered by modern GPUs, e.g. ray tracing, are not supported by OpenGL.

New versions of the OpenGL specifications are released by the Khronos Group, each of which extends the API to support various new features. The details of each version are decided by consensus between the Group’s members, including graphics card manufacturers, operating system designers, and general technology companies such as Mozilla and Google.[11]

In addition to the features required by the core API, graphics processing unit (GPU) vendors may provide additional functionality in the form of extensions. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Vendors can use extensions to expose custom APIs without needing support from other vendors or the Khronos Group as a whole, which greatly increases the flexibility of OpenGL. All extensions are collected in, and defined by, the OpenGL Registry.[12]

Each extension is associated with a short identifier, based on the name of the company which developed it. For example, Nvidia’s identifier is NV, which is part of the extension name GL_NV_half_float, the constant GL_HALF_FLOAT_NV, and the function glVertex2hNV().[13] If multiple vendors agree to implement the same functionality using the same API, a shared extension may be released, using the identifier EXT. In such cases, it could also happen that the Khronos Group’s Architecture Review Board gives the extension their explicit approval, in which case the identifier ARB is used.[14]

The features introduced by each new version of OpenGL are typically formed from the combined features of several widely implemented extensions, especially extensions of type ARB or EXT.

Documentation[edit]

The OpenGL Architecture Review Board released a series of manuals along with the specification which have been updated to track changes in the API. These are commonly referred to by the colors of their covers:

The Red Book
OpenGL Programming Guide, 9th Edition. ISBN 978-0-134-49549-1
The Official Guide to Learning OpenGL, Version 4.5 with SPIR-V
The Orange Book
OpenGL Shading Language, 3rd edition. ISBN 0-321-63763-1
A tutorial and reference book for GLSL.

Historic books (pre-OpenGL 2.0):

The Green Book
OpenGL Programming for the X Window System. ISBN 978-0-201-48359-8
A book about X11 interfacing and OpenGL Utility Toolkit (GLUT).
The Blue Book
OpenGL Reference manual, 4th edition. ISBN 0-321-17383-X
Essentially a hard-copy printout of the Unix manual (man) pages for OpenGL.
Includes a poster-sized fold-out diagram showing the structure of an idealised OpenGL implementation.
The Alpha Book (white cover)
OpenGL Programming for Windows 95 and Windows NT. ISBN 0-201-40709-4
A book about interfacing OpenGL with Microsoft Windows.

OpenGL’s documentation is also accessible via its official webpage.[15]

Associated libraries[edit]

The earliest versions of OpenGL were released with a companion library called the OpenGL Utility Library (GLU). It provided simple, useful features which were unlikely to be supported in contemporary hardware, such as tessellating, and generating mipmaps and primitive shapes. The GLU specification was last updated in 1998 and depends on OpenGL features which are now deprecated.

Context and window toolkits[edit]

Given that creating an OpenGL context is quite a complex process, and given that it varies between operating systems, automatic OpenGL context creation has become a common feature of several game-development and user-interface libraries, including SDL, Allegro, SFML, FLTK, and Qt. A few libraries have been designed solely to produce an OpenGL-capable window. The first such library was OpenGL Utility Toolkit (GLUT), later superseded by freeglut. GLFW is a newer alternative.[16]

  • These toolkits are designed to create and manage OpenGL windows, and manage input, but little beyond that.[17]
  • GLFW – A cross-platform windowing and keyboard-mouse-joystick handler; is more game-oriented
  • freeglut – A cross-platform windowing and keyboard-mouse handler; its API is a superset of the GLUT API, and it is more stable and up to date than GLUT
  • OpenGL Utility Toolkit (GLUT) – An old windowing handler, no longer maintained.
  • Several «multimedia libraries» can create OpenGL windows, in addition to input, sound and other tasks useful for game-like applications
  • Allegro 5 – A cross-platform multimedia library with a C API focused on game development
  • Simple DirectMedia Layer (SDL) – A cross-platform multimedia library with a C API
  • SFML – A cross-platform multimedia library with a C++ API and multiple other bindings to languages such as C#, Java, Haskell, and Go
  • Widget toolkits
  • FLTK – A small cross-platform C++ widget library
  • Qt – A cross-platform C++ widget toolkit. It provides many OpenGL helper objects, which even abstract away the difference between desktop GL and OpenGL ES
  • wxWidgets – A cross-platform C++ widget toolkit

Extension loading libraries[edit]

Given the high workload involved in identifying and loading OpenGL extensions, a few libraries have been designed which load all available extensions and functions automatically. Examples include OpenGL Easy Extension library (GLEE), OpenGL Extension Wrangler Library (GLEW) and glbinding. Extensions are also loaded automatically by most language bindings, such as JOGL and PyOpenGL.

Implementations[edit]

Screenshot of glxinfo, showing information of Mesa implementation of OpenGL on a system

Mesa 3D is an open-source implementation of OpenGL. It can do pure software rendering, and it may also use hardware acceleration on BSD, Linux, and other platforms by taking advantage of the Direct Rendering Infrastructure. As of version 20.0, it implements version 4.6 of the OpenGL standard.

History[edit]

In the 1980s, developing software that could function with a wide range of graphics hardware was a real challenge. Software developers wrote custom interfaces and drivers for each piece of hardware. This was expensive and resulted in multiplication of effort.

By the early 1990s, Silicon Graphics (SGI) was a leader in 3D graphics for workstations. Their IRIS GL API[18][19] became the industry standard, used more widely than the open standards-based PHIGS.[citation needed] This was because IRIS GL was considered easier to use,[by whom?] and because it supported immediate mode rendering. By contrast, PHIGS was considered difficult to use and outdated in functionality.

SGI’s competitors (including Sun Microsystems, Hewlett-Packard and IBM) were also able to bring to market 3D hardware supported by extensions made to the PHIGS standard, which pressured SGI to open source a version of IRIS GL as a public standard called OpenGL.

However, SGI had many customers for whom the change from IRIS GL to OpenGL would demand significant investment. Moreover, IRIS GL had API functions that were irrelevant to 3D graphics. For example, it included a windowing, keyboard and mouse API, in part because it was developed before the X Window System and Sun’s NeWS. And, IRIS GL libraries were unsuitable for opening due to licensing and patent issues[further explanation needed]. These factors required SGI to continue to support the advanced and proprietary Iris Inventor and Iris Performer programming APIs while market support for OpenGL matured.

One of the restrictions of IRIS GL was that it only provided access to features supported by the underlying hardware. If the graphics hardware did not support a feature natively, then the application could not use it. OpenGL overcame this problem by providing software implementations of features unsupported by hardware, allowing applications to use advanced graphics on relatively low-powered systems. OpenGL standardized access to hardware, pushed the development responsibility of hardware interface programs (device drivers) to hardware manufacturers, and delegated windowing functions to the underlying operating system. With so many different kinds of graphics hardware, getting them all to speak the same language in this way had a remarkable impact by giving software developers a higher-level platform for 3D-software development.

In 1992,[20] SGI led the creation of the OpenGL Architecture Review Board (OpenGL ARB), the group of companies that would maintain and expand the OpenGL specification in the future.

In 1994, SGI played with the idea of releasing something called «OpenGL++» which included elements such as a scene-graph API (presumably based on their Performer technology). The specification was circulated among a few interested parties – but never turned into a product.[21]

In 1996, Microsoft released Direct3D, which eventually became the main competitor of OpenGL. Over 50 game developers signed an open letter to Microsoft, released on June 12, 1997, calling on the company to actively support OpenGL.[22] On December 17, 1997,[23] Microsoft and SGI initiated the Fahrenheit project, which was a joint effort with the goal of unifying the OpenGL and Direct3D interfaces (and adding a scene-graph API too). In 1998, Hewlett-Packard joined the project.[24] It initially showed some promise of bringing order to the world of interactive 3D computer graphics APIs, but on account of financial constraints at SGI, strategic reasons at Microsoft, and a general lack of industry support, it was abandoned in 1999.[25]

In July 2006, the OpenGL Architecture Review Board voted to transfer control of the OpenGL API standard to the Khronos Group.[26][27]

Industry support[edit]

[icon]

This section needs expansion with: more historical background when support was being added. You can help by adding to it. (January 2023)

In June 2018, Apple deprecated OpenGL APIs on all of their platforms (iOS, macOS and tvOS), strongly encouraging developers to use their proprietary Metal API, which was introduced in 2014.[28]

id Software supported OpenGL in subsequent versions of id Tech game engines starting with the 1996 Quake II engine.[29] In 2016, they released an update for the id Tech 6 that added support for Vulkan, a succesor to OpenGL. ID Tech 7 eliminated support for OpenGL.[30]

Version history[edit]

The first version of OpenGL, version 1.0, was released on June 30, 1992, by Mark Segal and Kurt Akeley. Since then, OpenGL has occasionally been extended by releasing a new version of the specification. Such releases define a baseline set of features which all conforming graphics cards must support, and against which new extensions can more easily be written. Each new version of OpenGL tends to incorporate several extensions which have widespread support among graphics-card vendors, although the details of those extensions may be changed.

OpenGL version history

Version Release Date Features
1.1 1995[citation needed] Texture objects, Vertex Arrays
1.2 March 16, 1998 3D textures, BGRA and packed pixel formats,[31] introduction of the imaging subset useful to image-processing applications
1.2.1 October 14, 1998 A concept of ARB extensions
1.3 August 14, 2001 Multitexturing, multisampling, texture compression
1.4 July 24, 2002 Depth textures, GLSlang[32]
1.5 July 29, 2003 Vertex Buffer Object (VBO), Occlusion Queries[33]
2.0 September 7, 2004 GLSL 1.1, MRT, Non Power of Two textures, Point Sprites,[34] Two-sided stencil[33]
2.1 July 2, 2006 GLSL 1.2, Pixel Buffer Object (PBO), sRGB Textures[33]
3.0 August 11, 2008 GLSL 1.3, Texture Arrays, Conditional rendering, Frame Buffer Object (FBO)[35]
3.1 March 24, 2009 GLSL 1.4, Instancing, Texture Buffer Object, Uniform Buffer Object, Primitive restart[36]
3.2 August 3, 2009 GLSL 1.5, Geometry Shader, Multi-sampled textures[37]
3.3 March 11, 2010 GLSL 3.30, Backports as much function as possible from the OpenGL 4.0 specification
4.0 March 11, 2010 GLSL 4.00, Tessellation on GPU, shaders with 64-bit precision[38]
4.1 July 26, 2010 GLSL 4.10, Developer-friendly debug outputs, compatibility with OpenGL ES 2.0[39]
4.2 August 8, 2011[40] GLSL 4.20, Shaders with atomic counters, draw transform feedback instanced, shader packing, performance improvements
4.3 August 6, 2012[41] GLSL 4.30, Compute shaders leveraging GPU parallelism, shader storage buffer objects, high-quality ETC2/EAC texture compression, increased memory security, a multi-application robustness extension, compatibility with OpenGL ES 3.0[42]
4.4 July 22, 2013[43] GLSL 4.40, Buffer Placement Control, Efficient Asynchronous Queries, Shader Variable Layout, Efficient Multiple Object Binding, Streamlined Porting of Direct3D applications, Bindless Texture Extension, Sparse Texture Extension[43]
4.5 August 11, 2014[12][44] GLSL 4.50, Direct State Access (DSA), Flush Control, Robustness, OpenGL ES 3.1 API and shader compatibility, DX11 emulation features
4.6 July 31, 2017[7][45] GLSL 4.60, More efficient geometry processing and shader execution, more information, no error context, polygon offset clamp, SPIR-V, anisotropic filtering

OpenGL 2.0[edit]

Release date: September 7, 2004

OpenGL 2.0 was originally conceived by 3Dlabs to address concerns that OpenGL was stagnating and lacked a strong direction.[46] 3Dlabs proposed a number of major additions to the standard. Most of these were, at the time, rejected by the ARB or otherwise never came to fruition in the form that 3Dlabs proposed. However, their proposal for a C-style shading language was eventually completed, resulting in the current formulation of the OpenGL Shading Language (GLSL or GLslang). Like the assembly-like shading languages it was replacing, it allowed replacing the fixed-function vertex and fragment pipe with shaders, though this time written in a C-like high-level language.

The design of GLSL was notable for making relatively few concessions to the limits of the hardware then available. This harked back to the earlier tradition of OpenGL setting an ambitious, forward-looking target for 3D accelerators rather than merely tracking the state of currently available hardware. The final OpenGL 2.0 specification[47] includes support for GLSL.

Longs Peak and OpenGL 3.0[edit]

Before the release of OpenGL 3.0, the new revision had the codename Longs Peak. At the time of its original announcement, Longs Peak was presented as the first major API revision in OpenGL’s lifetime. It consisted of an overhaul to the way that OpenGL works, calling for fundamental changes to the API.

The draft introduced a change to object management. The GL 2.1 object model was built upon the state-based design of OpenGL. That is, to modify an object or to use it, one needs to bind the object to the state system, then make modifications to the state or perform function calls that use the bound object.

Because of OpenGL’s use of a state system, objects must be mutable. That is, the basic structure of an object can change at any time, even if the rendering pipeline is asynchronously using that object. A texture object can be redefined from 2D to 3D. This requires any OpenGL implementations to add a degree of complexity to internal object management.

Under the Longs Peak API, object creation would become atomic, using templates to define the properties of an object which would be created with one function call. The object could then be used immediately across multiple threads. Objects would also be immutable; however, they could have their contents changed and updated. For example, a texture could change its image, but its size and format could not be changed.

To support backwards compatibility, the old state based API would still be available, but no new functionality would be exposed via the old API in later versions of OpenGL. This would have allowed legacy code bases, such as the majority of CAD products, to continue to run while other software could be written against or ported to the new API.

Longs Peak was initially due to be finalized in September 2007 under the name OpenGL 3.0, but the Khronos Group announced on October 30 that it had run into several issues that it wished to address before releasing the specification.[48] As a result, the spec was delayed, and the Khronos Group went into a media blackout until the release of the final OpenGL 3.0 spec.

The final specification proved far less revolutionary than the Longs Peak proposal. Instead of removing all immediate mode and fixed functionality (non-shader mode), the spec included them as deprecated features. The proposed object model was not included, and no plans have been announced to include it in any future revisions. As a result, the API remained largely the same with a few existing extensions being promoted to core functionality.

Among some developer groups this decision caused something of an uproar,[49] with many developers professing that they would switch to DirectX in protest. Most complaints revolved around the lack of communication by Khronos to the development community and multiple features being discarded that were viewed favorably by many. Other frustrations included the requirement of DirectX 10 level hardware to use OpenGL 3.0 and the absence of geometry shaders and instanced rendering as core features.

Other sources reported that the community reaction was not quite as severe as originally presented,[50] with many vendors showing support for the update.[51][52]

OpenGL 3.0[edit]

Release date: August 11, 2008

OpenGL 3.0 introduced a deprecation mechanism to simplify future revisions of the API. Certain features, marked as deprecated, could be completely disabled by requesting a forward-compatible context from the windowing system. OpenGL 3.0 features could still be accessed alongside these deprecated features, however, by requesting a full context.

Deprecated features include:

  • All fixed-function vertex and fragment processing
  • Direct-mode rendering, using glBegin and glEnd
  • Display lists
  • Indexed-color rendering targets
  • OpenGL Shading Language versions 1.10 and 1.20

OpenGL 3.1[edit]

Release date: March 24, 2009

OpenGL 3.1 fully removed all of the features which were deprecated in version 3.0, with the exception of wide lines. From this version onwards, it’s not possible to access new features using a full context, or to access deprecated features using a forward-compatible context. An exception to the former rule is made if the implementation supports the ARB_compatibility extension, but this is not guaranteed.

Hardware: Mesa supports ARM Panfrost with Version 21.0.

OpenGL 3.2[edit]

Release date: August 3, 2009

OpenGL 3.2 further built on the deprecation mechanisms introduced by OpenGL 3.0, by dividing the specification into a core profile and compatibility profile. Compatibility contexts include the previously-removed fixed-function APIs, equivalent to the ARB_compatibility extension released alongside OpenGL 3.1, while core contexts do not. OpenGL 3.2 also included an upgrade to GLSL version 1.50.

OpenGL 3.3[edit]

Release date: March 11, 2010

Mesa supports software Driver SWR, softpipe and for older Nvidia cards with NV50.

OpenGL 4.0[edit]

Release date: March 11, 2010

OpenGL 4.0 was released alongside version 3.3. It was designed for hardware able to support Direct3D 11.

As in OpenGL 3.0, this version of OpenGL contains a high number of fairly inconsequential extensions, designed to thoroughly expose the abilities of Direct3D 11-class hardware. Only the most influential extensions are listed below.

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Ivy Bridge processors and newer.[53]

OpenGL 4.1[edit]

Release date: July 26, 2010

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Ivy Bridge processors and newer.[53]

  • Minimum «maximum texture size» is 16,384 × 16,384 for GPU’s implementing this specification.[54]

OpenGL 4.2[edit]

Release date: August 8, 2011[40]

  • Support for shaders with atomic counters and load-store-atomic read-modify-write operations to one level of a texture
  • Drawing multiple instances of data captured from GPU vertex processing (including tessellation), to enable complex objects to be efficiently repositioned and replicated
  • Support for modifying an arbitrary subset of a compressed texture, without having to re-download the whole texture to the GPU for significant performance improvements

Hardware support: Nvidia GeForce 400 series and newer, AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), and Intel HD Graphics in Intel Haswell processors and newer.[53] (Linux Mesa: Ivy Bridge and newer)

OpenGL 4.3[edit]

Release date: August 6, 2012[41]

  • Compute shaders leveraging GPU parallelism within the context of the graphics pipeline
  • Shader storage buffer objects, allowing shaders to read and write buffer objects like image load/store from 4.2, but through the language rather than function calls.
  • Image format parameter queries
  • ETC2/EAC texture compression as a standard feature
  • Full compatibility with OpenGL ES 3.0 APIs
  • Debug abilities to receive debugging messages during application development
  • Texture views to interpret textures in different ways without data replication
  • Increased memory security and multi-application robustness

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Haswell processors and newer.[53] (Linux Mesa: Ivy Bridge without stencil texturing, Haswell and newer), Nvidia GeForce 400 series and newer. VIRGL Emulation for virtual machines supports 4.3+ with Mesa 20.

OpenGL 4.4[edit]

Release date: July 22, 2013[43]

  • Enforced buffer object usage controls
  • Asynchronous queries into buffer objects
  • Expression of more layout controls of interface variables in shaders
  • Efficient binding of multiple objects simultaneously

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Broadwell processors and newer (Linux Mesa: Haswell and newer),[55] Nvidia GeForce 400 series and newer,[56] Tegra K1.

OpenGL 4.5[edit]

Release date: August 11, 2014[12][44]

  • Direct State Access (DSA) – object accessors enable state to be queried and modified without binding objects to contexts, for increased application and middleware efficiency and flexibility.[57]
  • Flush Control – applications can control flushing of pending commands before context switching – enabling high-performance multithreaded applications;
  • Robustness – providing a secure platform for applications such as WebGL browsers, including preventing a GPU reset affecting any other running applications;
  • OpenGL ES 3.1 API and shader compatibility – to enable the easy development and execution of the latest OpenGL ES applications on desktop systems.

Hardware support: AMD Radeon HD 5000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel HD Graphics in Intel Broadwell processors and newer (Linux Mesa: Haswell and newer), Nvidia GeForce 400 series and newer,[56] Tegra K1, and Tegra X1.[58][59]

OpenGL 4.6[edit]

Release date: July 31, 2017[12][7][45]

  • more efficient, GPU-sided, geometry processing
  • more efficient shader execution (AZDO)
  • more information through statistics, overflow query and counters
  • higher performance through no error handling contexts
  • clamping of polygon offset function, solves a shadow rendering problem
  • SPIR-V shaders
  • Improved anisotropic filtering

Hardware support: AMD Radeon HD 7000 Series and newer (FP64 shaders implemented by emulation on some TeraScale GPUs), Intel Haswell and newer, Nvidia GeForce 400 series and newer.[56]

Driver support:

  • Mesa 19.2 on Linux supports OpenGL 4.6 for Intel Broadwell and newer.[60] Mesa 20.0 supports AMD Radeon GPUs,[61] while support for Nvidia Kepler+ is in progress. Zink as Emulation Driver with 21.1 and software driver LLVMpipe also support with Mesa 21.0.
  • AMD Adrenalin 18.4.1 Graphics Driver on Windows 7 SP1, 10 version 1803 (April 2018 update) for AMD Radeon™ HD 7700+, HD 8500+ and newer. Released April 2018.[62][63]
  • Intel 26.20.100.6861 graphics driver on Windows 10. Released May 2019.[64][65]
  • NVIDIA GeForce 397.31 Graphics Driver on Windows 7, 8, 10 x86-64 bit only, no 32-bit support. Released April 2018[66]

Alternative implementations[edit]

Apple deprecated OpenGL in iOS 12 and macOS 10.14 Mojave in favor of Metal, but it is still available as of macOS 13 Ventura (including Apple silicon devices).[67] The latest version supported for OpenGL is 4.1 from 2011.[68][69] A proprietary library from Molten – authors of MoltenVK – called MoltenGL, can translate OpenGL calls to Metal.[70]

There are several projects which attempt to implement OpenGL on top of Vulkan. The Vulkan backend for Google’s ANGLE achieved OpenGL ES 3.1 conformance in July 2020.[71] The Mesa3D project also includes such a driver, called Zink.[72]

Vulkan[edit]

Vulkan, formerly named the «Next Generation OpenGL Initiative» (glNext),[73][74] is a grounds-up redesign effort to unify OpenGL and OpenGL ES into one common API that will not be backwards compatible with existing OpenGL versions.[75][76][77]

The initial version of Vulkan API was released on February 16, 2016.

See also[edit]

  • ARB assembly language – OpenGL’s legacy low-level shading language
  • Comparison of OpenGL and Direct3D
  • Direct3D – main competitor of OpenGL
  • Glide (API) – a graphics API once used on 3dfx Voodoo cards
  • List of OpenGL applications
  • Metal (API) – a graphics API for iOS, macOS, tvOS, watchOS
  • OpenAL – cross-platform audio library, designed to resemble OpenGL
  • OpenGL ES – OpenGL for embedded systems
  • OpenSL ES – API for audio on embedded systems, developed by the Khronos Group
  • OpenVG – API for accelerated 2D graphics, developed by the Khronos Group
  • RenderMan Interface Specification (RISpec) – Pixar’s open API for photorealistic off-line rendering
  • VOGL – a debugger for OpenGL
  • Vulkan – low-overhead, cross-platform 2D and 3D graphics API, the «next generation OpenGL initiative»
  • Graphics pipeline
  • WebGPU

References[edit]

  1. ^
  2. ^ «Products: Software: OpenGL: Licensing and Logos». SGI. Archived from the original on November 1, 2012. Retrieved November 7, 2012.
  3. ^ «The OpenGL Graphics System: A Specification» (PDF). 4.0 (Core Profile). March 11, 2010.
  4. ^ «SGI – OpenGL Overview». Archived from the original on October 31, 2004. Retrieved February 16, 2007.
  5. ^ Peddie, Jon (July 2012). «Who’s the Fairest of Them All?». Computer Graphics World. Retrieved May 30, 2018.
  6. ^ «OpenGL ARB to Pass Control of OpenGL Specification to Khronos Group». The Khronos Group. July 31, 2006. Retrieved March 18, 2021.
  7. ^ a b c «Khronos Releases OpenGL 4.6 with SPIR-V Support». The Khronos Group Inc. July 31, 2017. Retrieved July 31, 2017.
  8. ^ «The Future of OpenGL (forum discussion)». Khronos Group. 2020.
  9. ^ «Khronos News Archives». Khronos Group. November 28, 2022.
  10. ^ «Khronos Blog». Khronos Group. November 28, 2022.
  11. ^ «Khronos Membership Overview and FAQ». Khronos.org. Retrieved November 7, 2012.
  12. ^ a b c d «Khronos OpenGL Registry». Khronos Group. Retrieved July 31, 2017.
  13. ^ «NV_half_float». OpenGL Registry. Khronos Group.
  14. ^ «How to Create Khronos API Extensions». Khronos Group. Retrieved July 31, 2017.
  15. ^ «OpenGL — The Industry’s Foundation for High Performance Graphics». The Khronos Group. July 19, 2011. Retrieved March 18, 2021.
  16. ^ «A list of GLUT alternatives, maintained by». Khronos Group. Retrieved May 2, 2013.
  17. ^ «Related toolkits and APIs». www.opengl.org. OpenGL. Retrieved October 8, 2014.
  18. ^ «IRIS GL, SGI’s property».
  19. ^ Kilgard, Mark (2008). «OpenGL Prehistory: IRIS GL (slide)». www.slideshare.net.
  20. ^ «Creation of the OpenGL ARB». Archived from the original on February 22, 2007. Retrieved February 16, 2007.
  21. ^ «End of OpenGL++». Khronos Group.
  22. ^ «Top Game Developers Call on Microsoft to Actively Support OpenGL». Next Generation. No. 32. Imagine Media. August 1997. p. 17.
  23. ^ «Announcement of Fahrenheit». Archived from the original on September 27, 2007.
  24. ^ «Members of Fahrenheit. 1998». Computergram International. 1998. Archived from the original on October 5, 2007.
  25. ^ «End of Fahrenheit». The Register.
  26. ^ «OpenGL ARB to pass control of OpenGL specification to Khronos Group». Khronos press release. July 31, 2006.
  27. ^ «OpenGL ARB to Pass Control of OpenGL Specification to Khronos Group». AccessMyLibrary Archive.
  28. ^ Smith, Ryan (June 5, 2018). «Apple Deprecates OpenGL Across All OSes; Urges Developers to use Metal». www.anandtech.com. Purch. Retrieved June 5, 2018.
  29. ^ «Technology Licensing: id Tech 2». Archived from the original on November 8, 2009. Retrieved September 17, 2008.
  30. ^ «Doom Wiki: id Tech 7». Retrieved October 26, 2021.
  31. ^ Astle, Dave (April 1, 2003). «Moving Beyond OpenGL 1.1 for Windows». gamedev.net. Retrieved November 15, 2007.
  32. ^ Isorna, J.M. (2015). Simulación visual de materiales : teoría, técnicas, análisis de casos. UPC Grau. Arquitectura, urbanisme i edificació (in Spanish). Universitat Politècnica de Catalunya. p. 191. ISBN 978-84-9880-564-2. Retrieved August 21, 2019.
  33. ^ a b c «The OpenGL Graphics System: A Specification» (PDF). 2.1. December 1, 2006.
  34. ^ «Point Primitive».
  35. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.0. September 23, 2008.
  36. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.1. May 28, 2009.
  37. ^ «The OpenGL Graphics System: A Specification» (PDF). 3.2 (Core Profile). December 7, 2009.
  38. ^ «Khronos Unleashes Cutting-Edge, Cross-Platform Graphics Acceleration with OpenGL 4.0». March 11, 2010.
  39. ^ «Khronos Drives Evolution of Cross-Platform 3D Graphics with Release of OpenGL 4.1 Specification». July 26, 2010.
  40. ^ a b «Khronos Enriches Cross-Platform 3D Graphics with Release of OpenGL 4.2 Specification». August 8, 2011.
  41. ^ a b «Khronos Releases OpenGL 4.3 Specification with Major Enhancements». August 6, 2012.
  42. ^ «Khronos Releases OpenGL 4.3 Specification with Major Enhancements». August 6, 2012.
  43. ^ a b c «Khronos Releases OpenGL 4.4 Specification». July 22, 2013.
  44. ^ a b «Khronos Group Announces Key Advances in OpenGL Ecosystem – Khronos Group Press Release». The Khronos Group Inc. August 10, 2014. Retrieved April 17, 2015.
  45. ^ a b Kessenich, John; Baldwin, Dave. «The OpenGL® Shading Language, Version 4.60.7». The Khronos Group Inc. Retrieved August 21, 2019.
  46. ^ Abi-Chahla, Fedy (September 16, 2008). «OpenGL 3 (3DLabs And The Evolution Of OpenGL)». Tom’s Hardware. Retrieved October 24, 2010.
  47. ^ «The OpenGL Graphics System: A Specification» (PDF). 2.0. October 22, 2004.
  48. ^ «OpenGL ARB announces an update on OpenGL 3.0». October 30, 2007. Retrieved October 31, 2007.
  49. ^ «OpenGL 3.0 Released, Developers Furious – Slashdot». Tech.slashdot.org. Retrieved November 7, 2012.
  50. ^ «OpenGL BOF went over well, no pitch forks seen».
  51. ^ «The Industry Standard for High Performance Graphics». OpenGL. August 18, 2008. Retrieved July 31, 2017.
  52. ^ «NVIDIA provides early OpenGL 3.0 driver now».
  53. ^ a b c d «Intel Iris and HD Graphics Driver for Windows 7/8/8.1 64bit». Intel Download Center. Archived from the original on April 2, 2015.
  54. ^ «Expected maximum texture size — Graphics and GPU Programming». GameDev.net.
  55. ^ «Intel Skylake-S CPUs and 100-series Chipsets Detailed in Apparent Leak». NDTV Gadgets. April 17, 2015.
  56. ^ a b c Larabel, Michael (July 31, 2017). «NVIDIA Releases 381.26.11 Linux Driver With OpenGL 4.6 Support». Phoronix.
  57. ^ «OpenGL 4.5 released—with one of Direct3D’s best features». Ars Technica. August 11, 2014. Retrieved April 17, 2015.
  58. ^ «SG4121: OpenGL Update for NVIDIA GPUs». Ustream. Archived from the original on May 17, 2015. Retrieved April 17, 2015.
  59. ^ Kilgard, Mark (August 12, 2014). «OpenGL 4.5 Update for NVIDIA GPUs». Retrieved April 17, 2015.
  60. ^ Larabel, Michael (August 21, 2019). «Intel’s OpenGL Linux Driver Now Has OpenGL 4.6 Support For Mesa 19.2». Phoronix.
  61. ^ Larabel, Michael (November 27, 2019). «AMD’s RadeonSI Driver Finally Enables OpenGL 4.6». Phoronix.
  62. ^ «AMD Adrenalin 18.4.1 Graphics Driver Released (OpenGL 4.6, Vulkan 1.1.70) – Geeks3D». www.geeks3d.com. Retrieved May 10, 2018.
  63. ^ «Radeon™ Software Adrenalin Edition 18.4.1 Release Notes». support.amd.com. Retrieved May 10, 2018.
  64. ^ «Intel Graphics Driver 25.20.100.6861 Released (OpenGL 4.6 + Vulkan 1.1.103) | Geeks3D». Retrieved May 16, 2019.
  65. ^ «Windows® 10 DCH Drivers». Intel DownloadCenter. Retrieved August 21, 2019.
  66. ^ «NVIDIA GeForce 397.31 Graphics Driver Released (OpenGL 4.6, Vulkan 1.1, RTX, CUDA 9.2) – Geeks3D». www.geeks3d.com. Retrieved May 10, 2018.
  67. ^ «Apple Developer Documentation». developer.apple.com.
  68. ^ Cunningham, Andrew (October 7, 2019). «macOS 10.15 Catalina: The Ars Technica review». Ars Technica.
  69. ^ Axon, Samuel (June 6, 2018). «The end of OpenGL support, plus other updates Apple didn’t share at the keynote». Ars Technica. Retrieved October 19, 2020.
  70. ^ «Vulkan, and faster OpenGL ES, on iOS and macOS». Molten. Retrieved October 19, 2020.
  71. ^ The ANGLE Project Authors (October 14, 2020). «google/angle: A conformant OpenGL ES implementation for Windows, Mac, Linux, iOS and Android». GitHub. Retrieved December 17, 2020.
  72. ^ «Zink». The Mesa 3D Graphics Library latest documentation.
  73. ^ Dingman, Hayden (March 3, 2015). «Meet Vulkan, the powerful, platform-agnostic gaming tech taking aim at DirectX 12». PC World. Retrieved March 3, 2015.
  74. ^ Bright, Peter (March 3, 2015). «Khronos unveils Vulkan: OpenGL built for modern systems». Ars Technica. Retrieved March 3, 2015.
  75. ^ «Khronos Announces Next Generation OpenGL Initiative». AnandTech. Retrieved August 20, 2014.
  76. ^ «OpenGL 4.5 released, next-gen OpenGL unveiled: Cross-platform Mantle killer, DX12 competitor». Retrieved August 20, 2014.
  77. ^ «Khronos Publishes Its Slides About OpenGL-Next». Phoronix. Retrieved August 22, 2014.

Further reading[edit]

  • Shreiner, Dave; Sellers, Graham; et al. (March 30, 2013). OpenGL Programming Guide: The Official Guide to Learning OpenGL. Version 4.3 (8th ed.). Addison-Wesley. ISBN 978-0-321-77303-6.
  • Sellers, Graham; Wright, Richard S.; Haemel, Nicholas (July 31, 2013). OpenGL SuperBible: Comprehensive Tutorial and Reference (6th ed.). Addison-Wesley. ISBN 978-0-321-90294-8.
  • Rost, Randi J. (July 30, 2009). OpenGL Shading Language (3rd ed.). Addison-Wesley. ISBN 978-0-321-63763-5.
  • Lengyel, Eric (2003). The OpenGL Extensions Guide. Charles River Media. ISBN 1-58450-294-0.
  • OpenGL Architecture Review Board; Shreiner, Dave (2004). OpenGL Reference Manual: The Official Reference Document to OpenGL. Version 1.4. Addison-Wesley. ISBN 0-321-17383-X.
  • OpenGL Architecture Review Board; Shreiner, Dave; et al. (2006). OpenGL Programming Guide: The Official Guide to Learning OpenGL. Version 2 (5th ed.). Addison-Wesley. ISBN 0-321-33573-2.

External links[edit]

Wikimedia Commons has media related to OpenGL.

  • Official website Edit this at Wikidata
  • OpenGL Overview and OpenGL.org’s Wiki with more information on OpenGL Language bindings
  • SGI’s OpenGL website
  • OpenGL at Curlie
  • Khronos Group, Inc.

Здравствуйте, читатели.

Вы увлекаетесь или собираетесь профессионально заниматься компьютерной графикой? Тогда вам стоит знать, что такое OpenGL. Ведь эта технология является первой и лидирующей до сих пор в написании программ, независимых от операционной системы и аппаратного обеспечения.

Мы давно ушли от того времени, когда работать с трехмерной графикой можно было только на суперкомпьютерах. Сейчас вы и любой другой человек может это делать на собственном железе. В данной статье я не буду обучать вас программированию, а лишь познакомлю с мощным инструментом, который вам поможет в этом деле.

Что такое opengl

Объяснение термина

Под двумя последними буквами в понятии OpenGL скрывается Graphics Library. Полностью оно переводится как «отрытая графическая библиотека». Почему открытая? Потому что разработанные на ней продукты можно открывать на любых платформах и результат будет один и тот же. Это может быть как графическая станция, так и суперкомпьютер.

По своей сути OpenGL является интерфейсом, использующим двухмерную и трехмерную графику. Это спецификация, то есть документ с набором функций (API). Основываясь на ней, производители оборудования создают реализации. Если оно не может реализовать какую-либо команду, она эмулируется программами.

Получается, что разработчикам программного обеспечения достаточно научиться использовать возможности Опенгл, а их практическое осуществление отводится изготовителям аппаратной части.

Существуют реализации интерфейса для Windows, Unix-платформ, PlayStation 3 и Mac OS, которые предоставляются производителями видеокарт для возможности работы с ними. Но есть и открытая реализация для других графических карт — библиотека Mesa, которая хоть и считается неофициальной, но отлично справляется со своими задачами.

Появление

В 1990-е годы выпускать кроссплатформенное ПО было дорого и сложно, поэтому создавались отдельные технологии для каждого вида видеокарт, вследствие чего множился один и тот же программный код. Естественно, это преграждало путь совершенствованию компьютерной графики.

В те годы компания Silicon Graphics (SGI), выпускающая высокотехнологическую графическую аппаратуру и проги, занимала лидирующие позиции в трехмерной графике. Поэтому взяла на себя ответственность в стандартизации доступа к соответствующему оборудованию на уровне программного интерфейса.

Лого Silicon Graphics

Таким образом, в 1992 году появилась первая OpenGL. Последнее ее обновление произошло в 2017 году до версии 4.6.

Основные функции

В интерфейс включено больше 300 функций, с помощью которых можно рисовать из простейших примитивов сложные трехмерные сцены. Эти инструменты применяются в создании компьютерных игр, мультфильмов, виртуальной реальности, моделировании, научных исследованиях и пр.

Несколько стандартных возможностей спецификации:

  • Применение В-сплайнов, необходимых для проведения кривых по опорным точкам;
  • Геометрические и растровые примитивы, из которых делаются любые объекты;
  • Управление цветами в режиме RGBA, или выбирая оттенки из палитры;
  • Модельная и видовая оптимизация для перемещения объекта в трехмерном пространстве;
  • Одинарная, двойная (для устранения мерцания в анимации) и тройная буферизация которая в сравнении со второй быстрее выводит изображение;
  • Стирание невидимых линий и поверхностей;
  • Придание объектам текстуры, чтобы они выглядели реалистично;
  • Сглаживание линий путем изменения яркости и цвета пикселей возле них;
  • Расстановка и контроль источников света;
  • Добавление таких эффектов как туман, дым и пр.

Возможности OpenGL

Принцип действия

OpenGL создает векторное изображение из точек, треугольников и линий, а затем путем их математической обработки преображает его в растровое. Картинка выводится на экран или сохраняется в памяти.

Чтобы эти действия были выполнены, программисту следует пошагово расписать команды. То есть вам нужно определить объекты, поставить их в определенном месте, задать такие параметры как масштаб, наклон, поворот и прочие, установить положение наблюдателя, а интерфейс, в свою очередь, покажет результат на экране.

Из векторов в растр

Дело в том, что спецификация призвана лишь отображать заданные вами команды. Управлять итоговой картинкой клавиатурой и мышью не получится. Также нет поддержки менеджера окон. Но это касается только стандартной библиотеки. Есть и другие — с расширенным функционалом.

Что такое opengl вспомогательные библиотеки

Широко используются 4 дополнительные библиотеки:

  • GLU. Она уже считается стандартом в работе с компьютерной графикой, поэтому поставляется в комплекте с OpenGL. Первая построена поверх второй, поэтому использует ее функции, только в упрощенной, но в то же время совершенной форме, а также может выполнять и более сложные задачи.
  • Пример чайника на OpenGLGLUT. Функционирует на различных операционках. Эта библиотека пригодиться вам, если захотите работать с окнами и устройствами ввода-вывода. Еще она позволяет распознавать такие непростые объекты как тетраэдры, конусы и даже, к примеру, чайники, всего одной командой.
  • GLAUX. Менее производительный аналог предыдущего варианта, созданный компанией Microsoft специально для работы в ОС Windows.
  • GLX. Еще одно расширение для Виндовс, предоставляющее как локальный, так и сетевой рендеринг.

Сравнение с Direct3D

Основным конкурентом OpenGL выступает Direct3D — продукт фирмы Майкрософт, созданный специально для написания компьютерных игр. На вопрос «что лучше» сложно ответить, потому что обе имеют свои преимущества.

Все-таки приведу некоторое сравнение, чтобы вы сами могли сделать вывод, какая спецификация больше подойдет для ваших задач:

  • Direct3D работает только на платформах Intel и ОС Windows, а OpenGL успешно открывается не только на этой системе, но и на Unix, Linux, MacOS, IRIX, SunOS и пр.
  • Однако опенгл принимают не все графические карты, а директ лишен такого недостатка;
  • Также последний отличается лучшим объектно-ориентированного подходом.
  • Правда, кроссплатформенная спецификация проще к пониманию, поэтому новичкам для обучения основам трехмерной графики лучше выбирать ее.

DirectX vs OpenGL

На этом всё что касается того, что такое opengl.

Не забудьте поделиться этой статьей со своими знакомыми, которые тоже увлекаются компьютерной графикой.

До скорого!

Понравилась статья? Поделить с друзьями:
  • Opengl скачать для windows 7 через торрент
  • Opengl скачать для windows 7 бесплатно с официального сайта
  • Opengl скачать для windows 7 x64 майнкрафт
  • Opengl скачать для windows 7 x64 ati radeon
  • Opengl скачать для windows 7 x64 amd radeon скачать