Neat trick with static entities and lighting
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Neat trick with static entities and lighting
Static entities never move. You can save a certain amount of BSP tree tracing at runtime by running them through R_LightPoint and saving out the surface and point they hit. Then just run the per-surface part of R_LightPoint again when it comes time to light the model (ent->efrag can be used to test if an entity is static in GLQuake as only static entities have efrags; in software Quake you'll need to add a flag or something). Don't forget to also add dynamic lights.
Depending on how many static entities you have in a scene the performance boost can be significant.
Depending on how many static entities you have in a scene the performance boost can be significant.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: Neat trick with static entities and lighting
Good information. I messed with makestatic (self) in QC a few times, but mistaked it for more or less a remove self.
mh wrote:Static entities never move. You can save a certain amount of BSP tree tracing at runtime by running them through R_LightPoint and saving out the surface and point they hit. Then just run the per-surface part of R_LightPoint again when it comes time to light the model (ent->efrag can be used to test if an entity is static in GLQuake as only static entities have efrags; in software Quake you'll need to add a flag or something). Don't forget to also add dynamic lights.
Depending on how many static entities you have in a scene the performance boost can be significant.
-

Cobalt - Posts: 445
- Joined: Wed Jun 10, 2009 2:58 am
- Location: New England, USA
Re: Neat trick with static entities and lighting
heh, aye, many QW clients hide static ents to gain a tiny bit of fps, can easily see how makestatic might be equivelent to remove.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Neat trick with static entities and lighting
I messed with the code opee made for nails [ er spike? ] sticking in the walls today....kind of clever. Its got a think that removes the nail after a time, but I thought, why not just make it static, that way its not going to be included in the packet and wil reduce chances of overflow, but when I tested the code, the nail was nt visible, much less stuck in the wall. Then I remembered LH telling me makestatic
wont show the entity up to any client currently conected, but any client connecting after its made static will see it. So I reconnected and could see them stuck all over. Some of my code performs ricochets if its not gonna stick, and they still are live when dropped to the floor, so if you walk on them (ouch!). If you have armor on they disarm after the first touch. Kinda neat for teamplay if you want to protect a certain item, like a flag...heh. Lots of ppl complain that the nailgun is a useless weapon compared to the others.
wont show the entity up to any client currently conected, but any client connecting after its made static will see it. So I reconnected and could see them stuck all over. Some of my code performs ricochets if its not gonna stick, and they still are live when dropped to the floor, so if you walk on them (ouch!). If you have armor on they disarm after the first touch. Kinda neat for teamplay if you want to protect a certain item, like a flag...heh. Lots of ppl complain that the nailgun is a useless weapon compared to the others.
Spike wrote:heh, aye, many QW clients hide static ents to gain a tiny bit of fps, can easily see how makestatic might be equivelent to remove.
-

Cobalt - Posts: 445
- Joined: Wed Jun 10, 2009 2:58 am
- Location: New England, USA
Re: Neat trick with static entities and lighting
Cobalt wrote:I messed with the code opee made for nails [ er spike? ] sticking in the walls today....kind of clever. Its got a think that removes the nail after a time, but I thought, why not just make it static, that way its not going to be included in the packet and wil reduce chances of overflow, but when I tested the code, the nail was nt visible, much less stuck in the wall. Then I remembered LH telling me makestatic
wont show the entity up to any client currently conected, but any client connecting after its made static will see it. So I reconnected and could see them stuck all over. Some of my code performs ricochets if its not gonna stick, and they still are live when dropped to the floor, so if you walk on them (ouch!). If you have armor on they disarm after the first touch. Kinda neat for teamplay if you want to protect a certain item, like a flag...heh. Lots of ppl complain that the nailgun is a useless weapon compared to the others.Spike wrote:heh, aye, many QW clients hide static ents to gain a tiny bit of fps, can easily see how makestatic might be equivelent to remove.
you can make it to where they dont hurt you when you touch them, i forget how i did it back when i was messing with them.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
5 posts
• Page 1 of 1
Return to Programming Tutorials
Who is online
Users browsing this forum: No registered users and 1 guest