Posted By: Andreas C
Issue with more than 8 dynamic lights ... - 02/19/09 10:50
I've created a simple level that contains some blocks and a number of MDLs (hallways).
I've placed around 20 dynamic lights in the level (inside the MDL-hallways).
The statistic panel shows 8 lights, never more than that.
Only eight lights are "turned on", all others are turned off.
I've tried adding lights at run time (linked to the "L"-key to add them individually). As soon as I add one, an existing one gets turned off.
I've set max_lights to 128 and have also compiled with the "create meshes" flag set.
Here's the code:
I'm using A7.66Pro, WinXP SP3, Nvidia 8800GTS 320MB - Treiber 6.14.11.8048 (Nov. 2008).
Any tips / help would be appreciated ...
I've placed around 20 dynamic lights in the level (inside the MDL-hallways).
The statistic panel shows 8 lights, never more than that.
Only eight lights are "turned on", all others are turned off.
I've tried adding lights at run time (linked to the "L"-key to add them individually). As soon as I add one, an existing one gets turned off.
I've set max_lights to 128 and have also compiled with the "create meshes" flag set.
Here's the code:
Code:
/**
* Blank user project.
*
*/
// Includes
#include "resources.h" // paths and file binds
#include <acknex.h>
#include <default.c>
#include <t7\t7.h> ///@t7
#include <t7\t7Camera.h> ///@t7 Camera code
#include <t7\t7GE.c> ///@t7 GEs
#include <t7\t7GEBiped.c> ///@t7 Biped
#include <t7\t7GEMovers.c> ///@t7 Doors, Lifts, and Platforms
#include <t7\t7GEPickups.c> ///@t7 Pickup items.
typedef struct {
VECTOR Lvec;
COLOR Lcol;
var LRange;
} Light_EntL;
Light_EntL DLights[20];
var NumRun = 0;
///////////////////////////////////////////////////////////////
action BlueLight()
{
wait(1);
}
void init_DLights ()
{
vec_set(DLights[0].Lvec,vector(-1497,-212,148));
vec_set(DLights[0].Lcol,vector(0,0,255));
DLights[0].LRange = 300;
vec_set(DLights[1].Lvec,vector(-813,-212,148));
vec_set(DLights[1].Lcol,vector(255,0,0));
DLights[1].LRange = 300;
vec_set(DLights[2].Lvec,vector(-377,-668,24));
vec_set(DLights[2].Lcol,vector(0,10,128));
DLights[2].LRange = 110;
vec_set(DLights[3].Lvec,vector(-377,-1216,148));
vec_set(DLights[3].Lcol,vector(0,255,64));
DLights[3].LRange = 110;
}
function placelight()
{
if (NumRun < 4)
{
you = ent_create(NULL, DLights[NumRun].Lvec, BlueLight);
you.lightrange = DLights[NumRun].LRange;
vec_set(you.blue,DLights[NumRun].Lcol);
NumRun += 1 ;
}
}
void main()
{
max_lights = 128;
init_DLights();
if(project_load("myProj.xml") == 0) // load up game from an xml file
{
sys_exit("Couldn't load myProj.xml");
}
on_l = placelight;
while(project_update() != 0)
{
wait(1);
}
sys_exit("Normal Exit");
}I'm using A7.66Pro, WinXP SP3, Nvidia 8800GTS 320MB - Treiber 6.14.11.8048 (Nov. 2008).
Any tips / help would be appreciated ...
