Is this imposible?

BlitzMax Forums/OpenGL Module/Is this imposible?

JohnK(Posted 2007) [#1]
Hi! I want create 2D game, with shaders =)
Is this posible with OpenGl?


Drey(Posted 2007) [#2]
Yes, one way to do it is by using quads. Then have a set of textures and shaders activiated. Shaders are just programs ran by the GPU. "textures" and "vertices" can have more abstract meanings. You can line up a "height map" with your drawn image. Turn the height map into a normal map( for lighting ). Now you can have your color texture and also a normal map texture and have 2D lighting in your game :). Just realize that for every animation, you'll need a new height map( converted to normal map ). Double the work. This is part of the advanage of 3D graphics.

Good Luck!


JohnK(Posted 2007) [#3]
May be there an a example? =)


ImaginaryHuman(Posted 2007) [#4]
Not many examples around simply because not many people have been able to or interested in doing it so far. Be a pioener! Experiment.

You will need to look at using extensions, though, since these features are not supported in the standard version of OpenGL.


Michael Larson(Posted 2007) [#5]
Maybe you could build a nice shader builder UI in BlitzBasic and impress people, it would be a good tool to have.


simonh(Posted 2007) [#6]
Here's a good tutorial about using shaders for 2D games:

http://www.facewound.com/tutorials/shader1/

Not OpenGL-specific though.