minib3dext shader help
BlitzMax Forums/MiniB3D Module/minib3dext shader help
| ||
Can someone please help me with the shader commands. Some code will help a lot. Thanks! regards Sveinung |
| ||
we are waiting for klepto2's new release i think. (for me I have been way too busy to think straight!) when things settle down I will resume my posting of useless code. hang in there :) |
| ||
Here is a rather helpful pile of information: http://groups.google.com/group/minib3d-discussion/web/shaders-glsl I didn't write that to teach how to make hardware shaders, but rather to help people find information. I'm rather new to them, too, so I can't teach much! Have you found Klepto2's shader example? (Simon's sliding collisions demo, with a shader applied). Here it is: http://minib3d-unstable.googlecode.com/files/ShaderExample_SlidingCollisions.zip You may need to change the Import lines in the source file, but maybe not :) Quoting myself from an eariler thread: Klepto2's implementation of hardware shaders is really clean and easy to sort out. If you play with his example for a while, it starts to make some sense. There aren't an awful lot of functions involved; it's more a matter of seeing how people do it, of which there are many examples / tutorials. One important thing to be aware of is that it's all about sending values from your program to the shader program running (quite alone) on the hardware. That's where a really awesome engine makes it all easier via helper functions. (Automatically passing information that the shader will need, for example). GLSL shaders give you a few helper functions and have lots of constants / variables / data types, but it is nothing like DrawRectangle or CreateSphere. Think of this like writing functions in a DLL, where you are pretty much stuck with whatever values were passed as arguments and where (since it is the tidy way!) each individual function doesn't do a huge amount. Also, know that you are changing individual pixels or vertices, not creating things. I do not know the good way to explain this without driving someone crazy, so hopefully the tutorials linked by the article above will help. |