I've got a problem with dlights that i just cant figure out. I have these physbullets that are fired from either an ent or a swep, if the bullet is a tracer it makes neat tracer effects and emits light through dlight, however every now and then when a tracer bullet is fired a dlight will stay there for a random ammount of time (See video).
Anyone know whats causing this or how to fix it?
The Function creating the light called every think
[CODE]
function ENT:MakeLight()
if !IsValid(self) or !self.valid then return end
if CLIENT then
local dlight = DynamicLight( self:EntIndex() )
if ( dlight ) then
local c = self:GetColor()
dlight.Pos = self:GetPos()
dlight.r = c.r
dlight.g = c.g
dlight.b = c.b
dlight.minlight = 0.001
dlight.Brightness = 0.16
dlight.Decay = 2000
dlight.Size = 512
dlight.DieTime = CurTime() + 0.5
end
end
end
[/CODE]
[video=youtube;ZmDnLQhTX-s]https://www.youtube.com/watch?v=ZmDnLQhTX-s&feature=youtu.be[/video]
Sorry to break it to you, but Source Engine only supports 32 DynamicLights. (I think that's the problem. The DynamicLights tent to render the newest ones first when this is the case.)
You have to render a few close ones and make 'fake' light-sprites in the distance.
[QUOTE=Nak;51228994]Sorry to break it to you, but Source Engine only supports 32 DynamicLights. (I think that's the problem. The DynamicLights tent to render the newest ones first when this is the case.)
You have to render a few close ones and make 'fake' light-sprites in the distance.[/QUOTE]
ok, i probably should have also mentioned that this problem did not exist prior to an addition of self:NextThink(CurTime()) to the entities initialization so the bullets would start calculating trajectories immediately.
I mean if you look at the video there are some instances where there may be more than 32 lights but at 0:06 you can see less than 10 rounds have been fired but the lights bug out.
Sorry, you need to Log In to post a reply to this thread.