Knowledge Base - Fixing Polyobject Texture Bleeding

Fixing Polyobject Texture Bleeding


Texture Bleeding
Figure 1: The Poly Texture Bleeding

If you have been working with ZDoom for any length of time, Figure 1 is a familiar, and aggravating, sight. Everything is great in your level. Your polys are working perfectly, then you change a portion of the map and you suddenly get the above texture bleeding. It's enough to make you take up knitting.

I tried knitting but couldn't get my chains to go in a straight line. I then decided I would find a way to correct this problem. After quite a few hours of trial and error I found two ways to attack this problem.

One is to avoid it by building your polys last. However, this isn't always feasible or desirable. I personally like to test my levels in progress including the polys so I like to build them as I go along.

The other way to attack this problem is to simply offset the "door jambs" by a small amount, one or two units, and the problem usually disappears. This method isn't foolproof, but will correct about 98% of the cases I have tried.

Map Layout That Caused Bleeding
Figure 2: Map Layout That Caused Bleeding

Figure 2 shows the original layout that caused the texture bleeding. Everything was fine with the map until I added the small room to the side. When I compiled the map, the door suddenly shown through the area marked by the yellow line. I do not why this happens, but it is quite common from the many emails I have received on this subject.

The solution is quite simple however.

Offset Door Area
Figure 3: Offset Door Area

Notice the area in Figure 3 encircled by the yellow line. The top vertex is at a slight offset from the vertex across the poly sector. The scale here is set to two, so it isn't even noticeable in the map when you play it. This simple offset corrects the bleeding as shown in Figure 4.

Bleeding Fixed
Figure 4: Bleeding Fixed

In Figure 4, the bleeding is gone and the map looks quite normal. As you add architecture though, the bleeding may again occur. Changing the offset to lesser or greater amounts can continue to correct the problem, to a point. If you have many polys, you may not be able to correct the problem in all cases. In this event, it is best to remove all the polys and add them after you have finished the rest of the map. You can then use the above technique for any problems you may have.

By building the polys last and using this simple technique, you can eliminate your polyobject bleeding errors. You are on your own however, when it comes to knitting.

Sources

ZDoom reference by Marisa Heit.

Back