Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
rpeter

Detecting bridges

Recommended Posts

Anybody has an idea how a bridge like the one in boomedit.wad from the TeamTNT website works? How can I detect such abominations? All I see is a bunchs of sidedefs facing the wrong sectors and an offthemap sector with the same sector number as the bridge itself.

Thanks
rpeter

Share this post


Link to post

What do you need this for? Being able to know this inside the game may require different information than in an editor.

Share this post


Link to post

I'd like to render them the way the traditional renderer does. If I just push those subsectors through a 3d pipeline they are rendered using the texture assigned to the sector they belong to. But the sw renderer does not use the sector's texture at all in the above bridge example, instead it renders the subs using another sector's texture (both ceiling and floor).

Share this post


Link to post

Have a look at the file src/gl/gl_data.cpp in the GZDoom source. The function PrepareSectorData is doing exactly that.

The idea is rather simple. Most of these sector tricks use self referencing sectors which means that both sides of the linedef belong to the same sector. I simply do not use this information to decide how a subsector has to be rendered. Instead I look at neighboring subsectors until I find one that contains an outside line of a sector and use that for rendering the self referencing parts.

Of course this alone will not solve all problems. Even for a rather generalized approach there's a lot of cases to consider and so far no source port has managed to find a solution for everything. Just have a look at GZDoom's src/gl/gl_missingtexture.cpp to see what is needed to handle the more common cases of rendering hackery. ;)

Share this post


Link to post

The aforementioned bridge does contain sidedefs referencing the same sector on both sides. For such cases I use modified code from Legacy and it has worked so far, but it does not recognize this bridge. I guess I'll try to setup a GZDoom project under MS Express 2008.

(Yes, GZDoom renders this case perfectly)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×