Hi.
I have a problem with camera IDs.
In the "Advanced Shader Turorial" I try to change the new Camera's ID to other number in the whole source and it isnt work :S
But if the camera ID is 1 it works correct. Why?
#include "DarkGDK.h"
#include "ShaderData.h"
void DarkGDK ( void )
{
int CamID = 1;
dbSyncOn ( );
dbSyncRate ( 60 );
// prepare the shader functions
dbShaderDataStart ( );
// make a sphere, load an image and texture it
dbMakeObjectSphere ( 1, 10 );
// switch autocam off
dbAutoCamOff ( );
// make a camera and color the backdrop to 0
dbMakeCamera ( CamID );
dbColorBackdrop ( CamID, 0 );
// load an effect for the camera
dbLoadCameraEffect ( "Bloom.dbs", 1, 0 );
dbSetCameraEffect ( CamID, 1, 1 );
// make a plane and set the quad effect for it
dbMakeObjectPlane ( 2, 2, 2 );
dbLoadEffect ( "quad.fx", 2, 0 );
dbSetObjectEffect ( 2, 2 );
// set up properties for our quad effect
dbMakeVector4 ( 1 );
dbSetVector4 ( 1, dbScreenWidth ( ), dbScreenHeight ( ), 0, 0 );
dbSetEffectConstantVector ( 2, "ViewSize", 1 );
dbDeleteVector4 ( 1 );
dbTextureObject ( 2, 0, 1);
// ensure camera (camid) is set to same position and rotation as camera 0
dbPositionCamera ( CamID, dbCameraPositionX ( 0 ), dbCameraPositionY ( 0 ), dbCameraPositionZ ( 0 ) );
dbRotateCamera ( CamID, dbCameraAngleX ( 0 ), dbCameraAngleY ( 0 ), dbCameraAngleZ ( 0 ) );
while ( LoopGDK ( ) )
{
dbTurnObjectLeft ( 1, 0.1 );
dbHideObject(1);
dbHideObject ( 2 );
dbShowObject ( 1 );
dbSyncCamera ( CamID );
dbHideObject ( 1 );
dbShowObject ( 2 );
dbSync ( );
}
}
chill