OpenGL: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(throwing together some notes; may link to more tutorials later)
 
m (replacing 404 link with archive link)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
OpenGL is what Oni uses for rendering in-game components as well as the menu system and splashscreens – basically everything you see, except for those dialogs and window elements that are handled directly by the operating system (e.g., "[[Troubleshooting/Blam|Blam]]").
OpenGL is what Oni uses for rendering in-game components as well as the menu system and splashscreens – basically everything you see, except for those dialogs and window elements that are handled directly by the operating system (e.g., "[[Troubleshooting/Blam|Blam]]").


Oni's development in the late '90s corresponds to an era when GFX hardware was booming<ref>Quake (1996) is widely regarded as having played a key part in the breakthrough of real-time 3D technology in the late '90s [https://popculthq.com/2018/02/26/evolution-polygons-3d-video-game-graphics/]. See [[wp:First-person_shooter#Advances_in_3D_graphics:_1995–1999|HERE]] (Wikipedia) for a more detailed account citing other remarkable games, such as Descent (1995) or Half-Life (1999).</ref>, but the compatibility standards of such frameworks as OpenGL were still emergent. Starting with OpenGL 1.2.1 (October 1998), new OpenGL features were subject to approval by the Architecture Review Board (the "ARB extensions" concept), based on wide enough availability and reliability on the hardware side. Multitexturing ("GL_ARB_multitexture") was the only extension officially introduced by the OpenGL 1.2.1 spec (section F.2), but other extensions were gradually added on the way to OpenGL 1.3 (August 2001).
Oni's development in the late '90s corresponds to an era when GFX hardware was booming<ref>Quake (1996) is [http://web.archive.org/web/20220515195126/https://popculthq.com/2018/02/26/evolution-polygons-3d-video-game-graphics/ widely regarded] as having played a key part in the breakthrough of real-time 3D technology in the late '90s. See [[wp:First-person_shooter|First-person shooter]] (Wikipedia) for a more detailed account citing other noteworthy games such as Half-Life (1998).</ref>, but the compatibility standards of such frameworks as OpenGL were still emergent. Starting with OpenGL 1.2.1 (October 1998), new OpenGL features were subject to approval by the Architecture Review Board (the "ARB extensions" concept), based on wide enough availability and reliability on the hardware side. Multitexturing ("GL_ARB_multitexture") was the only extension officially introduced by the OpenGL 1.2.1 spec (section F.2), but other extensions were gradually added on the way to OpenGL 1.3 (August 2001).


==OpenGL in Oni==
==OpenGL in Oni==
Oni's release predates OpenGL 1.3 only slightly, so most if not all of the new ARB extensions from the OpenGL 1.3 spec were already approved and available at the time of Oni's development: most notably, compressed textures ("GL_ARB_texture_compression", March 2000) and multisampling a.k.a. antialiasing ("GL_ARB_multisample", December 1999), as well as some environment mapping techniques.
Oni's release predates OpenGL 1.3 only slightly, so most if not all of the new ARB extensions from the OpenGL 1.3 spec were already approved and available at the time of Oni's development: most notably, compressed textures ("GL_ARB_texture_compression", March 2000) and multisampling a.k.a. antialiasing ("GL_ARB_multisample", December 1999), as well as some environment mapping techniques.


Vertex Buffer Objects (i.e., optimized storage of 3D data at GPU level) were not implemented until OpenGL 1.5 (July 2003), and advanced pixel shaders (GLSL scripts) were only added in OpenGL 2.0 (September 2004). Therefore Oni has practically no hardware acceleration and is limited to Gouraud shading.
Vertex Buffer Objects (i.e., optimized storage of 3D data at GPU level) were not implemented until OpenGL 1.5 (July 2003), and advanced pixel shaders (GLSL scripts) were only added in OpenGL 2.0 (September 2004). Therefore Oni has practically no hardware acceleration and is limited to [[wp:Gouraud_shading|Gouraud shading]].


Lightmapping was technically possible since OpenGL 1.2.1 (through multitexturing) and may have been active in pre-beta versions of Oni<ref>Proper multitextured lightmaps should not be confused with [[Lightmapping levels|THIS]] hackish emulation of lightmaps, which uses an extra layer of transparent polygons.</ref>, although it is missing from the final game.
Lightmapping was technically possible since OpenGL 1.2.1 (through multitexturing)<ref>Proper multitextured lightmaps should not be confused with [[Lightmapping levels|THIS]] hackish emulation of lightmaps, which uses an extra layer of transparent polygons.</ref> and was [[Pre-beta_features#Lightmapping|initially present]] in pre-beta versions of Oni, although it was removed from the final game due to either performance reasons or last-minute remodeling of the game's levels.


A basic implementation of environment mapping was used for hair and metal parts, although the reflection math seems incorrect and some NVIDIA cards completely fail to render Oni's reflectivity.
A basic implementation of environment mapping was used for hair and metal parts, although the reflection math seems incorrect and some NVIDIA cards completely fail to render Oni's reflectivity.


==Learning OpenGL==
==Learning OpenGL==
If you are looking for an introduction to modern OpenGL, with shaders and such, then [http://www.opengl-tutorial.org/ opengl-tutorial.org] is a good place to look. [https://www.3dgep.com/introduction-to-opengl-and-glsl/#OpenGL_1x_Fixed-Function_Pipeline THIS] mini-tutorial is also a good place to start, as it fully details the creation of an interactive OpenGL/freeglut app (however, the camera class used by the author is no longer available for download).
If you are looking for an introduction to modern OpenGL, with shaders and such, then [http://www.opengl-tutorial.org/ opengl-tutorial.org] is a good place to look. [http://web.archive.org/web/20221114170719/https://www.3dgep.com/introduction-to-opengl-and-glsl/#OpenGL_1x_Fixed-Function_Pipeline THIS] mini-tutorial is also a good place to start, as it fully details the creation of an interactive OpenGL/freeglut app (however, the camera class used by the author is no longer available for download).


If you are more specifically interested in normal mapping, then a really neat GLSL snippet can be found [http://www.geeks3d.com/20130122/normal-mapping-without-precomputed-tangent-space-vectors/ HERE] (an implementation of normal mapping that uses no precomputed TBN matrices and does all the tangent space math at shader level).
If you are more specifically interested in normal mapping, then a really neat GLSL snippet can be found [http://www.geeks3d.com/20130122/normal-mapping-without-precomputed-tangent-space-vectors/ HERE] (an implementation of normal mapping that uses no precomputed TBN matrices and does all the tangent space math at shader level).

Latest revision as of 14:39, 5 March 2023

OpenGL is what Oni uses for rendering in-game components as well as the menu system and splashscreens – basically everything you see, except for those dialogs and window elements that are handled directly by the operating system (e.g., "Blam").

Oni's development in the late '90s corresponds to an era when GFX hardware was booming[1], but the compatibility standards of such frameworks as OpenGL were still emergent. Starting with OpenGL 1.2.1 (October 1998), new OpenGL features were subject to approval by the Architecture Review Board (the "ARB extensions" concept), based on wide enough availability and reliability on the hardware side. Multitexturing ("GL_ARB_multitexture") was the only extension officially introduced by the OpenGL 1.2.1 spec (section F.2), but other extensions were gradually added on the way to OpenGL 1.3 (August 2001).

OpenGL in Oni

Oni's release predates OpenGL 1.3 only slightly, so most if not all of the new ARB extensions from the OpenGL 1.3 spec were already approved and available at the time of Oni's development: most notably, compressed textures ("GL_ARB_texture_compression", March 2000) and multisampling a.k.a. antialiasing ("GL_ARB_multisample", December 1999), as well as some environment mapping techniques.

Vertex Buffer Objects (i.e., optimized storage of 3D data at GPU level) were not implemented until OpenGL 1.5 (July 2003), and advanced pixel shaders (GLSL scripts) were only added in OpenGL 2.0 (September 2004). Therefore Oni has practically no hardware acceleration and is limited to Gouraud shading.

Lightmapping was technically possible since OpenGL 1.2.1 (through multitexturing)[2] and was initially present in pre-beta versions of Oni, although it was removed from the final game due to either performance reasons or last-minute remodeling of the game's levels.

A basic implementation of environment mapping was used for hair and metal parts, although the reflection math seems incorrect and some NVIDIA cards completely fail to render Oni's reflectivity.

Learning OpenGL

If you are looking for an introduction to modern OpenGL, with shaders and such, then opengl-tutorial.org is a good place to look. THIS mini-tutorial is also a good place to start, as it fully details the creation of an interactive OpenGL/freeglut app (however, the camera class used by the author is no longer available for download).

If you are more specifically interested in normal mapping, then a really neat GLSL snippet can be found HERE (an implementation of normal mapping that uses no precomputed TBN matrices and does all the tangent space math at shader level).

Notes

  1. Quake (1996) is widely regarded as having played a key part in the breakthrough of real-time 3D technology in the late '90s. See First-person shooter (Wikipedia) for a more detailed account citing other noteworthy games such as Half-Life (1998).
  2. Proper multitextured lightmaps should not be confused with THIS hackish emulation of lightmaps, which uses an extra layer of transparent polygons.