View Full Version : A Question to Coders
NewSith
2013-02-02, 05:21 PM
Is it actually possible to make it so that everything not in your LoS doesn't render?
(As in doesn't visually render, not physically)
I'm just curious, since I am not really educated in that regard, but, seeing how I get 15 fps by looking at Zurvan and 50 by looking away from it, I wonder...
When you look away from zurvan the game is rendering in this order (aproximatley) some sand scenery(sand dunes), some flora (trees and flowers), some sky, a weather effect and the HUD.
When you look at Zurvan the game is rendering all that ^^ plus the buildings, jump pads, terminals, sheilds etc.
And both these scenarios assumed no players.
Its quite easy for me to take your position and compare it with another position, decide its over 6000M away and not decide to render it. Its more complex to do that with 1999 other players. Its also pretty trivial to work out if theres something in the way blocking the view. More complex if im expected to draw both objects, 1 behind the other and stupidly complex with 1999 other players, all the bases, outposts, scenery, flora, weather, lights.
Depending on your CPU, its generation, its "overclockedness" and your GPU you may find that your fps can be improved greatly by altering the shadows, particles, render quality and the new render distance setting.
It could also just be that the new patch is foobar and your one of the large number of people with new and improved fps problems.
I was able to run most settings on HIGH pre patch with shadows and particles on medium. Ive had to drop to most on medium with shadows and particles on low to achieve the same fps and im still getting random fps spikes (from high to low) and also some kind of graphics stuttering.
NewSith
2013-02-02, 05:47 PM
When you look away from zurvan the game is rendering in this order (aproximatley) some sand scenery(sand dunes), some flora (trees and flowers), some sky, a weather effect and the HUD.
When you look at Zurvan the game is rendering all that ^^ plus the buildings, jump pads, terminals, sheilds etc.
And both these scenarios assumed no players.
Its quite easy for me to take your position and compare it with another position, decide its over 6000M away and not decide to render it. Its more complex to do that with 1999 other players. Its also pretty trivial to work out if theres something in the way blocking the view. More complex if im expected to draw both objects, 1 behind the other and stupidly complex with 1999 other players, all the bases, outposts, scenery, flora, weather, lights.
Depending on your CPU, its generation, its "overclockedness" and your GPU you may find that your fps can be improved greatly by altering the shadows, particles, render quality and the new render distance setting.
It could also just be that the new patch is foobar and your one of the large number of people with new and improved fps problems.
I was able to run most settings on HIGH pre patch with shadows and particles on medium. Ive had to drop to most on medium with shadows and particles on low to achieve the same fps and im still getting random fps spikes (from high to low) and also some kind of graphics stuttering.
No, this was actually a curiosity question, rather than a question "Why does my game lag?"
The questuion was - does the technology allow games to only render what's on player's screen (so the game doesn't render the back of a building if I don't see it)?
cKerensky
2013-02-02, 05:53 PM
Is it actually possible to make it so that everything not in your LoS doesn't render?
(As in doesn't visually render, not physically)
I'm just curious, since I am not really educated in that regard, but, seeing how I get 15 fps by looking at Zurvan and 50 by looking away from it, I wonder...
The game already does this to an extent. Certain objects (most likely terrain, perhaps some rocks) block your LoS. The game does some simple math and doesn't render what's behind the rock. If this didn't happen, the game wouldn't really run at all.
It gets more unique, however, when you are behind, say, a base wall. Since you can only do damage to something your client can "see", it can't cull away stuff that you could theoretically hurt. So those 20 guys on the other side of the base wall have to render for you, even if you can't see it, otherwise you can't hurt it.
Client side hit detection 4 the win. It's what makes the game feel responsive, but has the nasty side effect of making it feel "laggy" if you're on the receiving end (such as when you duck behind a wall and still get shot "through" it). It's got to be this way, otherwise the servers would collapse under their own weight.
So, that said, the game doesn't render whatever is behind you, but you certainly can hit them (with, say, a grenade), so the game's got some smarts there.
Basically, the answer is more complex, and boils down to "sometimes the game does what you're asking." It may not render the objects, but to your computer, they're still there.
If you're looking for some more reading on the subject, look up something called Binary Spacial partition, or BSP. Half life games name their map files after this (or did at one point, anyway).
In essence, it pre-calculates what you can see from each location, breaks the game world down into "view cubes", and determines what other cubes you can see from this cube. It makes determining LoS calculations very quick (but these BSPs have to be computationally added before hand, and they're very CPU intensive to do)
Mietz
2013-02-02, 05:56 PM
Is it actually possible to make it so that everything not in your LoS doesn't render?
(As in doesn't visually render, not physically)
I'm just curious, since I am not really educated in that regard, but, seeing how I get 15 fps by looking at Zurvan and 50 by looking away from it, I wonder...
Yes, absolutely.
(3D Graphics Designer here)
It's called "occlusion culling".
Most games/engines employ some technology where anything not visible in your LOS does not render.
However the efficiency depends entirely on the technology and parameters used. Most engines come with an internal culling system, however there are other software solutions as middleware.
Here is an explanation for Umbra 3, used in Alan Wake/ME2/Dragon Age:
Umbra 3 Runtime presentation - automated software occlusion culling - YouTube
However I have no idea how PS2 handles its culling.
Tatwi
2013-02-02, 06:13 PM
SOE used an early version of Umbra in SWG, which is why most buildings have "switch backs" in the doorways to remove line of site to the interior. Later on the game was updated to allow transparent textures (glass) to also function as a line of sight block. Anyhow, I am sure SOE is using something like this in Forgelight, as it is fundamental these days.
NewSith
2013-02-02, 06:15 PM
SOE used an early version of Umbra in SWG, which is why most buildings have "switch backs" in the doorways to remove line of site to the interior. Later on the game was updated to allow transparent textures (glass) to also function as a line of sight block. Anyhow, I am sure SOE is using something like this in Forgelight, as it is fundamental these days.
It's just that I remember that in PS1, when doors started closing sometimes whatever was behind them stopped graphically rendering and you could see grey nothing on the other side of the door frame before the two door panels joined together...
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.