Hey all!
I've been messing around with Shaders alot more and I finally got my Shader to work, but there is one problem. The Glow effect is not showing up on my object, when I use the the command that checks the Effect for errors I get this following message "dbGetVector4 does not exist." what can I do to fix this issue here is my code can someone help me with this issue? I am also using FX Composer like so many have told me to do.
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbBackdropOn ();
// Create a sphere and load a Texture
dbLoadImage ( "Media/Rocky_cliff_T.bmp", 1);
dbMakeObjectSphere ( 1, 10, 32, 32 );
dbTextureObject ( 1, 1 );
// Create another camera and set it's view
dbMakeCamera ( 1 );
dbColorBackdrop ( 1, 0 );
// Setup lighting
dbSetAmbientLight ( 80 );
dbPositionLight ( 0, 120, 0, 0 );
// Load the effect
dbMakeObjectPlane ( 2, 2, 2 );
dbLoadEffect ( "Media/Post_glow.fx", 1, 0 );
dbSetObjectEffect ( 2, 2 );
// Make a vector
dbMakeVector4 ( 1 );
dbSetVector4 ( 1, dbScreenWidth (), dbScreenHeight (), 0, 0 );
dbSetEffectConstantVector ( 2, "ViewSize", 1 );
dbDeleteVector4 ( 1 );
dbTextureObject ( 2, 0, 1 );
// Position the new Camera
dbPositionCamera ( 1, dbCameraPositionX ( 0 ),
dbCameraPositionY ( 0 ), dbCameraPositionZ ( 0 ));
dbRotateCamera ( 1, dbCameraAngleX ( 0 ), dbCameraAngleY ( 0 ),
dbCameraAngleZ ( 0 ));
// our main loop
while ( LoopGDK ( ) )
{
// Camer controls
dbControlCameraUsingArrowKeys ( 1, 0.5f, 2.0f );
// Allow for Bloom Intensity alteration
dbSetEffectConstantFloat ( 1, "BloomScale", 10.0f );
dbSetEffectConstantFloat ( 1, "BloomPower", 2.0f );
// Rotate the Object continuously and hide the plane
dbXRotateObject (2, dbObjectAngleX ( 2 ) + 1.0f );
dbHideObject ( 2 );
// Do some more things
dbShowObject ( 1 );
dbHideObject ( 1 );
dbShowObject ( 2 );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
Also to the devs on the Shaders Advanced tutorial there are a few commands that are not found they are as follows:
dbShaderDataStart, dbSyncCamera, dbLoadCameraEffect, dbSetCameraEffect, and dbSetCameraEffectConstantFloat
just thought I would let you know of these...