Shaders Example

BlitzMax Forums/BlitzMax OpenGL Programming/Shaders Example

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Heres an example I knocked up.
Note that it is ARB, and no Cg, or GLSlang etc. This should work on pretty much any card with basic vertex shaders (V1.0).

Its very rudimentary - you should be able to easily change the vertex shader loading into file based rather than string based - has been a while since I used blitz, so didnt bother looking how to do it ;)

For fragment shaders you can use almost the same setup as the vertex shaders, and using params etc is fairly simple. I'll update the example to be more complete when I have some time.

www.gagagames.com/Files/glcube_shader.bmx