No rendering behind objects blocking line of sight
-
Leopardi
- Posts: 409
- Joined: 2007-10-16 21:14
No rendering behind objects blocking line of sight
FH2 introduced one of these, which helped my performance in urban maps hugely. Implementing this could greatly help the framerate issues on urban maps like Fallujah.
-
Rudd
- Retired PR Developer
- Posts: 21225
- Joined: 2007-08-15 14:32
-
Dunehunter
- Retired PR Developer
- Posts: 12110
- Joined: 2006-12-17 14:42
Re: No rendering behind objects blocking line of sight
Rudd, answering in an unapproved thread won't do much good 
[R-MOD]Jigsaw] I am drunk. I decided to come home early because I can''t realy seea nyithng. I hthknk i madea bad choicce.
-
killonsight95
- Posts: 2123
- Joined: 2009-03-22 13:06
Re: No rendering behind objects blocking line of sight
I'm assuming you would use python, or similar, to allow the server to read where the player is looking and tell the client to only render everything in that area and not the full 360.
ATM our computers have a full 360 view when we walk around, and not just a view of what's in front of us, this increases the amount of object etc. on the screen by at least 3 times as many.
However, I'm just assuming that's what he means.
I still have no idea how it could be done though.
ATM our computers have a full 360 view when we walk around, and not just a view of what's in front of us, this increases the amount of object etc. on the screen by at least 3 times as many.
However, I'm just assuming that's what he means.
I still have no idea how it could be done though.

-
TheComedian
- Posts: 677
- Joined: 2011-01-08 13:46
Re: No rendering behind objects blocking line of sight
I think the dev team would have noticed something like this if it was of concern to the mechanics of PR.
[img]http://www.realitymod.com/forum/uploads/signatures/sigpic52084_1.gif[/img]
-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: No rendering behind objects blocking line of sight
source?Leopardi wrote:FH2 introduced one of these
-
Zoddom
- Posts: 1029
- Joined: 2008-02-11 15:29
Re: No rendering behind objects blocking line of sight
OP is trolling, cant find any sauce on the Fh2 page, newest news are about new shaders with color correction (which is awesome i guess).
but if it was possible i would say lets do it and have a 4km urban map.
but if it was possible i would say lets do it and have a 4km urban map.
-
Rudd
- Retired PR Developer
- Posts: 21225
- Joined: 2007-08-15 14:32
Re: No rendering behind objects blocking line of sight
it does when my collegues can see it[R-DEV]Dunehunter wrote:Rudd, answering in an unapproved thread won't do much good![]()
shame this is probably a BS thread
-
killonsight95
- Posts: 2123
- Joined: 2009-03-22 13:06
Re: No rendering behind objects blocking line of sight
However has this been explore'd yet? just ebcause his claims that FH2 has it were false doesn't mean it's not possible.
I know BF2 can register which direction you are looking in. So could this be used to only render something in a "cone" in front of the player were the client registers the buildings?
I know BF2 can register which direction you are looking in. So could this be used to only render something in a "cone" in front of the player were the client registers the buildings?

-
Zoddom
- Posts: 1029
- Joined: 2008-02-11 15:29
Re: No rendering behind objects blocking line of sight
but otherwise, when youre moving fast it could end up in hard fps drops, because it has to render everything very fast. just like in minecraft^^
-
killonsight95
- Posts: 2123
- Joined: 2009-03-22 13:06
Re: No rendering behind objects blocking line of sight
But now doesn't it do that anyway when mvoing fast ina forward motion? but in 360 and not 75 degrees?

-
TheComedian
- Posts: 677
- Joined: 2011-01-08 13:46
Re: No rendering behind objects blocking line of sight
Scenario:
Walking through Ramiel city. Turning 180 degrees, huge performance drop of rendering all that garbage on the streets and the sheer amount of statics.
Now turn 180 more degrees, you still face the original direction but you gain nothing other than extreme lag (critical in a firefight)
Walking through Ramiel city. Turning 180 degrees, huge performance drop of rendering all that garbage on the streets and the sheer amount of statics.
Now turn 180 more degrees, you still face the original direction but you gain nothing other than extreme lag (critical in a firefight)
[img]http://www.realitymod.com/forum/uploads/signatures/sigpic52084_1.gif[/img]
-
Sniperdog
- Retired PR Developer
- Posts: 1177
- Joined: 2009-02-27 00:06
Re: No rendering behind objects blocking line of sight
It is easy to figure out which way the player is looking from the memory but I have not really heard of anyone tampering with BF2's rendering engine. FYI you can NOT do this with python b/c the python in bf2 runs on the server, not on the client.


Will Stahl aka "Merlin" in the Squad community
-
pr|Zer0
- Posts: 300
- Joined: 2008-06-30 12:10
Re: No rendering behind objects blocking line of sight
not rendering objects blocking LOS could be the entrance of the LAG on sudden turns, especially on lower end machines...could backfire

-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: No rendering behind objects blocking line of sight
Actually what the OP might be referring too is something called "Occlusion Culling" which is supported by BF2 but I never had a play with it. More info from Remdul here:

More something for the new statics we are making
But if the OP is talking about the way the Crisis engine works and trying to get BF2 to work that way, there is no hope in hell of doing that
I do plan on looking into this some what but I can't see anyone going over all our old statics and doing this, unless anyone from the community is willing to do it'Remdul' wrote:BF2 supports hardware occlusion culling. Occlusion culling works like this: before rendering the world, you first render a bunch of boxes in place of large object (such as buildings). These are the occlusion meshes, they are highly simplified models that fit tightly inside the visible model. Once this is all rendered, you have a simple scene. It is only rendered to the z-buffer, since this is all we need to do occlusion tests.
Then before rendering all full detailed meshes (which we call the 'occludee' as opposed to 'occluder'), we take the bounding box (a box that completely encompasses the visible mesh) and render this to the scene, with occlusion testing mode enabled. When occlusion testing mode is enabled, the GPU doesn't actually draw anything, it only counts the number of pixels that would have been visible if it were rendered. This number is then passed back, and the game can then determine whether the object will be visible and needs to be rendered or not. If zero pixels were counted, it means it is fully obscured by one or more occluders. If a number of pixels are counted, then the object is partially or fully visible, and we must render the full detail mesh.
It seems a bit counter-intuitive at first, since we are now rendering more stuff, but typically, there's at least a few objects obscured (thus drawcalls are skipped), and because we only render very simple occlusion models the added overhead is negated.
I have tested this in FH2 in dense urban levels such as Anctoville and Ramelle, and it improves the framerate in some areas considerably. For example, if one stands up to the wall of a building with an occluder, the framerate goes up and maxes out, while it would normally stay very low. Do keep in mind though, that in open areas, e.g. looking down from a tower over a dense city, occlusion culling may not be effective enough to cull away large buildings. Overhead seems negligible, so I can only recommend it if your mod has performance issues in these situations.
Keep in mind that occlusion meshes should only be created for large closed structures. It will not help for objects smaller than 3x3x3 meters, these rarely obscure other objects and only add overhead. For open buildings, it depends on the model whether it is worth creating an occluder for.
Take for example a typical parking garage. The walls are open and you can look through. The pillars are thin and bad occluders, however the floors and ramps make good occluders. In this case you can add a quad in inside the floors, so that cars above and below the player's level are entirely culled away.
If an open house has at least one closed wall, stick a polygon in there as well.
I suggest taking a look at the BF2 .occ files for good examples.
I think I will add an example scene so you can see how it fits into the export hierarchy.
More something for the new statics we are making
But if the OP is talking about the way the Crisis engine works and trying to get BF2 to work that way, there is no hope in hell of doing that
-
zenarion
- Posts: 56
- Joined: 2010-02-15 12:47
Re: No rendering behind objects blocking line of sight
If there are source meshes left of the statics, you could write a script that would batch process the model files. Come to think of it, I don't think you even need the source meshes, just have a grip on how vertex data is stored in the model files, feed it into a converter, that would create occluders based on it, then save the occluders with a /*filename*/+_occlusionmesh.
For the more complex meshes (some buildings etc) you might need to make them manually. Not that big of a deal either really.
So yeah, do you have a technical artist?
For the more complex meshes (some buildings etc) you might need to make them manually. Not that big of a deal either really.
So yeah, do you have a technical artist?
In-game: molcandr
-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: No rendering behind objects blocking line of sight
Just taking a look at some of the vBF2 .occ meshes now and they are simpler than I thought they would be, literally just a box 
Also surprised at how few there are in vBF2, only 35 objects have them...
Also surprised at how few there are in vBF2, only 35 objects have them...
-
mockingbird0901
- Posts: 1053
- Joined: 2009-05-13 17:30
Re: No rendering behind objects blocking line of sight
So.... In total, good news?[R-DEV]Rhino wrote:Just taking a look at some of the vBF2 .occ meshes now and they are simpler than I thought they would be, literally just a box
Also surprised at how few there are in vBF2, only 35 objects have them...
Or just nothing spesial?
-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: No rendering behind objects blocking line of sight
I really need to explore it more but it dose sound like something that would be overall very beneficial to PR.mockingbird0901 wrote:So.... In total, good news?
Or just nothing spesial?
-
Tarranauha200
- Posts: 1166
- Joined: 2010-08-28 20:57
Re: No rendering behind objects blocking line of sight
So its not bs tread after all.






