How to avoid Z-Fighting in modular assets e.g overlapping wooden frames of medieval walls

This is video of medieval village design from a popular designer.

In this video he overlaps the wooden frame of the walls into each other. My question is won’t it cause Z-Fighting?
I want to design similar modular assets, let me know if anyone have better idea of making similar assets. I like the “granularity” of these assets.

Thanks

Nah, it only happens when two polys are perfectly on top of each other, it’s fine to put for meshes to be a bit sunk into other meshes. I guess z-fighting also happens with translucent stuff like hair too (unless using masked/hair shaders). But if it looks fine in that video it should look fine in game too. If you’re getting z-fighting it mostly means you messed up your 3d model in your modeling software.

One thing you need to keep in mind is that you would want to merge the meshes using Actor Merge at the end after placing the modular stuff or you’ll waste a lot of drawcalls.

If you move away from something then it can also happen if surfaces are close–the depth of the view changes over distance so surfaces that are technically not in the same space will end up in the same depth when they’re further away and get the same Z-fighting effect.

That ‘speed’ design is using a lot of poor practices. I wouldn’t use it as a basis for understanding anything.
Neat for inspo, but nothing else.

The issue is how messy their workflow is.
In theory, what they’re doing is ok, but they aren’t conforming to any reasonable grid.
rule #1 of level design: obey the grid.

I think they get away with it because it’s a medieval setting, so by offsetting their assets a bit you can stop them from perfectly overlaping, but as @darthviper107 said, that will become a problem when you are further away, and you can see them in the video spending too long just aligning things together.

I’d suggest having a look at this GDC post by the environment and level designers on Skyrim. By having modular assets that conform to the grid, you can actually get better results than that speed design video, without having to mess about and making sure everything is aligned manually. It also means you won’t run in to z-fighting as you’d’ve put your assets together properly :wink:

1 Like

For Z-fighting far away you can change the NearClipPlane settings or just use LODs. It usually only happens when you’ve got really thin meshes though.

As for the grid stuff that makes more sense when doing artificial stuff (or things that have to fit together), a village like this can look better with imperfections. I think the meshes weren’t really set up in a modular way from the start and using a grid with meshes like that wouldn’t really help.

The greater the distance is between the near and far clipping plane the more frequent you will get Z-fighting problems.

Thank you all for responses. Much appreciated.
And yes, when mesh is not plane surface Z-Fighting does not occur. Even if it does slight offsets can work. Sticking to grid gives very procedural looking art, so… for faster design sticking to grid helps but for variety I prefer going off grid.