I've found these commands in
DarkSDKBasic3D.h:
void dbAddObjectToLightMapPool ( int iID );
void dbAddLimbToLightMapPool ( int iID, int iLimb );
void dbAddStaticObjectsToLightMapPool ( void );
void dbAddLightMapLight ( float fX, float fY, float fZ, float fRadius, float fRed, float fGreen, float fBlue, float fBrightness, bool bCastShadow );
void dbDeleteLightMapLights ( void );
void dbCreateLightMaps ( int iLMSize, int iLMQuality, char* dwPathForLightMaps );
Does anybody know if they work?
I always get a runtime error as soon as my program reaches
dbCreateLightMaps!
Here is the sample:
#include "DarkGDK.h"
// main entry point
void DarkGDK ( void )
{
// setup
dbSyncOn ( );
dbSyncRate ( 60 );
dbAutoCamOff();
dbBackdropOn();
// objects
int floor = 1;
dbMakeObjectBox( floor, 100, 2, 100 );
int ball = 2;
dbMakeObjectSphere( ball, 5 );
dbPositionObject( ball, 10, 5, 10 );
int box = 3;
dbMakeObjectBox( box, 10, 20, 10 );
dbPositionObject( box, -20, 10, 5 );
int box2 = 4;
dbMakeObjectBox( box2, 10, 30, 10 );
dbPositionObject( box2, -15, 10, 10 );
dbPositionCamera( 0, 10, -50 );
// create lightmaps
dbAddObjectToLightMapPool( floor );
dbAddObjectToLightMapPool( ball );
dbAddObjectToLightMapPool( box );
dbAddObjectToLightMapPool( box2 );
dbAddLightMapLight( -50, 100, 50, 200, 80, 80, 80, 1, 1 );
dbCreateLightMaps( 64, 8, "" );
// main loop
while ( LoopGDK ( ) )
{
// input
dbControlCameraUsingArrowKeys( 0, 1, 1 );
if ( dbSpaceKey() )
{
}
// update screen
dbSync ( );
}
// return to windows
return;
}
Please take into account that I'm not using DarkLights. I just found these commands in a DGDK header and thought it would be great if they would work.
Do they work for you?
Are they even really included?
Do I have to buy DarkLights to have lightmapping functionality?
Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.