Shading

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Benjamin100
ES Beta Backer
ES Beta Backer
Posts: 250
Joined: Tue Jul 19, 2011 9:37 pm

Shading

Post by Benjamin100 »

I don't understand how to use GLSL to create shading.
Is there any resource I can use that explains how to do it for people who don't know the mathmatical terms?
It appears it involves advanced calculations.
Can this be easy to understand, or is there an easier way of doing it?
I don't understand what needs to be calculated.

Thank you,

-Benjamin
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: Shading

Post by short »

Um, it's basically purely math based. Sorry, if you want to do more then just setting a color then you need the math.

I can give you the best tutorial I have seen on getting introduced to it,

http://www.arcsynthesis.org/gltut/

In current OGL there are five different shades to learn, however I suggest you start with the fragment/vertex shaders, they are the easiest to understand.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Shading

Post by superLED »

I guess you'll be looking forward to thecplusplusguy's tutorials that will be up soon.
He will be going over this exact topic.
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Shading

Post by Ginto8 »

GLSL is basically a way of taking the old-fashioned, restrictive fixed-function pipeline, throwing it out, and putting whatever you want in its place (with certain restrictions). For example, with OpenGL 4, there are 5 different stages of the graphics pipeline which you can program: 2 controlling tesselation, 1 working with primitives as they come through the pipeline, 1 dealing with vertices as they come through the pipeline, and 1 dealing with fragments (basically "pixel candidates" - they may or may not actually become pixels).

This approach gives tremendous flexibility and control to graphics programmers, but with great power comes great responsibility. You have to understand what's happening, and that can take some work. Be careful, but don't be afraid of the math - it's actually some very interesting stuff.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Benjamin100
ES Beta Backer
ES Beta Backer
Posts: 250
Joined: Tue Jul 19, 2011 9:37 pm

Re: Shading

Post by Benjamin100 »

Thanks guys.

-Benjamin
Post Reply