Author Topic: Occlusion bricks  (Read 991 times)

Could there be bricks that occlude bricks/emitters/lights.  In other words make it so you can't see the stuff behind the brick freeing up computer graphics resources and increasing frame-rate.  Would be awesome for  builds with an immesnse number of bricks in a small area or for creating "cloaked" bases.

I think the game already does this, more or less.

I think the game already does this, more or less.
No, it doesn't. Transparent bricks will occlude light flares and most emitters, but not bricks. Same for solid bricks.

This is actually a good idea, and I would very much like to see it ingame, but would be hell, both to script and to run, due to the fact that if you were to place, say, a 1x5x4 (wall brick 4 studs wide, 5 bricks tall), the client would have to stop rendering all the bricks behind the occlusion brick. Said brick would have a relayed script to calculate what the player's perspective sees as "behind the brick", using the player's position and rotation, as well as the brick's own. I'm not sure how this would work, due to brick datablocks being on an alignment grid, whereas player/bot/vehicle/weapon datablocks are not grid-aligned.

Something similar to zone bricks might work more efficiently in this case, making a check on what bricks are within the zone of occlusion (or outside of it). However, it will still have to constantly relay this script, causing a ton of client lag or desynchronization; this would most likely leave you at a worse framerate/resource usage than before.

Even with all the logic I've provided, I would actually still like to see this in some way that wouldn't be hard on the engine/resources.

I think the game already does this, more or less.

I don't think it does because when I look the a wall that has a ton of bricks behind it I still have awful lag.
If I look away from the bricks behind it but still looking at the wall my FPS speeds up

Or the possibility to combine/merge the default bricks to bricks with non-default dimentions (38*19*4, for example) to create less lag.
This is basically what it does behind the scenes anyway. Just build a big chunk of bricks then fly through with free cam - you will see only the exterior faces are drawn. The interior faces are merged.
Okay, I was think about something different, but related.
It occlusion bricks are possible, we definately should make them. 

It occludes players, vehicles, terrain, and pretty much everything but bricks. But I think it only does this if there's an interior in the way. (eg. you're in the bed on the bedroom map)

Badspot

  • Administrator
We have had hardware occlusion queries in the game and failed to get a performance win out of it.  We may revisit it in the future.  This is kompressor's territory, though.