Problem with hardware lights

Blitz3D Forums/Blitz3D Programming/Problem with hardware lights

Billp(Posted 2007) [#1]
I am in the process of writing a game using dynamic dx lights and have run into a problem, the level is divided into a matrix of 5x5 meshes and some are not lighting properly, visually it appears that the normals are not properly pointed, but they are correctly shown in my modeller (AC3D), i have tried flipping the normals via ac3d, UpdatingNormals, Flipmesh and disabling backface culling via blitz but to no avail and am fairly confident the problem isn't my code as all but 2 or 3 zones are working fine. anyway any help would be appreciated

all lights are spot lights rotated to point to the floor, iI have tried increasing the range and adjusting the light cone angles but only some surfaces are lit

heres a properly lit zone


one i'm having problems with


the same zone using a point light to show the problem


Thanks Bill


cash(Posted 2007) [#2]
Don`t know if I can help, however I was getting strange lighting issues on one of my games and it turned out o be something to do with the level itself.

I rewelded all vertexes and smoothed and it seemed to fix it.

Probably not exactly your problem but may be a start.


Billp(Posted 2007) [#3]
Yeah, thats what im thinking, that the mesh itself is gacked, just hoping someone will come up with something I haven't tried


Stevie G(Posted 2007) [#4]
I'm assuming that you know of the DX limit on hardware lights is 8. Are you hiding and showing them depending on which zone you're in? If not, breaching this limit may be your issue.


Ross C(Posted 2007) [#5]
Don't you have to actually move the lights Stevie? Might be a bad memory but i recall only the first 8 created, actually working, regardless of how many created.

@ Billp, Have you tried segmenting level mesh more? Or rewelding as suggested above?


Billp(Posted 2007) [#6]
Ross & Stevie G

I am checking a series of bounding boxes to determine which lights would be visible & am freeing and recreating lights as needed, you can't read the text at the top but there are 5 active lights in the scene. also the mesh is composed of quads 1x1 blitz units across mapped to a single texture so segmentation is uniform through out

Will try rewelding tho, that sounds promising

Thanks guys I appreciate your help


big10p(Posted 2007) [#7]
If this problem is due to borked normals, this may help you confirm it.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1085


Billp(Posted 2007) [#8]
I figured out the problem. ..... I'M AN IDIOT !
when I created my zones the modeler centered them on 0,0,0 of course, after creating them I decided to shift the whole deal in order to make calculating the current zone easier ( ie. CurrentZone = 5*EntityZ(camera)/10+EntityX(camera)/10 ) and although I moved the meshes to compensate I apparently forgot to recenter the object centers on a few of the zones, just realized it when in my light editor, the light's position beared no relation to where the camera was.
I assumed the problem had to be with the geometry since my proggy recursively scanned the model itself and positioned the dx lights were the light meshes were located.

you know what they say about assuming lol

Thanks again for all of your input


Dreamora(Posted 2007) [#9]
You are a programmer, you should know that an assumption is normally the start to a very long chain of "fixing problems" ;-)