Results 1 to 4 of 4

Thread: Easy GLSL tutorial?

  1. #1

    Easy GLSL tutorial?

    I know literally NOTHING about writing shaders. I want to learn GLSL, but all tutorials I could find either assume some knowledge of it or are "beginner" tutorial that talks about pipelines and whatnot and in turn confuses me even more. Do you know any easy to understand tutorials that could help me learn it? Mainly graphic effects such as blur, dof, reflections, etc. but also I'm interested in OpenCL.

  2. #2
    I'm noobie about shaders too. I started reading the OpenGL Orange Book, it's focused in shaders and is really didatic.

  3. #3
    Quote Originally Posted by Darkhog View Post
    Mainly graphic effects such as blur, dof, reflections, etc. but also I'm interested in OpenCL.
    That is like as asking tutorials for multithreading and interfaces when you haven't done a simple "hello world" yet. Those effects are not from the easy end. There are many tutorials which give ready source code in them, and language shouldn't really matter. All you need to see in them is how and where OpenGL commands are called, and what shader code does. This is one of them:
    http://en.wikibooks.org/wiki/OpenGL_...GL_Tutorial_03
    There is also some, bit outdated but mostly still valid guides and codes:
    http://www.lighthouse3d.com/tutorial...-glsl-example/

    The way GL programs and shader sources are used and built, has not changed when going from OpenGL 2 to 3.

  4. #4
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Some info that's not always apparent when learning how shaders sit in the rendering pipeline :

    Shaders can work within the context of the geometry you're rendering, so they're acting upon 3D models for example. Perhaps rendering directly to the screen.

    They can also used in a deferred manner, so you render your scene to a texture in the first pass, then you render a quad with that texture applied with pixel shaders acting upon that. it's still the same as the first example, you're rendering geometry (a quad) and shaders are applied, but this setup is intended for full-screen effects such as blur, being applied to what you rendered in the first pass.

    Of course it doesn't matter what you texture the quad with, be it a normal texture or a 3D scene rendered to a texture. It's a very flexible setup and leads to much confusion to those learning about shaders. There are many ways to achieve a desired output, some fast, some slower. There's no 'right' way as such. Take this into account as you read tutorials that seem to be setup very differently from each other, whatever works for you / fits your coding style is fine. Don't worry about getting top performance to begin with.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •