Author Topic: Would you recommend learning OpenGL Shading Language?  (Read 4190 times)

0 Members and 1 Guest are viewing this topic.

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
I'm considering buying the second book in the series that discusses OpenGL Shading Language.

I guess I'm looking for some reasons to invest time in learning a new set of commands. Do you use it personally? Is there much demand for learning this?
« Last Edit: October 17, 2007 by Pixel_Outlaw »
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Even if I know very little about shading languages in general - I am really amazed by the
quality of products which use shaders. So, IMHO if you like programming computer graphics
it is worth learning a shader language.

Speaking of the OpenGL Shading language I do not know in which way / how much it differs
to other shading languages (like the one from Microsoft HLSL e.g.). So, if you prefer coding
in OpenGL - why not try its Shading Language.

Hmm ... but I guess there are far more experienced user here to tell you about this topic
more exactly...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #2 on: October 17, 2007 »

I'm interested in making things that have conditional shading and coloring. I really like graphics programming mostly because of my years of drawing and painting and interest in polyhedra.
Challenge Trophies Won:

Offline frea

  • C= 64
  • **
  • Posts: 61
  • Karma: 2
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #3 on: October 18, 2007 »
GLSL came out in one topics i am interested lately - shadows. Shadow mapping can be done faster ( in 2 renderings instead of 3 ) using GLSL.
If you are unsure whether you would like to learn glsl, download ATI's rendermonkey and look at their examples, the amount of code used to produce them and their speed.
If you were interested in glsl i can recomend you the tutorial writen by the guy at typhoon labs.

And after all glsl is not a big language, few types, few functions, c++-like syntax, so not much to learn compared to "normal" languages.


btw. what is "conditional shading" ? Google gave some results about excel ;p
« Last Edit: October 18, 2007 by frea »
Nananan.

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #4 on: October 18, 2007 »
Hi PixelOutlaw,

I guess you are asking two questions here. Is it worth learning shaders...if so which type.
Well, is it worth it is hard to say without knowing your personal motivation. I would say shaders are everywhere, games, demos, 3d tools and even embedded devices within a couple of years. Fundamentally you can do stuff that is impossible in fixed pipelines so they are one more tool. Conditional shading (if (normal.z<0.0) colour = black;?? that sort of thing?) may require PS3.0 very quickly, depending on your complexity.

As for langauge. If you intend to do 4k or less I recommend HLSL and directX. If you are an OGL programmer, GLSL and if you don't mind shipping cg.dll everywhere with everything you do, cg is cross platform. GLSL had a late start and has less ready to use stuff than cg currently but its catching up quickly. So cg is easier to learn right now. That said we know GLSL is not going away, we cant say the same for CG.

Lastly, if you go GLSL route, I may be able to help you :-) but not CG.

Chris
Chris
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #5 on: October 18, 2007 »


Ah ok thanks for the info. Yeah by conditional shading I meant evaluating data and changing the way things are drawn and shaded based on that. Something more than "here is my model it has a brick texture, ok now shade it please".
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #6 on: October 18, 2007 »


Ah ok thanks for the info. Yeah by conditional shading I meant evaluating data and changing the way things are drawn and shaded based on that. Something more than "here is my model it has a brick texture, ok now shade it please".

In that case shaders are your best bet.

Chris
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #7 on: October 18, 2007 »


Also in many modern games you see effects like textboxes converting the images underneath to monotone  colorscales. Is this done with shaders too? Example: the Warning message box in Ikaruga makes everything underneath a pure red hue with no other hues emitted.
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #8 on: October 18, 2007 »
Thats probably just alpha blending but I cant be sure.
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #9 on: October 18, 2007 »
No I don't think so. I tried to find a pic but basically it takes the region behind the box and strips all hue values, then it just used a pure red hue and keeps the value aspect. I guess a simplified version would be a grayscale region in a color game. Where a square takes the underlying pixels and converts them to grayscale.
« Last Edit: October 18, 2007 by Pixel_Outlaw »
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Would you recommend learning OpenGL Shading Language?
« Reply #10 on: October 18, 2007 »
For this, in normal OGL, I would read the screen as a luminance texture then draw the menu using that texture and no blending. The menu could be any colour using GL_MODULATE mode. Might be slow depending on the card. Can anyone think of a better way? There must be...I still think blending might be able to be used.

In shaders I would read the screen as an RGB texture, and write a shader to read the texture and calculate the luminance and multiply by the colour of the menu. This is defintiely fast on anything supporting non power of two textures.

Chris

Challenge Trophies Won:

Offline stormbringer

  • Time moves by fast, no second chance
  • Amiga 1200
  • ****
  • Posts: 453
  • Karma: 73
    • View Profile
    • www.retro-remakes.net
Re: Would you recommend learning OpenGL Shading Language?
« Reply #11 on: December 03, 2007 »
reading as Luminace is not the best way to do it. Most of the drivers do not convert to RGB to Luminance using a weighted sum, but rather just copy the red channel... pretty ugly. Shaders, shaders and shaders again. Nvidia and ATI manufactures have dropped consistent support of basic OpenGL functionalities, they all focus on shaders.
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart