Jump to content

  • Log In with Google      Sign In   
  • Create Account


Why do I need GLSL?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 lride   Members   -  Reputation: 633

Like
0Likes
Like

Posted 22 August 2012 - 06:11 PM

I don't understand why I need to learn GLSL.
What are some stuff that is not possible to do in normal OpenGL, but possible with GLSL
An invisible text.

Sponsor:

#2 carangil   Members   -  Reputation: 490

Like
1Likes
Like

Posted 22 August 2012 - 06:38 PM

My 'normal' I assume you mean fixed-function pipeline.

Here's a good example: Steep Parallax Mapping:

http://graphics.cs.brown.edu/games/SteepParallax/

They show 4 images. Texture mapping is done in basic fixed-function opengl. You can also do some normal mapping in fixed-function opengl extensions. Even per-pixel normal mapping through the dot-product texture combiner. If you set the right opengl options and parameters, you can do some pretty cool looking stuff.

But the last two, parallel mapping, and steep parallax mapping, require very specific, per-pixel operations. These operations are written in GLSL. Before GLSL, everything you needed OpenGL to do has to have been thought of before hand and built into opengl. Examples are things like turning lights on and off, adjusting fog, etc. It's all pre-made, and all you do is turn it on or off and set some parameters. GLSL lets you ADD and invent NEW things the creators of OpenGL never thought of yet.

#3 Hodgman   Moderators   -  Reputation: 29303

Like
2Likes
Like

Posted 22 August 2012 - 06:42 PM

"normal OpenGL" (AKA fixed function) is deprecated and emulated on modern GPUs. When you use fixed function rendering, then you're simply using the driver's basic built-in GLSL routines.

#4 larspensjo   Members   -  Reputation: 1526

Like
0Likes
Like

Posted 22 August 2012 - 11:37 PM

GLSL isn't necessary, as the drivers still allow the fixed function rendering. But if you want your application to execute on OpenGL ES, then there is no option.

Or if you want to realize the full power of modern graphics, then you also need GLSL.

If you want to learn and understand better what 3D graphics is, so that you can maybe get a job, then you need to know the modern way. Learning 3D programming with the fixed function pipeline is partly wasted, as it is done differently now, you will have to re-learn again.

See Learning Modern 3D Graphics Programming or http://www.opengl-tutorial.org/ for a good tutorials. Learning OpenGL requires a lot of effort.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#5 Lazy Foo   Members   -  Reputation: 1105

Like
0Likes
Like

Posted 22 August 2012 - 11:55 PM

While it may be easier to get off the ground with out GLSL, GLSL is just so powerful. It's like the difference between a tricycle and a sports car.

I'm personally a fan of its hardware accelerated image processing.

Learn to make games with my SDL 2 Tutorials


#6 bronxbomber92   Members   -  Reputation: 275

Like
2Likes
Like

Posted 23 August 2012 - 02:15 AM

I don't understand why I need to learn GLSL.
What are some stuff that is not possible to do in normal OpenGL, but possible with GLSL

For modern OpenGL development there is no practical difference between GLSL (or more broadly, shaders, for which GLSL is a language to write shaders) and OpenGL.

Originally when OpenGL was conceived graphic processing units were only capable of performing a fixed-set of operations. Thus, OpenGL's API was designed to only expose what the graphic cards were capable of doing, and this it what came to be called the fixed function pipeline. But as time has passed, graphic processing units have evolved. They no longer expose just a fixed-set of operations; they still have a small set of fixed operations, but now also include the ability to be programmed (similar to how we can program our CPUs with C or C++ or Java or <insert favourite language>). The ability to program a GPU is important because now what is possible to do with a GPU is much less limited. However, we need a way to be able to program the GPUs, and hence OpenGL has evolved alongside the GPUs capabilities; this is why shaders were introduced.

The bottom line is that GLSL is only necessary to learn if you intend to use features that are beyond the capabilities of the fixed function pipeline. Vaguely, the fixed function pipeline is only capable of fog, vertex lighting, coloring, and texturing. If you're requirements are more sophisticated than that, then you need shaders.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS