Is this imposible?
BlitzMax Forums/OpenGL Module/Is this imposible?
| ||
Hi! I want create 2D game, with shaders =) Is this posible with OpenGl? |
| ||
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! |
| ||
May be there an a example? =) |
| ||
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. |
| ||
Maybe you could build a nice shader builder UI in BlitzBasic and impress people, it would be a good tool to have. |
| ||
Here's a good tutorial about using shaders for 2D games: http://www.facewound.com/tutorials/shader1/ Not OpenGL-specific though. |