Jump to content
  • Advertisement
Sign in to follow this  
lride

OpenGL Why do I need GLSL?

This topic is 2225 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
"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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!