Hue/Saturation of a picture

Previous topic - Next topic

acristo

Is there anyway of changing the hue/sat of picture on GLBasic ?
Technical information bellow.
http://en.wikipedia.org/wiki/Hue

Sebastian

You have 2 ways:

1. read every pixel, change the pixel and write the changed pixel -> to slow for realtime
2. do it via shaders

tictac

Can I apply shaders in a 2D game? (I'm sorry for the question, but I'm a GLBasic beginner!)
-Alessandro

Kitty Hello

Yes, of course. All GLBasic commands (on Win32, Mac and Linux) take full advance of the X_SETSHADER command. It's quite stupid that it starts with "X_", though.
Should I change that, maybe?

tictac

Sounds good!

Thank you!
-Alessandro

acristo

great thank you.. I don't think you have to change it,now that i know it works for 2d it is fine to me :)

tictac

Hello,

about function name...
I think the only problem is typing it! In fact, even if some functions are self explicative, sometimes they are "hard" to be typed.
Putting a prefix like "x_" is not very keyboard-friendly when one write a big program.
Some languages use "-" (many functional languages do that!), but it is not feasible to every language parser.
Maybe you could use "xSetShader" (even if the language is not case sensitive, it could be more readable than X_SETSHADER).

However, about the function name, if I read "X" I think to something related to "DirectX" (my first approach). But GLBasic does not use DX, so...
(maybe "X" stands for "graphiX" ;-)  )

Ciao!
-Alessandro

Kitty Hello

X_ is for "3D eXtension". Anyway.
Oh, where is the "_" on the us keyboard? On a German keayboard it's like writing "M", but only 3 keys further to the right.

tictac

On US keyboard or on Italian keyboards the symbol "_" it should be printed using SHIFT key (it is under the symbol "-").
Sometimes its typing is very annoying.

Thank you!
-Alessandro