Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1065069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:45:18+00:00 2026-05-16T19:45:18+00:00

The OpenGL Superbible 5th Edition was recently released, and it documents OpenGL 3.3. Unfortunately,

  • 0

The OpenGL Superbible 5th Edition was recently released, and it documents OpenGL 3.3. Unfortunately, OS X only supports OpenGL 2.1 and GLSL version 1.20. The very first non-trivial vertex shader they give you fails to compile with the error message:

ERROR: 0:5: '' :  Version number not supported by GL2
ERROR: 0:8: 'in' : syntax error syntax error

The shader is, as written:

// Simple Diffuse lighting Shader
// Vertex Shader
// Richard S. Wright Jr.
// OpenGL SuperBible
#version 130

// Incoming per vertex... position and normal
in vec4 vVertex;
in vec3 vNormal;

// Set per batch
uniform vec4 diffuseColor; 
uniform vec3 vLightPosition;
uniform mat4 mvpMatrix;
uniform mat4 mvMatrix;
uniform mat3 normalMatrix;

// Color to fragment program
smooth out vec4 vVaryingColor;

void main(void) 
    { 
    // Get surface normal in eye coordinates
    vec3 vEyeNormal = normalMatrix * vNormal;

    // Get vertex position in eye coordinates
    vec4 vPosition4 = mvMatrix * vVertex;
    vec3 vPosition3 = vPosition4.xyz / vPosition4.w;

    // Get vector to light source
    vec3 vLightDir = normalize(vLightPosition - vPosition3);

    // Dot product gives us diffuse intensity
    float diff = max(0.0, dot(vEyeNormal, vLightDir));

    // Multiply intensity by diffuse color
    vVaryingColor.rgb = diff * diffuseColor.rgb;
    vVaryingColor.a = diffuseColor.a;

    // Let's not forget to transform the geometry
    gl_Position = mvpMatrix * vVertex;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T19:45:19+00:00Added an answer on May 16, 2026 at 7:45 pm

    Update 2011: As of OS X Lion, this is no longer the case. Lion has added support for OpenGL 3.2.

    Unfortunately, I’ve come to believe this is a fool’s errand. The book uses a GLTools library (distributed on the website) which enforces the passing in of various parameters in a way that is fundamentally incompatible with OpenGL 2.1.

    If it were one example, it could be rewritten, but it’s a number of examples and the effort would be overwhelming for the return if you were trying to teach yourself OpenGL.

    You have two options:

    1. Buy a Windows machine which supports OpenGL 3 and put your Mac in the corner until Apple steps up to support the newer standard.
    2. Buy the 4th Edition of the book which is still in print.

    From the website:

    If you are still interested in the deprecated functionality of pre-OpenGL 3.x, we recommend the fourth edition, which is still in print, and which covers OpenGL 2.1 and the fixed function pipeline quite thoroughly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started reading OpenGL Superbible 5th edition and noticed the following: Having just
Well, i have just bought this opengl superbible book (5th edition). Unfortunately, i stumbled
I just purchased the fifth edition of the OpenGL SuperBible. I'm very pleased that
I've been working OpenGL's Superbible (5th Edition) point light examples. I found them missing
I am reading the OpenGl superbible, and on the very first triangle program it
i've been reading (openGL superbible 5th Edition) for a while, in which iam really
When I'm compiling the Triangle project from the opengl superbible 5th ed I've this
I'm following along with the OpenGL Super Bible 5th edition, and they define a
I'm reading OpenGL Superbible 5th ed. I've come across several terms which although explained
I am currently learning OpenGL via the 5th Superbible. It teaches you the core

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.