I'm a long time user of DarkBasic, DarkBasic Pro, and recent user of Dark GDK. I'm not very good at it, but DB has been an enjoyable intro to game programming. I recently switched over from Pro to DGDK, since my classes at college deal with C/C++.
I'm new to shaders, and am having trouble using them in DGDK, more specifically what commands to use when. There seem to be a lot:
dbCreateVertexShaderFromFile
dbCreatePixelShaderFromFile
dbLoadEffect
etc...
I don't know which of these commands to use, basically. I don't have Dark Shader, so I need to use shaders without it. For starters, I downloaded some shaders from NVIDIA's library found at: http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html
In addition to not knowing which commands to use in GDK to apply shaders to objects or matrices, any progress I've made in applying a shader to an object has been met with DGDK crashing in the usual "has stopped working" fashion. From what little I understand about shaders, .DDS files are the textures, and the .fx or .cgfx files actually "shade" the .DDS textures. However, the game always crashes when I attempt to apply the shader effect (using "dbSetObjectEffect(51,52)").
Here's the code I've been trying to use that causes a crash:
dbMakeObjectPlane(51,5000,5000);
dbLoadEffect("waves/Shading.fx",52,0);
dbLoadImage("waves/Waves.dds",53);
dbTextureObject(51,0,53);
dbLoadImage("waves/Sky.dds",54,2);
dbTextureObject(51,1,54);
dbLoadImage("waves/Sea.dds",55,2);
dbTextureObject(51,2,55);
dbSetObjectEffect(51,52);
If someone could enlighten me on the basics of applying shaders in DGDK without the use of Dark Shader, I would appreciate it. I'm not looking for tutorials on how to write shaders from scratch (yet), just how to take an already existing shader and apply it to a surface with the DGTK commands as simply as possible.
tl;dr -> how do I use a shader on an object in DGDK?