Results 1 to 7 of 7

Thread: Difference between GLSL 1.2 and 1.3(1.4)

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Difference between GLSL 1.2 and 1.3(1.4)

    I would like to learn GLSL with the "Orange Book".

    Unfortunately I only got the second edition at free disposal. SO I would like to know, is there are big differences between GLSL 1.2 and 1.3(1.4)?

    If there is a big difference, and it will be hard for me to switch from GLSL 1.2 to 1.4 at the appropriate time, then I would to swallow the pill and buy the third edition of the orange box now!

    Thanks for any replies!

    cipherovski

  2. #2
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    Buy the third edition anyway.. It's worth supporting such a good source of knowledge!

    Basically, like OpenGL, point updates don't mean that what you've already learned is obsolete. More often simply new features have been added.

    So perhaps read the specs (available on this site) and familiarize yourself with the changes. They are always listed. And then you can make an informed decision yourself.

  3. #3
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    Quote Originally Posted by cipherovski
    ...If there is a big difference, and it will be hard for me to switch from GLSL 1.2 to 1.4 at the appropriate time, then I would to swallow the pill and buy the third edition of the orange box now!...
    Why buying a book is a bitter pill to swallow?
    Although I posted some comments that I'm not very satisfied with the third edition of the Orange book, I claim that it is worth having. Especially somebody who starts with GLSL.

    And the price is acceptably low, so almost everyone could afford it (it is approximately a price of two lunches in the restaurant).

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    thanks for the replies!

    Quote Originally Posted by Aleksandar
    it is approximately a price of two lunches in the restaurant
    Well, for me at the moment it's the price of 10 lunches

    My question remains: Would it be hard for me to switch from 1.2 to 1.4 at the appropriate time?

  5. #5
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    When I said two lunches, I meant for two people (or one for four). I would never go to the restaurant alone.

    If you buy a PDF version, as I did, the price is 20% less. And there is a discount after the registration, so that price is even less.

    But let's back to the topic.

    Quote Originally Posted by cipherovski
    My question remains: Would it be hard for me to switch from 1.2 to 1.4 at the appropriate time?
    No, it wouldn't be hard! In fact, the major version number is still 1, so those GLSL versions shouldn't differ too much. The most noticeable difference is a disappearance of attribute and varying qualifiers (now there are only ins and outs), and the blocks usage. GLSL 1.4 introduces named uniform blocks that are further generalized to interface-blocks in GLSL 1.5. Function ftransform() is also deprecated, and now you should use invariant qualifier. There are also layout qualifiers, but they are not covered properly in the Orange book 3rd Ed. The book also just declares functions and parameters for the uniform blocks, but without any usable examples.

    I'm sorry if this post is too comprehensive. In short, go ahead and start learning GLSL 1.2. It is worth doing that!

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    Quote Originally Posted by Aleksandar
    I'm sorry if this post is too comprehensive.
    No way! It was the answer I hoped to get.

    thanks!

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649

    Re: Difference between GLSL 1.2 and 1.3(1.4)

    Quote Originally Posted by Aleksandar
    Quote Originally Posted by cipherovski
    My question remains: Would it be hard for me to switch from 1.2 to 1.4 at the appropriate time?
    No, it wouldn't be hard! In fact, the major version number is still 1, so those GLSL versions shouldn't differ too much. The most noticeable difference is a disappearance of attribute and varying qualifiers
    That's just a minor syntax tweak. I'd actually suggest a bigger difference for most folks (going from 1.2 to strict 1.3) is the deprecation of nearly all the built-in gl_* uniforms and attributes, as this requires changes to the C++ code (implementing matrix stacks, flipping to user-defined uniforms, tracking light/material state, etc.). Not hard, just takes time. For instance:

    Code :
    global variable gl_FragData is deprecated after version 120
    global variable gl_ModelViewMatrix is deprecated after version 120
    global variable gl_MultiTexCoord0 is deprecated after version 120
    global variable gl_MultiTexCoord1 is deprecated after version 120
    ...
    global variable gl_Normal is deprecated after version 120
    global variable gl_NormalMatrix is deprecated after version 120
    global variable gl_TextureMatrix is deprecated after version 120
    global variable gl_Vertex is deprecated after version 120
    Keep in mind these are just warnings, so if you don't mind your compile logs getting filled up with this cruft hiding potential problems (I do mind), then strictly speaking you could ignore these when moving to 1.3, just as you could with the in/out attribute/varying deprecation too though.

    Still, to the original question, it's not like the language is night-and-day different. You'll find it easier learning with GLSL 1.2 and all the built-in convenience uniforms. Then once you get that knocked out and are comfortable, upgrade your shaders and code to GLSL 1.3 or 1.4.

    Make sure that the version of GL and GLSL you're targetting is supported on all all hardware you must support first though.

Similar Threads

  1. Can anyone tell me the difference?
    By Lee_Jennifer_82 in forum OpenGL: Basic Coding
    Replies: 16
    Last Post: 03-12-2016, 10:16 AM
  2. 0.0f vs 0f, what's the difference?
    By mpan3 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 11-01-2004, 08:20 PM
  3. ver. 1.3->1.4 ?difference?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-08-2002, 03:48 AM
  4. In VB what is the difference in hDC and hRC?
    By John Jenkins in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-26-2002, 01:47 PM
  5. difference between OGL & VTK?
    By alanchinese in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-07-2000, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean