// A simple OpenGL 2.0 fragment shader varying vec3 vNormal; // Passed from vertex shader void main() // A rudimentary ambient/directional lighting mix float intensity = max(dot(normalize(vNormal), vec3(0.0, 0.0, 1.0)), 0.0); gl_FragColor = vec4(1.0, 0.5, 0.0, 1.0) * (intensity + 0.2); Use code with caution. Step 2: Compile and Link in C/C++
The true genius of OpenGL 20 was its longevity. It taught a generation of programmers that the GPU is not a configurable black box—it is a programmable parallel computer. The shader-centric world of 2025, from real-time ray tracing (RTX) to neural rendering, traces its lineage directly to the GLSL shaders that first shipped in 2004.
2. Architectural Differences: Fixed-Function vs. Programmable
Beyond GLSL, OpenGL 2.0 brought several enhancements that standardized features previously trapped behind vendor-specific extensions.
This feature allowed a fragment shader to output different values to multiple buffers simultaneously. MRTs laid the groundwork for advanced rendering techniques like deferred shading, where geometric data (normals, depth, diffuse colors) is saved into separate textures for complex lighting passes later. Understanding the OpenGL 2.0 Shader Workflow
Many features that were optional extensions in 1.x became core in 2.0, ensuring a more consistent development experience across different hardware vendors. Why OpenGL 2.0 Still Matters Today
// Uniforms passed from CPU uniform mat4 u_ModelViewProjectionMatrix; uniform vec3 u_LightPosition; // Attributes specific to each vertex attribute vec4 a_Position; attribute vec3 a_Normal; // Varying passed down to the fragment shader varying vec3 v_NormalInterp; varying vec3 v_LightDir; void main() // Transform vertex position into clip space gl_Position = u_ModelViewProjectionMatrix * a_Position; // Pass transformed normal and calculate light direction vector v_NormalInterp = a_Normal; v_LightDir = u_LightPosition - a_Position.xyz; Use code with caution. Fragment Shader (GLSL 1.10)
Released on September 7, 2004, OpenGL 2.0 marked a pivotal shift in computer graphics by introducing a programmable pipeline, moving the industry away from the rigid "fixed-function" hardware of the 1990s. Core Innovation: The Programmable Pipeline
The release of OpenGL 2.0 triggered a massive leap forward in real-time graphics. It bridged the gap between cinematic, pre-rendered Hollywood CGI and real-time interactive applications.
Replacing blocky vertex lighting (Gouraud shading) with smooth specular highlights (Phong shading).
While OpenGL 1.5 and various vendor extensions laid the groundwork for hardware acceleration, version 2.0 unified these concepts into a clean, core standard. 1. Native GLSL Integration
