problem with lights

Posted By: JoGa

problem with lights - 04/28/12 16:54

Hey!
I have got a "little" problem with my lights.
"little" because it is no huge problem, but something, I can't understand, why it is happening.

So, here it is:
I have some lights via script on entities in my game.
Click to reveal..
Code:
function Kohlenpfanne01()
{
	while(!player)	wait(1);
	set(my, INVISIBLE);
	my.lightrange = 100+random(100);
	my.red = 170;
	my.green = 170;
	my.blue = 20;
	set(my, CAST);
	int flackern;
	int aufflackern	=	1;
	int schrumpfen		=	2;
	while(1)
	{
		if(my.lightrange < 100)	flackern	=	aufflackern;
		if(my.lightrange > 200)	flackern	=	schrumpfen;
		
		if(flackern == aufflackern)
			my.lightrange	+=	(4+random(2)) * time_step;
		if(flackern == schrumpfen)
			my.lightrange	-=	(4+random(2)) * time_step;

		effect(p_kohlenpfanne_feuer,my.lightrange/80,my.x,NULL);
		if(vec_dist(player.x, my.x) > 1000)		my.lightrange = 0;
		wait(1);
	}
}


They increase and decrease their lightrange.
I press 2 times F11 to see the radius with the yellow cubes ingame.
If I change the camera-angle, there appear some other yellow cubes, suddenly.
I don't know why. Did this happened to you, too or do you know why this happen?

Here a picture for better clarity.
first: the scene without F11, second the scene with 2xF11, third the scene with 2xF11 and a different camera-angle:

Posted By: 3run

Re: problem with lights - 04/28/12 17:09

May be you need to apply Per Pixel Lighting shader to the terrain, that might help, just a quick idea.
Posted By: JoGa

Re: problem with lights - 04/30/12 11:55

I deactivated the terrain-shader and added a pp-Lighting shader, but the boxes appears, too.

Anyway, thanks for that idea laugh
Posted By: Aku_Aku

Re: problem with lights - 05/01/12 11:30

Take a look at this: default.c
Search for F11, that could give an answer...
Posted By: JoGa

Re: problem with lights - 05/01/12 11:44

thanks for your answer, but I don't know, where the answer in your link is.
I searched in default.c, too and the num_lights (which is shown in the def_debug_pan is at this point in my level 4. So the yellow boxes around my 4 lights are okay, but I don't know, what the others are for. As mentioned above, there are no other lights.
is there some description about these yellow boxes, I missed?
Posted By: Aku_Aku

Re: problem with lights - 05/01/12 12:14

On the mentioned default.c page you can find this, when you search for F11:
Quote:
[F11] Activates a Statistics Panel (see below) that displays some predefined variables and other information. [F11] pressed a second time causes level and terrain polygon tesselation to be highlighted by red lines, and the bounding boxes of non-passable entities by a blue wireframe.

Unfortunately there is no any word for yellow lines or wireframes.
© 2024 lite-C Forums